21 array(
'login_or_email',
'required'),
22 array(
'login_or_email',
'match',
'pattern' =>
'/^[A-Za-z0-9@.-\s,]+$/u',
'message' =>
UserModule::t(
"Incorrect symbols (A-z0-9).")),
24 array(
'login_or_email',
'checkexists'),
39 if (!$this->hasErrors()) {
42 if (strpos($this->login_or_email,
"@")) {
43 $user =
User::model()->findByAttributes(array(
'email' => $this->login_or_email));
45 $this->user_id = $user->id;
48 $user =
User::model()->findByAttributes(array(
'username' => $this->login_or_email));
50 $this->user_id = $user->id;
55 if (strpos($this->login_or_email,
"@")) {
56 $this->addError(
"login_or_email",
UserModule::t(
"Email is incorrect."));
58 $this->addError(
"login_or_email",
UserModule::t(
"Username is incorrect."));