root/dev/mods/apiuser/login.php @ 432

Revision 399, 0.8 KB (checked in by kovell, 12 years ago)

Fixes: autoupgrade smoother, Rare errors in db classes reduced, api login problems reduced, page cache notifications check if cache is active. admin mod list sorted. alliance and corp details pages load faster. all-time summary tables cached. killlist performance on large databases improved

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