diff options
author | deva <deva> | 2010-02-28 10:20:09 +0000 |
---|---|---|
committer | deva <deva> | 2010-02-28 10:20:09 +0000 |
commit | 8c69fd9b2e824114ee3cd0f6a7dcddc7e31d913c (patch) | |
tree | 5352520fe12cb1670d2d5f035483a172c467643b /utils/modules/user.php | |
parent | 5fac941e3295d4a094795aaf2f0e05c542879465 (diff) |
Added users module. Made new password lineedit widget.
Diffstat (limited to 'utils/modules/user.php')
-rw-r--r-- | utils/modules/user.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/utils/modules/user.php b/utils/modules/user.php index 5e9c23b..bd1ce37 100644 --- a/utils/modules/user.php +++ b/utils/modules/user.php @@ -18,16 +18,20 @@ class UserAdm { switch($action) { case "set": $user = $this->users->findUser($UID); - if($user && - $user->setPassword($vars['oldpwd'], $vars['newpwd'], $vars['rptpwd']) == 0) { - $this->users->write(); + if(!$user) return; + if($vars['oldpwd'] != "" && + $vars['newpwd'] != "" && + $vars['rptpwd'] != "") { + if($user->setPassword($vars['oldpwd'], $vars['newpwd'], $vars['rptpwd']) == 0) { + $this->users->write(); + } } default: $form = new Form("set"); - $form->addWidget(new LineEdit("Old password:", "oldpwd", "")); - $form->addWidget(new LineEdit("New password:", "newpwd", "")); - $form->addWidget(new LineEdit("Repeat password:", "rptpwd", "")); + $form->addWidget(new LineEditPwd("Old password:", "oldpwd", "")); + $form->addWidget(new LineEditPwd("New password:", "newpwd", "")); + $form->addWidget(new LineEditPwd("Repeat password:", "rptpwd", "")); $form->addWidget(new Button("Update")); $form->render(); break; |