From e14bce5a9de98df6d19ea4ce7243bc7b19c7904b Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 10 Mar 2016 20:41:23 -0500 Subject: Fix function CommonModel::saveSettingUser() Farious fixes for this form submission handler * missspelled variable names (*Password => *Passwd) * Added a notice message for password change success --- app/model/common.mod.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/model/common.mod.php b/app/model/common.mod.php index 9289c21..cbcbd4b 100644 --- a/app/model/common.mod.php +++ b/app/model/common.mod.php @@ -40,8 +40,8 @@ class CommonModel extends MasterModel $form->field_text("curPasswd", null, false); $form->field_text("newPasswd", null, false); $form->field_text("confPasswd", null, false); - $form->field_text("alias", null, false); - $form->field_text("email", null, false); + $form->field_text("alias", "", false); + $form->field_text("email", "", false); $form->field_text("emailConfKey", null, false); if (!$form->populate($input)) @@ -60,10 +60,13 @@ class CommonModel extends MasterModel if ($form->setPasswd == "true") { - if ($user->validatePassword($form->curPassword)) + if ($user->validatePassword($form->curPasswd)) { - if ($form->newPasswd == $form->confPassword) + if ($form->newPasswd == $form->confPasswd) + { $user->setPassword($form->newPasswd); + $this->logNotice("Password updated successfully"); + } else $this->logWarning("Password not changed -- Passwords did not match"); } -- cgit v1.2.3