From 8e9f52750e869a7a08e27ad7b0f30d7df3e7562c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 14 May 2008 09:55:46 +0000 Subject: [PATCH] Updated password methods, keep dialog open until set_password returns TRUE. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10886 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 5 ++++- .../include/password-methods/class_password-methods.inc | 1 + gosa-core/plugins/admin/users/class_userManagement.inc | 8 ++++++-- .../services/kerberos/class_password-methods-MIT.inc | 2 ++ .../services/kerberos/class_password-methods-heimdal.inc | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index e8b500cb1..85a2eb328 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2525,7 +2525,9 @@ function change_password ($dn, $password, $mode=0, $hash= "") } else { /* Run backend method for change/create */ - $test->set_password($password); + if(!$test->set_password($password)){ + return(FALSE); + } /* Find postmodify entries for this class */ $command= $config->search("password", "POSTMODIFY",array('menu')); @@ -2544,6 +2546,7 @@ function change_password ($dn, $password, $mode=0, $hash= "") } } } + return(TRUE); } diff --git a/gosa-core/include/password-methods/class_password-methods.inc b/gosa-core/include/password-methods/class_password-methods.inc index 6d12baf59..039886d56 100644 --- a/gosa-core/include/password-methods/class_password-methods.inc +++ b/gosa-core/include/password-methods/class_password-methods.inc @@ -99,6 +99,7 @@ class passwordMethod // besides the userAttribute entry function set_password($password) { + return(TRUE); } diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 6f7fd1276..cf05cd81a 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -287,7 +287,9 @@ class userManagement extends plugin if ($this->usertab){ if ($this->usertab->password_change_needed()){ $obj= $this->usertab->by_object['user']; - change_password ($this->usertab->dn, $_POST['new_password'],0, $obj->pw_storage); + if(!change_password ($this->usertab->dn, $_POST['new_password'],0, $obj->pw_storage)){ + return($smarty->fetch(get_template_path('password.tpl', TRUE))); + } if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){ exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr); } @@ -296,7 +298,9 @@ class userManagement extends plugin $this->usertab= NULL; } } else { - change_password ($this->dn, $_POST['new_password']); + if(!change_password ($this->dn, $_POST['new_password'])){ + return($smarty->fetch(get_template_path('password.tpl', TRUE))); + } if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){ exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr); } diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc index fbfd17c91..abe4af115 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc @@ -362,8 +362,10 @@ class passwordMethodMIT extends passwordMethod $o = new gosaSupportDaemon(); if(!$o->krb5_set_password($this->server_list[$server]['macAddress'],$this->principal,$password)){ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG); + return(FALSE); } } + return(TRUE); } diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc index 5700250cf..7adcb7103 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc @@ -201,6 +201,7 @@ class passwordMethodheimdal extends passwordMethod new msg_dialog(_("Heimdal"), msgPool::cmdexecfailed("HEIMDAL_KEYGEN",$cmd,_("Heimdal")),WARNING_DIALOG); } } + return(TRUE); } -- 2.30.2