public function resendActivation($email, $use_email_activation = null)
    {
        $state['error'] = true;
        $block_status = $this->isBlocked();

        if ($block_status == "block") {
            $state['message'] = $this->__lang("user_blocked");

            return $state;
        }

        if ($use_email_activation == null) {
            $state['message'] = $this->__lang('function_disabled');

            return $state;
        }

        $validateEmail = $this->validateEmail($email);

        if ($validateEmail['error']) {
            $state['message'] = $validateEmail['message'];

            return $state;
        }

        $query = "SELECT id, isactive, email FROM {$this->config->table_users} WHERE email = :email";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute(['email' => $email]);

        $found_user = $query_prepared->fetch(\PDO::FETCH_ASSOC);

		if(!$found_user) {
            $this->addAttempt();
            $state['message'] = $this->__lang("email_incorrect"); // Really: account not found!

            return $state;
        }

        // this check must be implemented in activateAccount() method
        if ($found_user['isactive']) {
            $this->addAttempt();
            $state['message'] = $this->__lang("already_activated");

            return $state;
        }

        // Create an activation entry and sends email to user
        $addRequest = $this->addRequest($found_user['id'], $email, "activation", $use_email_activation);

        // $addRequest = $this->addRequestOptimized($found_user, "activation", $use_email_activation);


        if ($addRequest['error'] == 1) {
            $this->addAttempt();
            $state['message'] = $addRequest['message'];

            return $state;
        }

        $state['error'] = false;
        $state['message'] = $this->__lang("activation_sent");
        return $state;
    }
public function resendActivation($email, $use_email_activation = null)
    {
        $state['error'] = true;
        $block_status = $this->isBlocked();

        if ($block_status == "block") {
            $state['message'] = $this->__lang("user_blocked");

            return $state;
        }

        if ($use_email_activation == null) {
            $state['message'] = $this->__lang('function_disabled');

            return $state;
        }

        $validateEmail = $this->validateEmail($email);

        if ($validateEmail['error']) {
            $state['message'] = $validateEmail['message'];

            return $state;
        }

        $query = "SELECT id, isactive, email FROM {$this->config->table_users} WHERE email = :email";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute(['email' => $email]);

        $found_user = $query_prepared->fetch(\PDO::FETCH_ASSOC);

		if(!$found_user) {
            $this->addAttempt();
            $state['message'] = $this->__lang("email_incorrect"); // Really: account not found!

            return $state;
        }

        // this check must be implemented in activateAccount() method
        if ($found_user['isactive']) {
            $this->addAttempt();
            $state['message'] = $this->__lang("already_activated");

            return $state;
        }

        // Create an activation entry and sends email to user
        $addRequest = $this->addRequest($found_user['id'], $email, "activation", $use_email_activation);

        // $addRequest = $this->addRequestOptimized($found_user, "activation", $use_email_activation);


        if ($addRequest['error'] == 1) {
            $this->addAttempt();
            $state['message'] = $addRequest['message'];

            return $state;
        }

        $state['error'] = false;
        $state['message'] = $this->__lang("activation_sent");
        return $state;
    }
public function resendActivation ( $ email , $ use_email_activation = null ) { $ state [ 'error' ] = true ; $ block_status = $ this -> isBlocked ( ) ; if ( $ block_status == "block" ) { $ state [ 'message' ] = $ this -> __lang ( "user_blocked" ) ; return $ state ; } if ( $ use_email_activation == null ) { $ state [ 'message' ] = $ this -> __lang ( 'function_disabled' ) ; return $ state ; } $ validateEmail = $ this -> validateEmail ( $ email ) ; if ( $ validateEmail [ 'error' ] ) { $ state [ 'message' ] = $ validateEmail [ 'message' ] ; return $ state ; } $ query = "SELECT id, isactive, email FROM {$this->config->table_users} WHERE email = :email" ; $ query_prepared = $ this -> dbh -> prepare ( $ query ) ; $ query_prepared -> execute ( [ 'email' => $ email ] ) ; $ found_user = $ query_prepared -> fetch ( \ PDO :: FETCH_ASSOC ) ; if ( ! $ found_user ) { $ this -> addAttempt ( ) ; $ state [ 'message' ] = $ this -> __lang ( "email_incorrect" ) ; // Really: account not found! return $ state ; } // this check must be implemented in activateAccount() method if ( $ found_user [ 'isactive' ] ) { $ this -> addAttempt ( ) ; $ state [ 'message' ] = $ this -> __lang ( "already_activated" ) ; return $ state ; } // Create an activation entry and sends email to user $ addRequest = $ this -> addRequest ( $ found_user [ 'id' ] , $ email , "activation" , $ use_email_activation ) ; // $addRequest = $this->addRequestOptimized($found_user, "activation", $use_email_activation); if ( $ addRequest [ 'error' ] == 1 ) { $ this -> addAttempt ( ) ; $ state [ 'message' ] = $ addRequest [ 'message' ] ; return $ state ; } $ state [ 'error' ] = false ; $ state [ 'message' ] = $ this -> __lang ( "activation_sent" ) ; return $ state ; }
Recreates activation email for a given email and sends
@param string $email
@param null $use_email_activation
@return array $return
Recreates activation email for a given email and sends