public function initialize() {
        //revert to password only functionality if multi-factor flag is off
        if ($this->_multiFactorFlag === false) {
            parent::initialize();
            return;
        }
                
        //verify that multi-factor stages is set
        if (
            !(isset($this->_multiFactorStages))
            || !(is_array($this->_multiFactorStages))
            || !(isset($this->_multiFactorStages['current']))
            || !(is_int($this->_multiFactorStages['current']))
            || !(isset($this->_multiFactorStages[1]))
            || !(is_array($this->_multiFactorStages[1]))
            || !(isset($this->keyLength))
        ) {
            throw new UserCredentialException('The multi factor stages register is initialized with an an unknown state', 2100);
        }
        
        //get the current stage (1 or 2)
        $currentStage = $this->_multiFactorStages['current'];
        
        //bootstrap depends on which stage we are in
        if ($currentStage == 1) {
            $this->_multiFactorStages[1]['statuss'] = false;
            parent::initialize();
            return;
        } elseif ($currentStage != 2) {
            throw new UserCredentialException('The current stage of the multi factor auth process is in an unknown state', 2101);
        }
        
        //get the user TOTP profile
        $userTotpProfile = $this->userTotpProfile;
        
        //we are in stage 2, check that all items are in order
        if (
            !(is_array($userTotpProfile))
            || !(isset($userTotpProfile['enc_key']))
            || !(is_string($userTotpProfile['enc_key']))
            || !(isset($userTotpProfile['totp_timestamp']))
            || !($userTotpProfile['totp_timestamp'] instanceof \DateTime)
            || !(isset($userTotpProfile['totp_timelimit']))
            || !(is_int($userTotpProfile['totp_timelimit']))
            || !(isset($this->verificationHash))
            || !(is_string($this->verificationHash))
            || !(isset($this->oneTimeToken))
            || !(is_string($this->oneTimeToken))
            || !(isset($this->currentOneTimeToken))
            || !(is_string($this->currentOneTimeToken))
        ) {
            throw new UserCredentialException('The user TOTP profile is not initialized properly', 2102);
        }
    }
public function initialize() {
        //revert to password only functionality if multi-factor flag is off
        if ($this->_multiFactorFlag === false) {
            parent::initialize();
            return;
        }
                
        //verify that multi-factor stages is set
        if (
            !(isset($this->_multiFactorStages))
            || !(is_array($this->_multiFactorStages))
            || !(isset($this->_multiFactorStages['current']))
            || !(is_int($this->_multiFactorStages['current']))
            || !(isset($this->_multiFactorStages[1]))
            || !(is_array($this->_multiFactorStages[1]))
            || !(isset($this->keyLength))
        ) {
            throw new UserCredentialException('The multi factor stages register is initialized with an an unknown state', 2100);
        }
        
        //get the current stage (1 or 2)
        $currentStage = $this->_multiFactorStages['current'];
        
        //bootstrap depends on which stage we are in
        if ($currentStage == 1) {
            $this->_multiFactorStages[1]['statuss'] = false;
            parent::initialize();
            return;
        } elseif ($currentStage != 2) {
            throw new UserCredentialException('The current stage of the multi factor auth process is in an unknown state', 2101);
        }
        
        //get the user TOTP profile
        $userTotpProfile = $this->userTotpProfile;
        
        //we are in stage 2, check that all items are in order
        if (
            !(is_array($userTotpProfile))
            || !(isset($userTotpProfile['enc_key']))
            || !(is_string($userTotpProfile['enc_key']))
            || !(isset($userTotpProfile['totp_timestamp']))
            || !($userTotpProfile['totp_timestamp'] instanceof \DateTime)
            || !(isset($userTotpProfile['totp_timelimit']))
            || !(is_int($userTotpProfile['totp_timelimit']))
            || !(isset($this->verificationHash))
            || !(is_string($this->verificationHash))
            || !(isset($this->oneTimeToken))
            || !(is_string($this->oneTimeToken))
            || !(isset($this->currentOneTimeToken))
            || !(is_string($this->currentOneTimeToken))
        ) {
            throw new UserCredentialException('The user TOTP profile is not initialized properly', 2102);
        }
    }
public function initialize ( ) { //revert to password only functionality if multi-factor flag is off
 if ( $ this -> _multiFactorFlag === false ) { parent :: initialize ( ) ; return ; } //verify that multi-factor stages is set
 if ( ! ( isset ( $ this -> _multiFactorStages ) ) || ! ( is_array ( $ this -> _multiFactorStages ) ) || ! ( isset ( $ this -> _multiFactorStages [ 'current' ] ) ) || ! ( is_int ( $ this -> _multiFactorStages [ 'current' ] ) ) || ! ( isset ( $ this -> _multiFactorStages [ 1 ] ) ) || ! ( is_array ( $ this -> _multiFactorStages [ 1 ] ) ) || ! ( isset ( $ this -> keyLength ) ) ) { throw new UserCredentialException ( 'The multi factor stages register is initialized with an an unknown state' , 2100 ) ; } //get the current stage (1 or 2)
 $ currentStage = $ this -> _multiFactorStages [ 'current' ] ; //bootstrap depends on which stage we are in
 if ( $ currentStage == 1 ) { $ this -> _multiFactorStages [ 1 ] [ 'statuss' ] = false ; parent :: initialize ( ) ; return ; } elseif ( $ currentStage != 2 ) { throw new UserCredentialException ( 'The current stage of the multi factor auth process is in an unknown state' , 2101 ) ; } //get the user TOTP profile
 $ userTotpProfile = $ this -> userTotpProfile ; //we are in stage 2, check that all items are in order
 if ( ! ( is_array ( $ userTotpProfile ) ) || ! ( isset ( $ userTotpProfile [ 'enc_key' ] ) ) || ! ( is_string ( $ userTotpProfile [ 'enc_key' ] ) ) || ! ( isset ( $ userTotpProfile [ 'totp_timestamp' ] ) ) || ! ( $ userTotpProfile [ 'totp_timestamp' ] instanceof \ DateTime ) || ! ( isset ( $ userTotpProfile [ 'totp_timelimit' ] ) ) || ! ( is_int ( $ userTotpProfile [ 'totp_timelimit' ] ) ) || ! ( isset ( $ this -> verificationHash ) ) || ! ( is_string ( $ this -> verificationHash ) ) || ! ( isset ( $ this -> oneTimeToken ) ) || ! ( is_string ( $ this -> oneTimeToken ) ) || ! ( isset ( $ this -> currentOneTimeToken ) ) || ! ( is_string ( $ this -> currentOneTimeToken ) ) ) { throw new UserCredentialException ( 'The user TOTP profile is not initialized properly' , 2102 ) ; } }
initialize the service, bootstrap before any processing

Cyril Ogana <cogana@gmail.com> - 2015-07-25

@access public
initialize the service bootstrap before any processing