Current File : /home/inlingua/public_html/faridabad/icentex/evaluation/php/forget-password.php |
<?php include_once("include/config/config.php");
include_functions(array('url','paging','file_handling','input'));
//Top main menu
/*$header_menu=new query('content as m');
$header_menu->Field='m.*';
$header_menu->Where = "where m.parent_id=0 AND name NOT IN ('Home','HELP AND SUPPORT') order by m.id ASC";
$header_menu->Displayall(); */
//
if(isset($_POST['submit']) && $_POST['submit']=='Submit'):
//print_r($_POST); exit;
$validation= new user_validation();
$validation->add('username', 'email');
$valid= new valid();
if($valid->validate($_POST, $validation->get())):
$QueryObj =new query('user');
$QueryObj->Where="where username='".trim($_POST['username'])."' ";
if($user=$QueryObj->DisplayOne()):
$QueryObj->InitilizeSQL();
$QueryObj->TableName='user';
$not=array('submit','chkShowPassword');
$Data=MakeDataArray($_POST, $not);
$Data['ip_address']=$_SERVER['REMOTE_ADDR'];
$verification=rand(10000,999999);
$Data['verification']=md5($verification);
$QueryObj->Data=$Data;
$QueryObj->Where = "where username = '".$_POST['username']."'";
$QueryObj->Data=$Data;
$QueryObj->UpdateCustom();
$url=DIR_WS_SITE.'img/iOwn-logo.png';
$sendto=$_POST['username'];
$password=$pass;
$username=$_POST['firstname'];
$verifyurl=DIR_WS_SITE."?page=verification&code=".md5($verification)."&";
send_change_password_email($url,$username,$verifyurl,$sendto);
$admin_user->set_pass_msg('Your Request Sent successfully Plz. Check Mail to Account Verification!!!.');
Redirect(make_url('forget-password'));
else:
$admin_user->set_pass_msg('Your Email Not Exits !!!');
Redirect(make_url('forget-password'));
endif;
else:
$admin_user->set_pass_msg($valid->error);
Redirect(make_url('forget-password'));
endif;
endif;
//Footer menu
?>