root/trunk/gui/index.php

Revision 1327, 3.0 kB (checked in by rats, 2 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 if (isset($_GET['logout'])) {
24     unset_user_login_data();
25 }
26
27 do_session_timeout();
28
29 init_login();
30
31 if (isset($_POST['uname']) && isset($_POST['upass']) && !empty($_POST['uname']) && !empty($_POST['upass'])) {
32
33     $uname = encode_idna($_POST['uname']);
34
35     check_input(trim($_POST['uname']));
36     check_input(trim($_POST['upass']));
37
38     if (register_user($uname, $_POST['upass'])) {
39         redirect_to_level_page();
40     }
41
42     header('Location: index.php');
43     exit();
44 }
45
46 if (check_user_login()) {
47     if (!redirect_to_level_page()) {
48         unset_user_login_data();
49     }
50 }
51
52 shall_user_wait();
53
54 $theme_color = isset($_SESSION['user_theme']) ? $_SESSION['user_theme'] : Config::get('USER_INITIAL_THEME');
55
56 $tpl = new pTemplate();
57
58 if (Config::get('MAINTENANCEMODE') && !isset($_GET['admin'])) {
59
60     $tpl->define('page', Config::get('LOGIN_TEMPLATE_PATH') . '/maintenancemode.tpl');
61
62     $tpl->assign(
63             array(
64                 'TR_PAGE_TITLE' => tr('ispCP Omega a Virtual Hosting Control System'),
65                 'THEME_COLOR_PATH' => Config::get('LOGIN_TEMPLATE_PATH'),
66                 'THEME_CHARSET' => tr('encoding'),
67                 'TR_MESSAGE' => nl2br(Config::get('MAINTENANCEMODE_MESSAGE')),
68                 'TR_ADMINLOGIN' => tr('Administrator login')
69                 )
70             );
71
72 } else {
73
74     $tpl->define('page', Config::get('LOGIN_TEMPLATE_PATH') . '/index.tpl');
75
76     $tpl->assign(
77             array(
78                 'TR_MAIN_INDEX_PAGE_TITLE' => tr('ispCP Omega a Virtual Hosting Control System'),
79                 'THEME_COLOR_PATH' => Config::get('LOGIN_TEMPLATE_PATH'),
80                 'THEME_CHARSET' => tr('encoding'),
81                 'TR_LOGIN' => tr('Login'),
82                 'TR_USERNAME' => tr('Username'),
83                 'TR_PASSWORD' => tr('Password'),
84                 'TR_LOGIN_INFO' => tr('Please enter your login information'),
85                 // @todo: make this configurable by ispcp-lib
86                 'TR_SSL_LINK' => isset($_SERVER['HTTPS']) ? 'http://'.htmlentities($_SERVER['HTTP_HOST']) : 'https://'.htmlentities($_SERVER['HTTP_HOST']),
87                 'TR_SSL_IMAGE' => isset($_SERVER['HTTPS']) ? 'lock.png' : 'unlock.png',
88                 'TR_SSL_DESCRIPTION' => !isset($_SERVER['HTTPS']) ? tr('Secure Connection') : tr('Normal Connection')
89                 )
90             );
91
92 }
93
94 if (Config::get('LOSTPASSWORD')) {
95     $tpl->assign('TR_LOSTPW', tr('Lost password'));
96 } else {
97     $tpl->assign('TR_LOSTPW', '');
98 }
99
100 gen_page_message($tpl);
101
102 $tpl->parse('PAGE', 'page');
103 $tpl->prnt();
104
105 if (Config::get('DUMP_GUI_DEBUG'))
106     dump_gui_debug();
107
108 ?>
Note: See TracBrowser for help on using the browser.