From 99702041df86575643d98d0f7c38d7ffb8489588 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 24 Aug 2011 07:59:42 +0000 Subject: [PATCH] Updated class password to only generate proposals when they are needed. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20973 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/password/class_password.inc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gosa-core/plugins/personal/password/class_password.inc b/gosa-core/plugins/personal/password/class_password.inc index 8bdf26fd6..df056069a 100644 --- a/gosa-core/plugins/personal/password/class_password.inc +++ b/gosa-core/plugins/personal/password/class_password.inc @@ -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); -- 2.30.2