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