summaryrefslogtreecommitdiff
path: root/protected/controllers/UserController.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/controllers/UserController.php')
-rw-r--r--protected/controllers/UserController.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/protected/controllers/UserController.php b/protected/controllers/UserController.php
index 3c28e7b..f4fe415 100644
--- a/protected/controllers/UserController.php
+++ b/protected/controllers/UserController.php
@@ -77,7 +77,12 @@ class UserController extends Controller {
// $this->performAjaxValidation($model);
if (isset($_POST['User'])) {
+ $change = false;
+ if ($_POST['User']['password'] != "" && $_POST['User']['password'] != $model->password) { $change = true;}
$model->attributes = $_POST['User'];
+ if($change) {
+ $model->password = $model->encryptPassword($_POST['User']['password']);
+ }
if ($model->save()) {
$this->redirect(array('view', 'id'=>$model->id));
}