public function completeActivation($activationCode)
    {
        if ($this->is_activated) {
            throw new Exception('User is already active!');
        }

        if ($activationCode == $this->activation_code) {
            $this->activation_code = null;
            $this->status = TRUE;
            $this->is_activated = TRUE;
            $this->date_activated = $this->freshTimestamp();
            $this->save();

            return TRUE;
        }

        return FALSE;
    }
public function completeActivation($activationCode)
    {
        if ($this->is_activated) {
            throw new Exception('User is already active!');
        }

        if ($activationCode == $this->activation_code) {
            $this->activation_code = null;
            $this->status = TRUE;
            $this->is_activated = TRUE;
            $this->date_activated = $this->freshTimestamp();
            $this->save();

            return TRUE;
        }

        return FALSE;
    }
public function completeActivation ( $ activationCode ) { if ( $ this -> is_activated ) { throw new Exception ( 'User is already active!' ) ; } if ( $ activationCode == $ this -> activation_code ) { $ this -> activation_code = null ; $ this -> status = TRUE ; $ this -> is_activated = TRUE ; $ this -> date_activated = $ this -> freshTimestamp ( ) ; $ this -> save ( ) ; return TRUE ; } return FALSE ; }
Attempts to activate the given user by checking the activate code. If the user is activated already, an Exception is thrown.
@param string $activationCode
@return bool
Attempts to activate the given user by checking the activate code . If the user is activated already an Exception is thrown .