Skip to content

Commit dc288cf

Browse files
committed
09 January 2012
Added forgot password & change password features
1 parent 4800290 commit dc288cf

13 files changed

+477
-78
lines changed

README

Lines changed: 0 additions & 62 deletions
This file was deleted.

source/access-controlled.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
copy paste the code between <?php and ?> to the page and name the page to be php.
2222
<p>
2323
Logged in as: <?= $fgmembersite->UserFullName() ?>
24+
</p>
2425
<p>
26+
<a href='login-home.php'>Home</a>
27+
</p>
2528
</div>
2629
</body>
2730
</html>

source/change-pwd.php

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?PHP
2+
require_once("./include/membersite_config.php");
3+
4+
if(!$fgmembersite->CheckLogin())
5+
{
6+
$fgmembersite->RedirectToURL("login.php");
7+
exit;
8+
}
9+
10+
if(isset($_POST['submitted']))
11+
{
12+
if($fgmembersite->ChangePassword())
13+
{
14+
$fgmembersite->RedirectToURL("changed-pwd.html");
15+
}
16+
}
17+
18+
?>
19+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
20+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
21+
<head>
22+
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
23+
<title>Change password</title>
24+
<link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" />
25+
<script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
26+
<link rel="STYLESHEET" type="text/css" href="style/pwdwidget.css" />
27+
<script src="scripts/pwdwidget.js" type="text/javascript"></script>
28+
</head>
29+
<body>
30+
31+
<!-- Form Code Start -->
32+
<div id='fg_membersite'>
33+
<form id='changepwd' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
34+
<fieldset >
35+
<legend>Change Password</legend>
36+
37+
<input type='hidden' name='submitted' id='submitted' value='1'/>
38+
39+
<div class='short_explanation'>* required fields</div>
40+
41+
<div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
42+
<div class='container'>
43+
<label for='oldpwd' >Old Password*:</label><br/>
44+
<div class='pwdwidgetdiv' id='oldpwddiv' ></div><br/>
45+
<noscript>
46+
<input type='password' name='oldpwd' id='oldpwd' maxlength="50" />
47+
</noscript>
48+
<span id='changepwd_oldpwd_errorloc' class='error'></span>
49+
</div>
50+
51+
<div class='container'>
52+
<label for='newpwd' >New Password*:</label><br/>
53+
<div class='pwdwidgetdiv' id='newpwddiv' ></div>
54+
<noscript>
55+
<input type='password' name='newpwd' id='newpwd' maxlength="50" /><br/>
56+
</noscript>
57+
<span id='changepwd_newpwd_errorloc' class='error'></span>
58+
</div>
59+
60+
<br/><br/><br/>
61+
<div class='container'>
62+
<input type='submit' name='Submit' value='Submit' />
63+
</div>
64+
65+
</fieldset>
66+
</form>
67+
<!-- client-side Form Validations:
68+
Uses the excellent form validation script from JavaScript-coder.com-->
69+
70+
<script type='text/javascript'>
71+
// <![CDATA[
72+
var pwdwidget = new PasswordWidget('oldpwddiv','oldpwd');
73+
pwdwidget.enableGenerate = false;
74+
pwdwidget.enableShowStrength=false;
75+
pwdwidget.enableShowStrengthStr =false;
76+
pwdwidget.MakePWDWidget();
77+
78+
var pwdwidget = new PasswordWidget('newpwddiv','newpwd');
79+
pwdwidget.MakePWDWidget();
80+
81+
82+
var frmvalidator = new Validator("changepwd");
83+
frmvalidator.EnableOnPageErrorDisplay();
84+
frmvalidator.EnableMsgsTogether();
85+
86+
frmvalidator.addValidation("oldpwd","req","Please provide your old password");
87+
88+
frmvalidator.addValidation("newpwd","req","Please provide your new password");
89+
90+
// ]]>
91+
</script>
92+
93+
<p>
94+
<a href='login-home.php'>Home</a>
95+
</p>
96+
97+
</div>
98+
<!--
99+
Form Code End (see html-form-guide.com for more info.)
100+
-->
101+
102+
</body>
103+
</html>

source/changed-pwd.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
3+
<head>
4+
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
5+
<title>Changed password</title>
6+
<link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css">
7+
</head>
8+
<body>
9+
<div id='fg_membersite_content'>
10+
<h2>Changed password</h2>
11+
Your password is updated!
12+
13+
<p>
14+
<a href='logout.php'>logout</a>
15+
</p>
16+
17+
</div>
18+
</body>
19+
</html>

source/include/class.phpmailer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ function MailSend($header, $body) {
467467
$to .= $this->AddrFormat($this->to[$i]);
468468
}
469469

470-
$toArr = split(',', $to);
470+
$toArr = explode(',', $to);
471471

472472
$params = sprintf("-oi -f %s", $this->Sender);
473473
if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
@@ -1720,7 +1720,7 @@ function MsgHTML($message,$basedir='') {
17201720
$directory = dirname($url);
17211721
($directory == '.')?$directory='':'';
17221722
$cid = 'cid:' . md5($filename);
1723-
$fileParts = split("\.", $filename);
1723+
$fileParts = preg_split("/\./", $filename);
17241724
$ext = $fileParts[1];
17251725
$mimeType = $this->_mime_types($ext);
17261726
if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }

0 commit comments

Comments
 (0)