HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HCE Project DC service web UI
Bootstrap Colorpicker 2.0
Overview
CKEditor 4 Changelog
Software License Agreement
ChangeLog
Installing instructions
widgets
yii2-debug
Todo List
Deprecated List
Namespaces
Classes
Files
File List
app
protected
commands
components
config
controllers
extensions
helpers
models
modules
account
job
rights
user
components
controllers
messages
migrations
models
Profile.php
ProfileField.php
RegistrationForm.php
User.php
UserChangePassword.php
UserLogin.php
UserRecoveryForm.php
views
UserModule.php
runtime
tests
vendor
views
yiic.php
themes
index.php
File Members
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
UserChangePassword.php
Go to the documentation of this file.
1
<?php
7
class
UserChangePassword
extends
CFormModel
8
{
9
public
$oldPassword
;
10
public
$password
;
11
public
$verifyPassword
;
12
13
public
function
rules
()
14
{
15
return
Yii::app()->controller->id ==
'recovery'
? array(
16
array(
'password, verifyPassword'
,
'required'
),
17
array(
'password, verifyPassword'
,
'length'
,
'max'
=> 128,
'min'
=> 4,
'message'
=>
UserModule::t
(
"Incorrect password (minimal length 4 symbols)."
)),
18
array(
'verifyPassword'
,
'compare'
,
'compareAttribute'
=>
'password'
,
'message'
=>
UserModule::t
(
"Retype Password is incorrect."
)),
19
) : array(
20
array(
'oldPassword, password, verifyPassword'
,
'required'
),
21
array(
'oldPassword, password, verifyPassword'
,
'length'
,
'max'
=> 128,
'min'
=> 4,
'message'
=>
UserModule::t
(
"Incorrect password (minimal length 4 symbols)."
)),
22
array(
'verifyPassword'
,
'compare'
,
'compareAttribute'
=>
'password'
,
'message'
=>
UserModule::t
(
"Retype Password is incorrect."
)),
23
array(
'oldPassword'
,
'verifyOldPassword'
),
24
);
25
}
26
30
public
function
attributeLabels
()
31
{
32
return
array(
33
'oldPassword'
=>
UserModule::t
(
"Old Password"
),
34
'password'
=>
UserModule::t
(
"password"
),
35
'verifyPassword'
=>
UserModule::t
(
"Retype Password"
),
36
);
37
}
38
42
public
function
verifyOldPassword
($attribute, $params)
43
{
44
if
(
User::model
()->notsafe()->findByPk(Yii::app()->user->id)->password != Yii::app()->getModule(
'user'
)->encrypting($this->$attribute)) {
45
$this->addError($attribute,
UserModule::t
(
"Old Password is incorrect."
));
46
}
47
}
48
}
app
protected
modules
user
models
UserChangePassword.php
Generated on Tue Jun 30 2015 20:12:37 for HCE Project DC service web UI by
1.8.1.2