change_password.php
changeset 82 c255196bc447
parent 79 0c0aa144356a
child 119 f74e4f88b680
equal deleted inserted replaced
81:c72d6d51f3d3 82:c255196bc447
    18  *  You should have received a copy of the GNU General Public License
    18  *  You should have received a copy of the GNU General Public License
    19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    20  */
    20  */
    21 
    21 
    22 require_once("inc/toolkit.inc.php");
    22 require_once("inc/toolkit.inc.php");
       
    23 include_once("inc/header.inc.php");
    23 
    24 
    24 if(isset($_POST["submit"]))
    25 if($_POST["submit"]) {
    25 {
    26 	change_user_pass($_POST);
    26 	if((!isset($_POST['newpass'])) || (strlen($_POST["newpass"]) < 8))
       
    27 	{
       
    28 		error('Password length should be at least 8 characters.');
       
    29 	}
       
    30 	else
       
    31 	{
       
    32 		change_user_pass($_POST["currentpass"], $_POST["newpass"], $_POST["newpass2"]);
       
    33 	}
       
    34 }
    27 }
    35 
    28 
    36 include_once("inc/header.inc.php");
    29 echo "    <h2>" . _('Change password') . "</h2>\n";
    37 ?>
    30 echo "    <form method=\"post\" action=\"change_password.php\">\n";
    38     <h2><?php echo _('Change password'); ?></h2>
    31 echo "     <table border=\"0\" CELLSPACING=\"4\">\n";
    39     <form method="post" action="change_password.php">
    32 echo "      <tr>\n";
    40      <table border="0" CELLSPACING="4">
    33 echo "       <td class=\"n\">" . _('Current password') . ":</td>\n";
    41       <tr>
    34 echo "       <td class=\"n\"><input type=\"password\" class=\"input\" NAME=\"currentpass\" value=\"\"></td>\n";
    42        <td class="n"><?php echo _('Current password'); ?>:</td>
    35 echo "      </tr>\n";
    43        <td class="n"><input type="password" class="input" NAME="currentpass" value=""></td>
    36 echo "      <tr>\n";
    44       </tr>
    37 echo "       <td class=\"n\">" . _('New password') . ":</td>\n";
    45       <tr>
    38 echo "       <td class=\"n\"><input type=\"password\" class=\"input\" NAME=\"newpass\" value=\"\"></td>\n";
    46        <td class="n"><?php echo _('New password'); ?>:</td>
    39 echo "      </tr>\n";
    47        <td class="n"><input type="password" class="input" NAME="newpass" value=""></td>
    40 echo "      <tr>\n";
    48       </tr>
    41 echo "       <td class=\"n\">" . _('New password') . ":</td>\n";
    49       <tr>
    42 echo "       <td class=\"n\"><input type=\"password\" class=\"input\" NAME=\"newpass2\" value=\"\"></td>\n";
    50        <td class="n"><?php echo _('New password'); ?>:</td>
    43 echo "      </tr>\n";
    51        <td class="n"><input type="password" class="input" NAME="newpass2" value=""></td>
    44 echo "      <tr>\n";
    52       </tr>
    45 echo "       <td class=\"n\">&nbsp;</td>\n";
    53       <tr>
    46 echo "       <td class=\"n\">\n";
    54        <td class="n">&nbsp;</td>
    47 echo "        <input type=\"submit\" class=\"button\" NAME=\"submit\" value=\"" . _('Change password') . "\">\n";
    55        <td class="n">
    48 echo "       </td>\n";
    56         <input type="submit" class="button" NAME="submit" value="<?php echo _('Change password'); ?>">
    49 echo "      </tr>\n";
    57        </td>
    50 echo "     </table>\n";
    58       </tr>
    51 echo "    </form>\n";
    59      </table>
       
    60     </form>
       
    61 
    52 
    62 <?php
       
    63 include_once("inc/footer.inc.php");
    53 include_once("inc/footer.inc.php");
    64 ?>
    54 ?>