summaryrefslogtreecommitdiff
path: root/htdocs/login.php
blob: 398e42f61bcc8bf68dfbce2d13e4a9a2447b345c (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
// login to vim online
require_once("include/init.inc");
$page_title = "account info";

// if a login was submitted, attempt to authenticate
if($_POST{"authenticate"}){
    $userId = authenticateUser(addslashes($_POST{"userName"}), addslashes($_POST{"password"}));
    if ($userId) {
        createSession($userId);
	$referrer = addslashes($_POST{"referrer"});
        if($referrer){
            redirectToReferrer($referrer);
        } else {
            redirectToAccountPage();
        }
    }
}

include("header.php");
?>
<?php 
if($_POST{"authenticate"}){
    echo '<p><font color="red"><b>Authentication failed.</b></font></p>';
}
?>


<h1>Vim Online Login</h1>
<p>
Please log in. You must have cookies enabled.
</p>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
    <td valign="top" nowrap>
    <h2>New to vim online?</h2>
    <a href="account/register.php">Sign up now</a>.
    </td>

    <td><img src="<?=$IMAGES?>/spacer.gif" width="10" height="1" alt=""></td>
    <td class="darkbg"><img src="<?=$IMAGES?>/spacer.gif" width="1" height="1" alt=""></td>
    <td><img src="<?=$IMAGES?>/spacer.gif" width="10" height="1" alt=""></td>
    
    <td valign="top">
    <h2>Existing vim online users</h2>
    <p>
    <form name="login" method="post">
        <input type="hidden" name="authenticate" value="true">
        <input type="hidden" name="referrer" value="<?=addslashes($_GET{'referrer'})?>">
    <table cellspacing="4" cellpadding="2" border="0">
        <tr>
            <td class="prompt">username or email</td>
            <td><input type="text" name="userName"></td>
        </tr>
        <tr>
            <td class="prompt">password</td>
            <td><input type="password" name="password"></td>
        </tr>
        <tr>
            <td colspan="2" align="right"><input type="submit" value="Login"></td>
        </tr>
        <tr>
            <td colspan="2"><a href="account/forgot_password.php">Password Help</a></td>
        </tr>
    </table>
    </form>
    </td>
</tr>
</table>

<!-- fill up with spaces to make the main field wide enough -->
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<?php
include("footer.php");
?>