This repository has been archived by the owner on Aug 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
75 lines (70 loc) · 2.12 KB
/
header.php
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
<?php
if (!isset($_SESSION)) { session_start(); }
require_once("includes/functions.php");
new motor(false);
if (motor::authenticated(false)==false) {
$error_login=NULL;
if ($_POST) {
if (isset($_POST["btnlogin"])) {
$member=new member();
$member->setemail($_POST["txtlogin_email"]);
$member->setpassword($_POST["txtlogin_password"]);
if (isset($_POST["cbkeep_logged"])) {
$result=motor::login($member,true);
} else {
$result=motor::login($member,false);
}
if ($result==NULL) {
$error_login=incorrect_login;
} else if ($result->getstate==0 && strlen($result->getcode_signup)>0) {
$error_login=member_unconfirmed;
} else if ($result->getstate==0 && !strlen($result->getcode_signup)>0) {
motor::activate($_POST["txtlogin_email"]);
$_SESSION["login_reactivated"]=1;
header("Location: index.php");
} else if ($result->getstate==1 && strlen($result->getcode_signup)>0) {
motor::remove_recover_code($_POST["txtlogin_email"]);
header("Location: index.php");
} else {
header("Location: index.php");
}
}
}
?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<table style="width: 100%; background-color: #999999;">
<tr>
<td width="60%"> </td>
<td>E-mail</td>
<td><?php echo password; ?></td>
<td> </td>
</tr>
<tr>
<td><a href="index.php"><?php echo motor::sitename(); ?></a></td>
<td><input name="txtlogin_email" type="text" maxlength="100"<?php
if ($_POST) {
if (isset($_POST["btnlogin"])) {
echo " value=\"" . $_POST["txtlogin_email"] . "\"";
}
}
?> /></td>
<td><input name="txtlogin_password" type="password" maxlength="16" /></td>
<td><input name="btnlogin" type="submit" value="<?php echo button_login; ?>" /></td>
</tr>
<tr>
<td> </td>
<td><input type="checkbox" name="cbkeep_logged" /> <?php echo button_keep_me_logged_in; ?></td>
<td><a href="recover.php"><?php echo recover_password; ?></a></td>
<td><?php
if ($error_login!=NULL) {
echo incorrect_login;
} else {
echo " ";
}
?></td>
</tr>
</table>
</form>
<?php
}
?>