-
Notifications
You must be signed in to change notification settings - Fork 5
/
user_password.php
118 lines (99 loc) · 4.07 KB
/
user_password.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
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
<?php
/****************************************************************************\
* TaskFreak! *
* multi user *
******************************************************************************
* Version: 0.6.3 *
* Authors: Stan Ozier <[email protected]> *
* License: http://www.gnu.org/licenses/gpl.txt (GPL) *
******************************************************************************
* This file is part of "TaskFreak! multi user" program. *
* *
* TaskFreak! multi user is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as published *
* by the Free Software Foundation; either version 2 of the License, or (at *
* your option) any later version. *
* *
* TaskFreak! multi user is distributed in the hope that it will be *
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
\****************************************************************************/
$pPageIsPublic=true;
include '_common.php';
if (isset($_POST["email"])) {
include_once(PRJ_CLASS_PATH."pkg_com.php");
$objUserFound = new Member();
$objUserFound->setEml('email',$_POST['email']);
if ($objUserFound->email) {
if ($newpass = $objUserFound->forgotPassword("email",$_POST['email'])) {
// send email
$bodyMessage = "\r\n\r\n\tusername : ".$objUserFound->username
."\r\n\tpassword : ".$newpass;
$objMessage = new EmailMessage();
$objMessage->setUid(4);
$objMessage->load();
// $objMessage->customHeader($objUserFound);
$objMessage->send($bodyMessage, $objUserFound->get("email"));
$pReminded = true;
//echo $newpass;
} else {
$pErrorMessage = 'Error: '.$objUserFound->e("forgot");
}
} else {
$pErrorMessage = 'Error: email address not valid';
}
}
include PRJ_INCLUDE_PATH.'html/header.php';
?>
<div align="center">
<div id="horiz">
<p> </p>
<p align="center"><a href="index.php"><img src="images/freak-logo.png" border="0" alt="TaskFreak!" /></a></p>
<p> </p>
<h1>Password reminder</h1>
<?php
if ($pReminded) {
/* --- REMINDED ------------------------------------------------ */
?>
<p> </p>
<div class="box mellow">
<h2>Please check your emails</h2>
<p>An email has been sent to you containing your username and password</p>
<p><a href="login.php">Return to login form</a></p>
</div>
<p> </p>
<?php
} else {
/* --- FORM ---------------------------------------------------- */
if ($pErrorMessage) {
echo '<p class="box error" style="text-align:center">'.$pErrorMessage.'</p>';
} else {
?>
<p><b>If you are a registered member</b> but forgot your username or password, simply fill and submit the form below.</p>
<?php
}
?>
<form action="user_password.php" method="post">
<table cellpadding="3" cellspacing="0" border="0" align="center">
<tr>
<th>Email:</th>
<td><?php Tzn::qText('email',$_POST['email']); ?></td>
<td><input type="submit" name="reminder" value="Get new password"></td>
</tr>
</table>
</form>
<p>An email will be sent to you containing your username and new password.</p>
</div>
<p> </p>
<p> </p>
<p> </p>
</div>
<?php
}
include PRJ_INCLUDE_PATH.'html/footer.php';
?>