Code

Updated password methods, keep dialog open until set_password returns TRUE.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 May 2008 09:55:46 +0000 (09:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 14 May 2008 09:55:46 +0000 (09:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10886 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc
gosa-core/include/password-methods/class_password-methods.inc
gosa-core/plugins/admin/users/class_userManagement.inc
gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc
gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc

index e8b500cb176921af3a4326f32a30c3ccb86ed351..85a2eb328e669e85f8a63f9179ad6249c62a4f90 100644 (file)
@@ -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);
 }
 
 
index 6d12baf596c76294e7c0ad7150cacd151343dc7f..039886d5679257b9e2468b9903811fab6ecafe3d 100644 (file)
@@ -99,6 +99,7 @@ class passwordMethod
   // besides the userAttribute entry
   function set_password($password)
   {
+    return(TRUE);
   }
 
 
index 6f7fd1276ab95f2346851300980f53a23c446782..cf05cd81ae8c33c5f397178981ac480deb9ab670 100644 (file)
@@ -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);
           }
index fbfd17c91ebc41b62c4ae7fa4991dfe6149d027c..abe4af11587a3ff3a0aac3b0bf2157bc5159e34e 100644 (file)
@@ -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);
   }
 
 
index 5700250cf16487402f1cfa25bcf381bf82e08b07..7adcb7103c22df1ab3d910ecb37a0b316a5aa0e0 100644 (file)
@@ -201,6 +201,7 @@ class passwordMethodheimdal extends passwordMethod
         new msg_dialog(_("Heimdal"), msgPool::cmdexecfailed("HEIMDAL_KEYGEN",$cmd,_("Heimdal")),WARNING_DIALOG);
       }
     }
+    return(TRUE);
   }