Code

Updated class password to only generate proposals when they are needed.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Aug 2011 07:59:42 +0000 (07:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Aug 2011 07:59:42 +0000 (07:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20973 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/password/class_password.inc

index 8bdf26fd6334e52fd4c2aa3870e6290e9d3e9d07..df056069a208217c2a050b75408712b1fa1031b0 100644 (file)
@@ -29,19 +29,13 @@ class password extends plugin
     var $proposal = "";
     var $proposalEnabled = FALSE;
     var $proposalSelected = FALSE;
+    var $proposalInitialized = FALSE;
 
     var $forcedHash = NULL;
 
     function password(&$config, $dn= NULL, $parent= NULL)
     {
         plugin::plugin($config, $dn, $parent);
-
-        // Try to generate a password proposal, if this is successfull 
-        //  then preselect the proposal usage. 
-        $this->refreshProposal();
-        if($this->proposal != ""){
-            $this->proposalSelected = TRUE;
-        }
     }
 
     
@@ -64,6 +58,17 @@ class password extends plugin
         $smarty = get_smarty();
         $ui = get_userinfo();
 
+
+        // Try to generate a password proposal, if this is successfull 
+        //  then preselect the proposal usage. 
+        if(!$this->proposalInitialized){
+            $this->refreshProposal();
+            if($this->proposal != ""){
+                $this->proposalSelected = TRUE;
+            }
+            $this->proposalInitialized = TRUE;
+        }
+
         /* Get acls */
         $password_ACLS = $ui->get_permissions($ui->dn,"users/password");
         $smarty->assign("ChangeACL" ,  $password_ACLS);