root/dev/common/register.php @ 188

Revision 188, 1.7 KB (checked in by exi, 14 years ago)

Changed default td width for options to 160px.
Added the appropiate timeframe to the fast contractlisttable.
Events now can also return a reference to a variable containing additional information.
Killlists now return a non formatted isk-value for losses/kills, please report any errors on other pages.
Added a custom user menu, able to be shownon every page.
Added some code for user logins, please ignore it for now.
Added a small battle statistics frame to the battle overview.
To login as admin now just leave user blank and use the admin password.

Line 
1<?php
2require_once('class.killboard.php');
3require_once('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.