public function activate(bool $save = false) : bool
    {
        $retval = false;
        $current = $this->getValidationStatus();

        if ($current === self::USER_VALIDATION_PENDING || $current === self::USER_VALIDATION_PENDING_WITH_INVITATION) {
            $this->setActivationDatetime(date('Y-m-d H:i:s', time()));
            $this->setValidationStatus(CNabuUser::USER_ACTIVE);

            $retval = ($save ? $this->save() : true);
        }

        return $retval;
    }
public function activate(bool $save = false) : bool
    {
        $retval = false;
        $current = $this->getValidationStatus();

        if ($current === self::USER_VALIDATION_PENDING || $current === self::USER_VALIDATION_PENDING_WITH_INVITATION) {
            $this->setActivationDatetime(date('Y-m-d H:i:s', time()));
            $this->setValidationStatus(CNabuUser::USER_ACTIVE);

            $retval = ($save ? $this->save() : true);
        }

        return $retval;
    }
public function activate ( bool $ save = false ) : bool { $ retval = false ; $ current = $ this -> getValidationStatus ( ) ; if ( $ current === self :: USER_VALIDATION_PENDING || $ current === self :: USER_VALIDATION_PENDING_WITH_INVITATION ) { $ this -> setActivationDatetime ( date ( 'Y-m-d H:i:s' , time ( ) ) ) ; $ this -> setValidationStatus ( CNabuUser :: USER_ACTIVE ) ; $ retval = ( $ save ? $ this -> save ( ) : true ) ; } return $ retval ; }
Activates the User account.
@param bool $save If true then saves the User record in the database storage before return.
@return bool Returns true if the user was successfully activated.
Activates the User account .