Code

Only generate password proposals when they are needed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Aug 2011 08:03:54 +0000 (08:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Aug 2011 08:03:54 +0000 (08:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20974 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 2ff63b318ba7029ce8edbfbfc343495ae0205c56..e73d414926f30c34bd4fb380462d6e827c27fef3 100644 (file)
@@ -29,6 +29,7 @@ class password extends plugin
   var $proposal = "";
   var $proposalEnabled = FALSE;
   var $proposalSelected = FALSE;
+  var $proposalInitialized = FALSE;
 
   var $forcedHash = NULL;
 
@@ -37,12 +38,6 @@ class password extends plugin
   {
       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;
-      }
   }
 
   function forceHash($hash)
@@ -58,6 +53,16 @@ class password extends plugin
 
   function execute()
   {
+      // 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;
+      }
+
     plugin::execute();
     $smarty = get_smarty();
     $smarty->assign("usePrototype", "true");