Yii::$service->page->message->addError('Current password is not right,If you forget your password, you can retrieve your password by forgetting your password in login page');
return;
if($change_password){
if(!$current_password){
Yii::$service->page->message->addError('current password can not empty');
return;
}
if(!$password||!$confirmation){
Yii::$service->page->message->addError('password and confirmation password can not empty');
return;
}
if($password!=$confirmation){
Yii::$service->page->message->addError('password and confirmation password must be equal');
Yii::$service->page->message->addError('Current password is not right,If you forget your password, you can retrieve your password by forgetting your password in login page');
return;
}
$identity->password=$password;
}
$identity->password=$password;
}
$identity->firstname=$firstname;
$identity->lastname=$lastname;
if($identity->validate()){
$identity->save();
Yii::$service->page->message->addCorrect('edit account info success');
returntrue;
}else{
$errors=$identity->errors;
if(is_array($errors)&&!empty($errors)){
foreach($errorsas$error){
if(is_array($error)&&!empty($error)){
foreach($erroras$er){
Yii::$service->page->message->addError($er);
$identity->firstname=$firstname;
$identity->lastname=$lastname;
if($identity->validate()){
$identity->save();
Yii::$service->page->message->addCorrect('edit account info success');