forked from exflickr/flamework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot.php
58 lines (39 loc) · 750 Bytes
/
forgot.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
<?
#
# $Id$
#
include("include/init.php");
if (! $GLOBALS['cfg']['enable_feature_password_retrieval']){
error_404();
}
login_ensure_loggedout();
#
# send the reminder?
#
if (post_str('remind')){
$email = post_str('email');
$user = users_get_by_email($email);
$ok = 1;
if (!$user){
$smarty->assign('error_nouser', 1);
$ok = 0;
}
if ($ok && $user['deleted']){
$smarty->assign('error_deleted', 1);
$ok = 0;
}
if ($ok && !users_send_password_reset_code($user)){
$smarty->assign('error_notsent', 1);
$ok = 0;
}
if ($ok){
$smarty->assign('sent_to', $user['email']);
$smarty->display('page_forgot_sent.txt');
exit;
}
}
#
# output
#
$smarty->display('page_forgot.txt');
?>