public function validActivationKey($attribute, $params)
    {
        if ($this->hasErrors()) {
            return false;
        }
        if (($identity = $this->getIdentity()) === null) {
            return false;
        }

        $errorCode = $identity->verifyActivationKey($this->activationKey);
        switch ($errorCode) {
            default:
            case $identity::ERROR_AKEY_INVALID:
                $this->addError('activationKey', Yii::t('usr', 'Activation key is invalid.'));

                return false;
            case $identity::ERROR_AKEY_TOO_OLD:
                $this->addError('activationKey', Yii::t('usr', 'Activation key is too old.'));

                return false;
            case $identity::ERROR_AKEY_NONE:
                return true;
        }

        return true;
    }