/
forgotpass.php
68 lines (54 loc) · 1.83 KB
/
forgotpass.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
<?
/***************************************************************************
index.php
------------
product : PHP Invoice
version : 1.0 build 1 (Beta)
released : Sunday September 7 2003
copyright : Copyright © 2001-2009 Jeremy Hubert
email : support@illanti.com
website : http://www.illanti.com
The starting point for the software. Login page. DO NOT EDIT unless
you know what you are doing.
***************************************************************************/
define('SITE_ROOT','./');
require_once(SITE_ROOT . 'includes/common.php');
securePage('none');
$tpl_main_file = 'login_framework.tpl';
$tpl = & new TemplateSystem();
if (isset($_POST['btnSubmit'])) {
if ($_POST['email'] != '') {
$method = 'email';
$value = $_POST['email'];
} elseif ($_POST['username'] != '') {
$method = 'username';
$value = $_POST['username'];
}
$client = $ISL->recoverPassword($method,$value);
if (is_array($client)) {
$e = new Emailer();
$e->setMainFile('forms/email_forgotpass.tpl');
$e->setFrom($SYSTEM['email']['from']);
$e->setFromName($SYSTEM['email']['fromName']);
$e->setSubject($lang['eml_subj_forgotpass']);
$e->set('client', $client);
$e->fetchMessage();
$e->setRecipient($client['email']);
$e->setPriority('High');
$e->send();
unset($e);
} else {
trigger_error($lang['no_client_found'],E_USER_WARNING);
die();
}
$tpl->set('tbody','forgotpass_sent.tpl');
$tpl->set('message',sprintf($lang['password_sent'],'index.php'));
} else {
$tpl->set('tbody','forgotpass.tpl');
}
$tpl->set('toptext',$lang['password_recovery']);
$tpl->set('bottomtext',' ');
$tpl->set('page_title',$lang['recover_password']);
$tpl->display();
exit;
?>