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>
0 commit comments