| <?php |
| /******************************************************************************* |
| * Copyright (c) 2012 Eclipse Foundation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Denis Roy (Eclipse Foundation)- initial API and implementation |
| *******************************************************************************/ |
| |
| ob_start(); |
| |
| if($stage == "reset") { |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn" style="width: 678px;"> |
| <h1><?= $pageTitle ?></h1> |
| <p>A token has been emailed to you to allow you to reset your Eclipse.org password. Please check your Trash and Junk/Spam folders if you do not see |
| this email in your inbox.</p> |
| </div> |
| </div> |
| <?php |
| } |
| |
| if($stage == "reset2") { |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn" style="width: 678px;"> |
| <h1><?= $pageTitle ?></h1> |
| <form name="login" method="post"> |
| <table cellspacing="4"> |
| <tr><td></td><td colspan="2" style="color:#900;"><?= $error ?></td></tr> |
| <tr> |
| <td>New Password<font color="red">*</font>:</td><td><input type="password" name="password1" value="<?= $password1 ?>" size="16" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td> |
| <td id="msg_password1" style='width:250px; color:red;'></td> |
| </tr> |
| <tr> |
| <td>New Password (again)<font color="red">*</font>:</td><td><input type="password" name="password2" value="<?= $password2 ?>" size="16" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td> |
| <td id="msg_password2" style='width:250px; color:red;'></td> |
| </tr><br /> |
| <tr> |
| <td>(5 + 3) x 2 = ?<font color="red">*</font>:</td><td><input type="text" name="skill" value="" size="8" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td> |
| <td id="msg_skill" style='width:250px; color:red;'></td> |
| </tr> |
| <tr> |
| <td></td><td><input id="btn_submit" disabled="disabled" type="submit" name="submit" value="Reset password" /></td></tr> |
| </table> |
| <input type="hidden" name="token" value="<?= $token ?>" /> |
| </form> |
| </div> |
| </div> |
| <script language="javascript"> |
| function fnCheckSkill(field) { |
| var rValue = true; |
| if(document.forms['login'].skill.value != "16") { |
| rValue = false; |
| if(field == "skill") { |
| document.getElementById('msg_skill').innerHTML = "<b>That is not the right answer!</b>"; |
| } |
| } |
| else { |
| document.getElementById('msg_skill').innerHTML = ""; |
| } |
| return rValue; |
| } |
| function fnCheckPasswords(field) { |
| var rValue = true; |
| if(document.forms['login'].password1.value == "" || document.forms['login'].password1.value != document.forms['login'].password2.value) { |
| rValue = false; |
| if(field == "password1") { |
| document.getElementById('msg_password1').innerHTML = "<b>Your passwords do not match!</b>"; |
| } |
| } |
| else { |
| if (!document.forms['login'].password1.value.match(/(?=^.{6,}$)(?=.*\d)(?=.*[A-Za-z]).*$/)) { |
| rValue = false; |
| document.getElementById('msg_password1').innerHTML = "<b>Your password is too simple. It must be at least 6 characters, contain one character and one number.</b>"; |
| } |
| } |
| if(rValue) { |
| document.getElementById('msg_password1').innerHTML = ""; |
| } |
| return rValue; |
| } |
| function fnCheckForm(field) { |
| if(fnCheckPasswords(field) && fnCheckSkill(field)) { |
| document.getElementById('btn_submit').disabled=""; |
| } |
| } |
| </script> |
| <?php |
| } |
| |
| if($stage == "reset3") { |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn" style="width: 678px;"> |
| <h1><?= $pageTitle ?></h1> |
| <p>Your password was reset. You may now <a href="./">log in</a>. Please note that some Eclipse.org sites, such as Bugzilla, Wiki or Forums, may ask you to login again with your new password.</p> |
| </div> |
| </div> |
| <?php |
| } |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| ?> |