/** * Validate email * * @param $value * @param array $context * @return boolean */ public function validateEmail($value, array $context = []) { // get an user info if (null != ($userInfo = $this->model->getUserInfo($value, UserWidgetModel::USER_INFO_BY_EMAIL))) { // check the user's status if ($userInfo['status'] == UserWidgetModel::STATUS_APPROVED) { return true; } } return false; }
/** * Validate activation code * * @param $value * @param array $context * @return boolean */ public function validateActivationCode($value, array $context = []) { return $this->model->checkActivationCode($this->userId, $value); }