root/dev/common/register.php @ 206

Revision 206, 1.7 KB (checked in by ralle030583, 16 years ago)

-bugfix in Known Member mod corp detail
-deleted includes(db.php/class.page.php/class.killboard.php) which arent needed anymore everywhere cause of the include in the common/index.php

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