application/controllers/User.php
/**
	 * Verification of a user by email for recovery
	 * 
	 * @param  int     the user ID
	 * @param  string  the passwd recovery code
	 */
Verification of a user by email for recovery

@param  int     the user ID
@param  string  the passwd recovery code
Verification of a user by email for recovery @param int the user ID @param string the passwd recovery code
public function recovery_verification( $user_id = '', $recovery_code = '' )
	{
		if( $on_hold = $this->authentication->current_hold_status( TRUE ) )
		{
			$view_data['disabled'] = 1;
		}
		else
		{
			$this->load->model('user_model');
			if( 
				is_numeric( $user_id ) && strlen( $user_id ) <= 10 &&
				strlen( $recovery_code ) == 64 &&
				$recovery_data = $this->user_model->get_recovery_verification_data( $user_id ) )
			{
				if( $recovery_data->passwd_recovery_code == $this->_hash_recovery_code( $recovery_data->user_salt, $recovery_code ) )
				{
					$view_data['user_id']       = $user_id;
					$view_data['user_name']     = $recovery_data->user_name;
					$view_data['recovery_code'] = $recovery_data->passwd_recovery_code;
				}
				else
				{
					$view_data['recovery_error'] = 1;
					$this->authentication->log_error('');
				}
			}
			else
			{
				$view_data['recovery_error'] = 1;
				$this->authentication->log_error('');
			}
			if( 
				$this->tokens->match && 
				isset( $view_data['user_name'] ) && 
				$view_data['user_name'] !== FALSE 
			)
			{
				$this->user_model->recovery_password_change();
			}
		}
		$this->load->view( 'user/choose_password_form', $view_data );
	}
public function recovery_verification ( $ user_id = '' , $ recovery_code = '' ) { if ( $ on_hold = $ this -> authentication -> current_hold_status ( TRUE ) ) { $ view_data [ 'disabled' ] = 1 ; } else { $ this -> load -> model ( 'user_model' ) ; if ( is_numeric ( $ user_id ) && strlen ( $ user_id ) <= 10 && strlen ( $ recovery_code ) == 64 && $ recovery_data = $ this -> user_model -> get_recovery_verification_data ( $ user_id ) ) { if ( $ recovery_data -> passwd_recovery_code == $ this -> _hash_recovery_code ( $ recovery_data -> user_salt , $ recovery_code ) ) { $ view_data [ 'user_id' ] = $ user_id ; $ view_data [ 'user_name' ] = $ recovery_data -> user_name ; $ view_data [ 'recovery_code' ] = $ recovery_data -> passwd_recovery_code ; } else { $ view_data [ 'recovery_error' ] = 1 ; $ this -> authentication -> log_error ( '' ) ; } } else { $ view_data [ 'recovery_error' ] = 1 ; $ this -> authentication -> log_error ( '' ) ; } if ( $ this -> tokens -> match && isset ( $ view_data [ 'user_name' ] ) && $ view_data [ 'user_name' ] !== FALSE ) { $ this -> user_model -> recovery_password_change ( ) ; } } $ this -> load -> view ( 'user/choose_password_form' , $ view_data ) ; }
Verification of a user by email for recovery
Verification of a user by email for recovery
/// If IP is on hold, display message // Load resources /**
				 * Make sure that $user_id is a number and less 
				 * than or equal to 10 characters long
				 */ /**
				 * Make sure that $recovery code is exactly 64 characters long
				 */ /**
				 * Try to get a hashed password recovery 
				 * code and user salt for the user.
				 */ /**
				 * Check that the recovery code from the 
				 * email matches the hashed recovery code.
				 */ // Link is bad so show message // Log an error // Link is bad so show message // Log an error /**
			 * If form submission is attempting to change password 
			 * verify that the user_name was good, because there will only
			 * be a user_name if everything else was good.
			 */