Website is working!

This commit is contained in:
vladislav.khorev committed 2014-11-22 13:14:22 +00:00
1 parent c978ba8e19
commit 2ed0710575
24 files changed
+644 -119

No files matched your search

+13 -11
View File
@@ -22,7 +22,9 @@ class LoginForm extends CFormModel
{
return array(
// username and password are required
array('username, password', 'required'),
array('username, password', 'required', 'message'=>'{attribute} ' . Yii::t('app', 'Field should not be blank')),
array('username, password', 'length', 'max'=>45, 'tooLong'=>'{attribute} ' . Yii::t('app', 'Line is too long')),
// rememberMe needs to be a boolean
array('rememberMe', 'boolean'),
// password needs to be authenticated
@@ -30,15 +32,7 @@ class LoginForm extends CFormModel
);
}
/**
* Declares attribute labels.
*/
public function attributeLabels()
{
return array(
'rememberMe'=>'Remember me next time',
);
}
/**
* Authenticates the password.
@@ -50,7 +44,7 @@ class LoginForm extends CFormModel
{
$this->_identity=new UserIdentity($this->username,$this->password);
if(!$this->_identity->authenticate())
$this->addError('password','Incorrect username or password.');
$this->addError('password', Yii::t('app', 'Login or password is incorrect'));
}
}
@@ -74,4 +68,12 @@ class LoginForm extends CFormModel
else
return false;
}
function attributeLabels(){
return array(
'username' => Yii::t('app', 'Username:'),
'password' => Yii::t('app', 'Password:'),
'rememberMe' => Yii::t('app', 'Remember me'),
);
}
}