summaryrefslogtreecommitdiff
path: root/utils/modules/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'utils/modules/user.php')
-rw-r--r--utils/modules/user.php16
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;