root/dev/common/register.php @ 195

Revision 190, 1.8 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.killboard.php');
3require_once('common/includes/class.page.php');
4
5$killboard = new Killboard(KB_SITE);
6$page = new Page('User - Registration');
7
8if (config::get('user_regdisabled'))
9{
10    $page->error('Registration has been disabled.');
11    return;
12}
13
14if (!config::get('user_noigb') && !IS_IGB)
15{
16    $page->error('You have to use the IGB to register.');
17    return;
18}
19
20if (isset($_POST['submit']))
21{
22    $error = false;
23    if (config::get('user_regpass'))
24    {
25        if ($_POST['regpass'] != config::get('user_regpass'))
26        {
27            $smarty->assign('error', 'Registration password does not match.');
28            $error = true;
29        }
30    }
31
32    if (!$_POST['usrlogin'])
33    {
34        $smarty->assign('error', 'You missed to specify a login.');
35        $error = true;
36    }
37
38    if (!$_POST['usrpass'])
39    {
40        $smarty->assign('error', 'You missed to specify a password.');
41        $error = true;
42    }
43
44    if (strlen($_POST['usrpass']) < 3)
45    {
46        $smarty->assign('error', 'Your password needs to have at least 4 chars.');
47        $error = true;
48    }
49
50    if (!$error)
51    {
52        $pilot = null;
53        $id = null;
54        if (IS_IGB)
55        {
56            $pilot = $_SERVER["HTTP_EVE_CHARNAME"];
57            $_POST['usrlogin'] = $pilot;
58            $id = $_SERVER["HTTP_EVE_CHARID"];
59        }
60        user::register(slashfix($_POST['usrlogin']), slashfix($_POST['usrpass']), $pilot, $id);
61        $page->setContent('Account registered.');
62        $page->generate();
63        return;
64    }
65}
66
67if (IS_IGB)
68{
69    $smarty->assign('user_name', $_SERVER["HTTP_EVE_CHARNAME"]);
70}
71
72$page->setContent($smarty->fetch(get_tpl('user_register')));
73$page->generate();
74?>
Note: See TracBrowser for help on using the browser.