root/tags/omega-1.0.0-rc3/gui/index.php

Revision 888, 2.9 kB (checked in by rats, 1 year ago)

* Fixed #817: Wrong regex in awstats config

  • Fixed #812: welcome mail for domain customers: "from" not rfc2822 conform
Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2007 by ispCP | http://isp-control.net
7  * @link         http://isp-control.net
8  * @author         ispCP Team (2007)
9  *
10  * @license
11  *   This program is free software; you can redistribute it and/or modify it under
12  *   the terms of the MPL General Public License as published by the Free Software
13  *   Foundation; either version 1.1 of the License, or (at your option) any later
14  *   version.
15  *   You should have received a copy of the MPL Mozilla Public License along with
16  *   this program; if not, write to the Open Source Initiative (OSI)
17  *   http://opensource.org | osi@opensource.org
18  */
19
20 require 'include/ispcp-lib.php';
21
22 if (isset($_GET['logout'])) {
23     unset_user_login_data();
24 }
25
26 do_session_timeout();
27
28 init_login();
29
30 if (isset($_POST['uname']) && isset($_POST['upass']) && !empty($_POST['uname']) && !empty($_POST['upass'])) {
31
32     $uname = encode_idna($_POST['uname']);
33
34     check_input($_POST['uname']);
35     check_input($_POST['upass']);
36
37     if (register_user($uname, $_POST['upass'])) {
38         redirect_to_level_page();
39     }
40
41     header('Location: index.php');
42     exit();
43 }
44
45 if (check_user_login()) {
46     if (!redirect_to_level_page()) {
47         unset_user_login_data();
48     }
49 }
50
51 shall_user_wait();
52
53 if (isset($_SESSION['user_theme'])) {
54     $theme_color = $_SESSION['user_theme'];
55 } else {
56     $theme_color = $cfg['USER_INITIAL_THEME'];
57 }
58
59 $tpl = new pTemplate();
60
61 if ($cfg['MAINTENANCEMODE'] && !isset($_GET['admin'])) {
62
63     $tpl->define('page', $cfg['LOGIN_TEMPLATE_PATH'].'/maintenancemode.tpl');
64
65     $tpl->assign(
66             array(
67                 'TR_PAGE_TITLE' => tr('ispCP Omega a Virtual Hosting Control System'),
68                 'THEME_COLOR_PATH' => $cfg['LOGIN_TEMPLATE_PATH'],
69                 'THEME_CHARSET' => tr('encoding'),
70                 'TR_MESSAGE' => nl2br($cfg['MAINTENANCEMODE_MESSAGE']),
71                 'TR_ADMINLOGIN' => tr('Administrator login')
72                 )
73             );
74
75 } else {
76
77     $tpl->define('page', $cfg['LOGIN_TEMPLATE_PATH'].'/index.tpl');
78
79     $tpl->assign(
80             array(
81                 'TR_MAIN_INDEX_PAGE_TITLE' => tr('ispCP Omega a Virtual Hosting Control System'),
82                 'THEME_COLOR_PATH' => $cfg['LOGIN_TEMPLATE_PATH'],
83                 'THEME_CHARSET' => tr('encoding'),
84                 'TR_LOGIN' => tr('Login'),
85                 'TR_USERNAME' => tr('Username'),
86                 'TR_PASSWORD' => tr('Password'),
87                 'TR_LOGIN_INFO' => tr('Please enter your login information'),
88                 // Please make this configurable by ispcp-lib
89                 'TR_SSL_LINK' => isset($_SERVER['HTTPS']) ? 'http://'.htmlentities($_SERVER['HTTP_HOST']) : 'https://'.htmlentities($_SERVER['HTTP_HOST']),
90                 'TR_SSL_IMAGE' => isset($_SERVER['HTTPS']) ? 'lock.png' : 'unlock.png',
91                 'TR_SSL_DESCRIPTION' => !isset($_SERVER['HTTPS']) ? tr('Secure Connection') : tr('Normal Connection')
92                 )
93             );
94
95 }
96
97 if ($cfg['LOSTPASSWORD'])
98     $tpl->assign('TR_LOSTPW', tr('Lost password'));
99 else
100     $tpl->assign('TR_LOSTPW', '');
101
102 gen_page_message($tpl);
103
104 $tpl->parse('PAGE', 'page');
105 $tpl->prnt();
106
107 if ($cfg['DUMP_GUI_DEBUG'])
108     dump_gui_debug();
109
110 ?>
111
Note: See TracBrowser for help on using the browser.