1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<?php global $VARS;
$t = $VARS['template'];
$username = $VARS['username'];
$password = $VARS['password'];
$t->header('Authentication');
$t->openTag('form',array('action'=>$t->url('auth'), 'method'=>"post"));
$t->openFieldset('Login');
switch ($VARS['login_code']) {
case -1: break;
case 0:
$t->inputP('Successfully logged in as '.
htmlentities($username).'.');
if (isset($VARS['url'])) {
$url = htmlentities($VARS['url']);
$t->inputP($t->link($url,
'Return to the page you were on.',
true));
}
$t->closeFieldset();
$t->closeTag('form');
return;
break;
case 1:
$t->inputP("Password does not match username.",
array('class'=>'error'));
break;
case 2:
$t->inputP("Username <q>$username</q> does not exist.");
$username = '';
break;
}
$t->inputText( 'username', 'Username:', '', $username);
$t->inputPassword('password', 'Password:', '', $password);
$t->openTag('li');
$t->tag('input', array('type'=>'submit', 'value'=>'Login'));
$t->closeTag('li');
$t->closeFieldset();
$t->tag('input', array('type'=>'hidden',
'name'=>'action',
'value'=>'login'));
if (isset($VARS['url'])) {
$url = htmlentities($VARS['url']);
$t->tag('input', array('type'=>'hidden',
'name'=>'url',
'value'=>$url));
}
$t->closeTag('form');
|