root/trunk/gui/client/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('CLIENT_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     $user_lang = $_POST['def_language'];
40     $query = <<<SQL_QUERY
41         update
42             user_gui_props
43         set
44             lang = ?
45         where
46             user_id = ?
47 SQL_QUERY;
48
49     $rs = exec_query($sql, $query, array($user_lang, $user_id));
50     unset($_SESSION['user_def_lang']);
51     $_SESSION['user_def_lang'] = $user_lang;
52     set_page_message(tr('User language updated successfully!'));
53 }
54
55 $theme_color = Config::get('USER_INITIAL_THEME');
56 // ko ima jump from other user interface neka esik i optica da ostanat tezi na
57 // ska4ashtijat user
58 if (!isset($_SESSION['logged_from']) && !isset($_SESSION['logged_from_id'])) {
59     list($user_def_lang, $user_def_layout) = get_user_gui_props($sql, $_SESSION['user_id']);
60 } else {
61     $user_def_layout = $_SESSION['user_theme'];
62
63     $user_def_lang = $_SESSION['user_def_lang'];
64 }
65
66 gen_def_language($tpl, $sql, $user_def_lang);
67
68 $tpl->assign(
69     array('TR_CLIENT_LANGUAGE_TITLE' => tr('ispCP - Client/Change Language'),
70         'THEME_COLOR_PATH' => "../themes/$theme_color",
71         'THEME_CHARSET' => tr('encoding'),
72         'ISP_LOGO' => get_logo($_SESSION['user_id'])
73         )
74     );
75
76 /*
77  *
78  * static page messages.
79  *
80  */
81
82 gen_client_mainmenu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/main_menu_general_information.tpl');
83 gen_client_menu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/menu_general_information.tpl');
84
85 gen_logged_from($tpl);
86
87 check_permissions($tpl);
88
89 $tpl->assign(
90     array('TR_LANGUAGE' => tr('Language'),
91         'TR_CHOOSE_DEFAULT_LANGUAGE' => tr('Choose default language'),
92         'TR_SAVE' => tr('Save'),
93         )
94     );
95
96 gen_page_message($tpl);
97
98 $tpl->parse('PAGE', 'page');
99
100 $tpl->prnt();
101
102 if (Config::get('DUMP_GUI_DEBUG'))
103     dump_gui_debug();
104
105 unset_messages();
106
107 ?>
Note: See TracBrowser for help on using the browser.