root/trunk/gui/admin/language.php

Revision 1327, 2.9 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('ADMIN_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
39     $user_id = $_SESSION['user_id'];
40
41     $user_lang = $_POST['def_language'];
42
43     $query = <<<SQL_QUERY
44         update
45             user_gui_props
46         set
47             lang = ?
48         where
49             user_id = ?
50 SQL_QUERY;
51
52     $rs = exec_query($sql, $query, array($user_lang, $user_id));
53
54     unset($_SESSION['user_def_lang']);
55     $_SESSION['user_def_lang'] = $user_lang;
56     set_page_message(tr('User language updated successfully!'));
57 }
58
59 $theme_color = Config::get('USER_INITIAL_THEME');
60
61
62 if (!isset($_SESSION['logged_from']) && !isset($_SESSION['logged_from_id'])) {
63         list($user_def_lang, $user_def_layout) = get_user_gui_props($sql, $_SESSION['user_id']);
64 } else {
65         $user_def_layout = $_SESSION['user_theme'];
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(
73                         'TR_CLIENT_LANGUAGE_TITLE' => tr('ispCP - Admin/Change Language'),
74                         'THEME_COLOR_PATH' => "../themes/$theme_color",
75                         'THEME_CHARSET' => tr('encoding'),
76                         'ISP_LOGO' => get_logo($_SESSION['user_id'])
77                      )
78               );
79
80
81
82 /*
83  *
84  * static page messages.
85  *
86  */
87
88 gen_admin_mainmenu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/main_menu_general_information.tpl');
89 gen_admin_menu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/menu_general_information.tpl');
90
91 gen_logged_from($tpl);
92
93 check_permissions($tpl);
94
95 $tpl->assign(
96                 array(
97                        'TR_LANGUAGE' => tr('Language'),
98                         'TR_CHOOSE_DEFAULT_LANGUAGE' => tr('Choose default language'),
99                         'TR_SAVE' => tr('Save'),
100                      )
101               );
102
103 gen_page_message($tpl);
104
105 $tpl->parse('PAGE', 'page');
106
107 $tpl->prnt();
108
109 if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug();
110
111 unset_messages();
112
113 ?>
Note: See TracBrowser for help on using the browser.