User Tools

Site Tools


portals:change-password

Password.php

On this page subscribers (who are authenticated) can change their password.

<?php
	require_once($_SERVER['DOCUMENT_ROOT']."/hsm/include/initialize.php");
	require($_SERVER['DOCUMENT_ROOT']."/hsm/password_execute.php");	
?>

Initialize.php will initialize all the standard functions and variables. Password_execute.php will execute the action.

   <form method="post"  onSubmit="this.submit.disabled=true;">
      <b>Username:</b><input type="text" name="username" value="<?=$_SESSION['PORTAL']['user']?>" readonly>     
      <b>New password:</b><input type="password" name="password">
      <b>Re-enter new password:</b><input type="password" name="re_password">                                       
       <input name="submit" type="submit" <?=(isset($_SESSION['PORTAL']['preview'])?"disabled":"")?> value="Change">
   </form>

In order to trigger a password reset in password_execute $_POST['submit'] must be set and $_POST['password'] and $_POST['re_password'] should be equal and contain the new password. It's possible the operation fails. The variable $error will contain the fault. You can modify the message using Portal Languages.

portals/change-password.txt · Last modified: 2015/10/30 14:59 by admin