PHP Classes

File: contents/modules/admin/page/change_password.php

Recommend this page to a friend!
  Classes of Subin Siby   Lobby   contents/modules/admin/page/change_password.php   Download  
File: contents/modules/admin/page/change_password.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Lobby
Web OS to install and run Web applications
Author: By
Last change:
Date: 8 years ago
Size: 2,001 bytes
 

Contents

Class file image Download
<html>
  <head>
    <?php
   
\Lobby::doHook("admin.head.begin");
    \
Lobby::head("Change Password");
   
?>
</head>
  <body>
    <?php \Lobby::doHook("admin.body.begin");?>
<div class="workspace">
      <div class="contents">
        <h2>Change Password</h2>
        <?php
       
if(isset($_POST['change_password'])){
          if(isset(
$_POST['current_password']) && $_POST['current_password'] != "" && isset($_POST['new_password']) && $_POST['new_password'] != "" && isset($_POST['retype_password']) && $_POST['retype_password'] != "" && isset($_POST['current_password']) && $_POST['current_password'] != ""){
         
           
$curpass = $_POST['current_password'];
           
$new_password = $_POST['new_password'];
           
$retype_password = $_POST['retype_password'];
         
            if(
$new_password != $retype_password){
              echo
"<p><h2>Passwords Doesn't match</h2><p>The passwords you entered didn't match. Try again.</p></p>";
            }else{
             
$change_password = \Fr\LS::changePassword($curpass, $new_password);
              if(
$change_password === true){
                echo
"<h2>Password Changed Successfully</h2>";
              }
            }
          }else{
            echo
"<p><h2>Password Fields was blank</h2><p>Form fields were left blank</p></p>";
          }
        }
       
?>
<form action="<?php echo \Lobby::u();?>" method='POST'>
          <label>
            <p>Current Password</p>
            <input type='password' name='current_password' />
          </label>
          <label>
            <p>New Password</p>
            <input type='password' name='new_password' />
          </label>
          <label>
            <p>Retype New Password</p>
            <input type='password' name='retype_password' />
          </label>
          <button style="display: block;margin-top: 10px;" name='change_password' type='submit'>Change Password</button>
        </form>
      </div>
    </div>
  </body>
</html>