root/trunk/gui/reseller/language.php

Revision 1327, 2.8 kB (checked in by rats, 4 months ago)

* Fixed: --scan-knownbad-files and --check-deleted are no longer supported by rkhunter
* Fixed #1471: chkrootkit should be in lenny / hardy
* Updated Chinese (simplified)
* Updated German
* Fixed #1475: typo on installation (ispcp-setup)
* Fixed: default user for rkhunter.log

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 require '../include/ispcp-lib.php';
22
23 check_login(__FILE__);
24
25 $tpl = new pTemplate();
26 $tpl->define_dynamic('page', Config::get('RESELLER_TEMPLATE_PATH') . '/language.tpl');
27 $tpl->define_dynamic('page_message', 'page');
28 $tpl->define_dynamic('def_language', 'page');
29 $tpl->define_dynamic('logged_from', 'page');
30
31 /*
32  *
33  * page actions.
34  *
35  */
36
37 if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_lang') {
38     $user_id = $_SESSION['user_id'];
39
40     $user_lang = $_POST['def_language'];
41
42     $query = <<<SQL_QUERY
43         update
44             user_gui_props
45         set
46             lang = ?
47         where
48             user_id = ?
49 SQL_QUERY;
50
51     $rs = exec_query($sql, $query, array($user_lang, $user_id));
52
53     unset($_SESSION['user_def_lang']);
54     $_SESSION['user_def_lang'] = $user_lang;
55     set_page_message(tr('User language updated successfully!'));
56 }
57
58 $theme_color = Config::get('USER_INITIAL_THEME');
59 // ko ima jump from other user interface neka esik i optica da ostanat tezi na
60 // ska4ashtijat user
61 if (!isset($_SESSION['logged_from']) && !isset($_SESSION['logged_from_id'])) {
62     list($user_def_lang, $user_def_layout) = get_user_gui_props($sql, $_SESSION['user_id']);
63 } else {
64     $user_def_layout = $_SESSION['user_theme'];
65
66     $user_def_lang = $_SESSION['user_def_lang'];
67 }
68
69 gen_def_language($tpl, $sql, $user_def_lang);
70
71 $tpl->assign(
72     array('TR_CLIENT_LANGUAGE_TITLE' => tr('ispCP - Reseller/Change Language'),
73         'THEME_COLOR_PATH' => "../themes/$theme_color",
74         'THEME_CHARSET' => tr('encoding'),
75         'ISP_LOGO' => get_logo($_SESSION['user_id'])
76         )
77     );
78
79 /*
80  *
81  * static page messages.
82  *
83  */
84
85 gen_reseller_mainmenu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/main_menu_general_information.tpl');
86 gen_reseller_menu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/menu_general_information.tpl');
87
88 gen_logged_from($tpl);
89
90 check_permissions($tpl);
91
92 $tpl->assign(
93     array('TR_LANGUAGE' => tr('Language'),
94         'TR_CHOOSE_DEFAULT_LANGUAGE' => tr('Choose default language'),
95         'TR_SAVE' => tr('Save'),
96         )
97     );
98
99 gen_page_message($tpl);
100
101 $tpl->parse('PAGE', 'page');
102 $tpl->prnt();
103
104 if (Config::get('DUMP_GUI_DEBUG'))
105     dump_gui_debug();
106
107 unset_messages();
108
109 ?>
Note: See TracBrowser for help on using the browser.