From c8f68318bab679d1aabe477e0d863524f753a473 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 27 Jul 2010 13:12:53 +0000 Subject: [PATCH] Updated password proposal handling -Gray out inactive options git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19168 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 3 +- gosa-core/plugins/admin/users/password.tpl | 28 ++++++++++++++----- .../personal/password/class_password.inc | 3 +- .../plugins/personal/password/password.tpl | 25 +++++++++++++---- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index c3a6a6e10..45a9a4a88 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -125,6 +125,7 @@ class userManagement extends management }elseif((count($this->pwd_change_queue) || isset($_POST['password_finish']) || isset($_POST['refreshProposal']))){ $action['action'] = "passwordQueue"; } + if(isset($_POST['passwordQueue'])) $action['action'] = "passwordQueue"; return($action); } @@ -289,7 +290,7 @@ class userManagement extends management } // If we've just refreshed the proposal then do not check the password for validity. - if(isset($_POST['refreshProposal'])){ + if(!isset($_POST['password_finish']) && (isset($_POST['refreshProposal']) || isset($_POST['passwordQueue']))){ return ($smarty->fetch(get_template_path('password.tpl', TRUE))); } diff --git a/gosa-core/plugins/admin/users/password.tpl b/gosa-core/plugins/admin/users/password.tpl index e83900590..9f5cf7df7 100644 --- a/gosa-core/plugins/admin/users/password.tpl +++ b/gosa-core/plugins/admin/users/password.tpl @@ -35,15 +35,19 @@ {else} - + diff --git a/gosa-core/plugins/personal/password/class_password.inc b/gosa-core/plugins/personal/password/class_password.inc index d6588243e..ccd30a18f 100644 --- a/gosa-core/plugins/personal/password/class_password.inc +++ b/gosa-core/plugins/personal/password/class_password.inc @@ -81,12 +81,11 @@ class password extends plugin // Refresh proposal if requested if(isset($_POST['refreshProposal'])) $this->refreshProposal(); + if(isset($_POST['proposalSelected'])) $this->proposalSelected = get_post('proposalSelected') == 1; $smarty->assign("proposal" , set_post($this->proposal)); $smarty->assign("proposalEnabled" , $this->proposalEnabled); $smarty->assign("proposalSelected" , $this->proposalSelected); - if(isset($_POST['proposalSelected'])) $this->proposalSelected = get_post('proposalSelected') == 1; - /* Pwd change requested */ if (isset($_POST['password_finish'])){ diff --git a/gosa-core/plugins/personal/password/password.tpl b/gosa-core/plugins/personal/password/password.tpl index 556173fec..4658bd445 100644 --- a/gosa-core/plugins/personal/password/password.tpl +++ b/gosa-core/plugins/personal/password/password.tpl @@ -51,11 +51,15 @@ -- 2.30.2
-  {t}Use proposal{/t}
 {t}Manually specify a password{/t}
- {factory type='password' id='new_password' name='new_password' - onfocus="nextfield='repeated_password';" onkeyup="testPasswordCss(\$('new_password').value);"} + {if $proposalSelected} + {factory type='password' name='new_password' id='new_password' disabled + onkeyup="testPasswordCss(\$('new_password').value)" onfocus="nextfield= 'repeated_password';"} + {else} + {factory type='password' name='new_password' id='new_password' + onkeyup="testPasswordCss(\$('new_password').value)" onfocus="nextfield= 'repeated_password';"} + {/if}
- {factory type='password' id='repeated_password' name='repeated_password' - onfocus="nextfield='password_finish';"} + {if $proposalSelected} + {factory type='password' name='repeated_password' id='repeated_password' disabled + onfocus="nextfield= 'password_finish';"} + {else} + {factory type='password' name='repeated_password' id='repeated_password' + onfocus="nextfield= 'password_finish';"} + {/if}
-  {t}Use proposal{/t}
 {t}Manually specify a password{/t}
- {factory type='password' name='new_password' id='new_password' - onkeyup="testPasswordCss(\$('new_password').value)" onfocus="nextfield= 'repeated_password';"} + {if $proposalSelected} + {factory type='password' name='new_password' id='new_password' disabled + onkeyup="testPasswordCss(\$('new_password').value)" onfocus="nextfield= 'repeated_password';"} + {else} + {factory type='password' name='new_password' id='new_password' + onkeyup="testPasswordCss(\$('new_password').value)" onfocus="nextfield= 'repeated_password';"} + {/if}
- {factory type='password' name='repeated_password' id='repeated_password' onfocus="nextfield= 'password_finish';"} + {if $proposalSelected} + {factory type='password' name='repeated_password' id='repeated_password' disabled + onfocus="nextfield= 'password_finish';"} + {else} + {factory type='password' name='repeated_password' id='repeated_password' + onfocus="nextfield= 'password_finish';"} + {/if}