From 8b649b437b31ddd1ff3baeb2141658e2df19b532 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 10 Dec 2008 09:32:52 +0000 Subject: [PATCH] Added message if account cannot be locked git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13233 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 1171849cc..9bf6ea459 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -648,20 +648,32 @@ class userManagement extends plugin /* Get entry check current status */ $val = $this->list[$s_entry]; if (!preg_match("/w/",$this->ui->get_permissions($val['dn'],"users/password"))){ - msg_dialog::display(_("Password change"), + msg_dialog::display(_("Password locking"), _("You have no permission to change the lock status for this user!"),WARNING_DIALOG); }else{ $pwd = $val['userPassword'][0]; $method = passwordMethod::get_method($pwd,$val['dn']); + $success= false; if($method instanceOf passwordMethod){ if($method->is_locked($this->config,$val['dn'])){ - $method->unlock_account($this->config,$val['dn']); + $success= $method->unlock_account($this->config,$val['dn']); }else{ - $method->lock_account($this->config,$val['dn']); + $success= $method->lock_account($this->config,$val['dn']); + } + + /* Check for success */ + if (!$success){ + $hn= $method->get_hash_name(); + if (is_array($hn)){ + $hn= $hn[0]; + } + msg_dialog::display(_("Password locking"), + sprintf(_("Password method '%s' does not support locking. Account has not been locked!"), $hn),WARNING_DIALOG); } }else{ // Can't lock unknown methods. } + } } -- 2.30.2