root/dev/common/login.php @ 195

Revision 190, 0.7 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2require_once('common/includes/class.page.php');
3
4$page = new Page('Login');
5
6if (trim($_POST['usrpass']))
7{
8    if ($_POST['usrlogin'] == '' && $_POST['usrpass'] == ADMIN_PASSWORD)
9    {
10        Session::create(true);
11
12        header('Location: ?a=admin');
13    }
14    else
15    {
16        $result = user::login($_POST['usrlogin'], $_POST['usrpass']);
17        if ($result)
18        {
19            header('Location: ?a=home');
20        }
21        else
22        {
23            $smarty->assign('error', 'Login error, please check your username and password.');
24        }
25    }
26}
27
28$page->setContent($smarty->fetch(get_tpl('user_login')));
29$page->generate();
30?>
Note: See TracBrowser for help on using the browser.