application/controllers/admin/PasswordReset.php
/* Check the token expiry is valid */
Check the token expiry is valid
Check the token expiry is valid
public function check_user_token($token=NULL){
        $token =  $_POST['token'];
        if(!$token){
        	$response = array(
                            'ResponseCode' => 0,
                            'ResponseMessage' => 'FAILURE', 
                            'Comments' => 'This link is invalid.',
                            'Code' => 0,
                            'Result' =>false,
                            'Status' =>400
                         );
				echo json_encode($response);  exit();
        }
        $forgotTokenExpiry = $this->forgotTokenExpiry($token);
        if ($forgotTokenExpiry){
            $status = $this->is_token_active($forgotTokenExpiry);            
            if($status){  
                $response = array(
                            'ResponseCode' => 0,
                            'ResponseMessage' => 'FAILURE', 
                            'Comments' => 'This link has been expired.',
                            'Code' => 0,
                            'Result' =>false,
                            'Status' =>400
                         );
				echo json_encode($response); exit(); 
            } else{
            	$response = array(
                            'ResponseCode' => 1,
                            'ResponseMessage' => 'SUCCESS', 
                            'Comments' => 'This link is valid.',
                            'Code' => 1,
                            'Result' =>true,
                            'Status' =>200
                         );
				echo json_encode($response);  exit();
            }           
        }else{
             $response = array(
                            'ResponseCode' => 0,
                            'ResponseMessage' => 'FAILURE', 
                            'Comments' => 'This link is invalid.',
                            'Code' => 2,
                            'Result' =>false,
                            'Status' =>400
                         );
				echo json_encode($response); exit();
        }
    }
public function check_user_token ( $ token = NULL ) { $ token = $ _POST [ 'token' ] ; if ( ! $ token ) { $ response = array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'This link is invalid.' , 'Code' => 0 , 'Result' => false , 'Status' => 400 ) ; echo json_encode ( $ response ) ; exit ( ) ; } $ forgotTokenExpiry = $ this -> forgotTokenExpiry ( $ token ) ; if ( $ forgotTokenExpiry ) { $ status = $ this -> is_token_active ( $ forgotTokenExpiry ) ; if ( $ status ) { $ response = array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'This link has been expired.' , 'Code' => 0 , 'Result' => false , 'Status' => 400 ) ; echo json_encode ( $ response ) ; exit ( ) ; } else { $ response = array ( 'ResponseCode' => 1 , 'ResponseMessage' => 'SUCCESS' , 'Comments' => 'This link is valid.' , 'Code' => 1 , 'Result' => true , 'Status' => 200 ) ; echo json_encode ( $ response ) ; exit ( ) ; } } else { $ response = array ( 'ResponseCode' => 0 , 'ResponseMessage' => 'FAILURE' , 'Comments' => 'This link is invalid.' , 'Code' => 2 , 'Result' => false , 'Status' => 400 ) ; echo json_encode ( $ response ) ; exit ( ) ; } }
Check the token expiry is valid
Check the token expiry is valid
//echo json_encode($token);exit(); // $this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'Token Mismatch','Result'=>''), 401);