Code

next part of the expiration code
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 May 2006 10:20:20 +0000 (10:20 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 May 2006 10:20:20 +0000 (10:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3526 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/password/main.inc
plugins/personal/password/nochange.tpl [new file with mode: 0644]
plugins/personal/password/password_expired.tpl [deleted file]

index 76704c1e5ba94e45f1533dfbdd6ec6ca39667eb7..467a7c6f177ed5a4ee519fefe9313891b14c261c 100644 (file)
@@ -100,7 +100,17 @@ if (!$remove_lock){
   }
 
   if ($display == ""){
-    $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+    if((isset($config->data['MAIN']['ACCOUNTEXPIRED'])) && $config->data['MAIN']['ACCOUNTEXPIRED'] == "0"){
+      $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+    }else{
+      $expired= ldap_expired_account($config, $ui->dn, $ui->username);
+      
+      if($expired == 4){
+        $display= $smarty->fetch(get_template_path("nochange.tpl", TRUE));
+      }else{
+        $display= $smarty->fetch(get_template_path("password.tpl", TRUE));
+      }
+    }
   }
 }
 
diff --git a/plugins/personal/password/nochange.tpl b/plugins/personal/password/nochange.tpl
new file mode 100644 (file)
index 0000000..775bcaf
--- /dev/null
@@ -0,0 +1,11 @@
+<div class="plugtop">
+  <img class="center" alt="" src="{$headimage}" align="middle">{t}Change password not Allowed{/t}
+</div>
+
+<p>
+ <b>{t} You are not allowed to change your password at this time{/t}</b>
+</p>
+
+<br>
+
+<input type="hidden" name="ignore">
diff --git a/plugins/personal/password/password_expired.tpl b/plugins/personal/password/password_expired.tpl
deleted file mode 100644 (file)
index 1cefa14..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<div class="plugtop">
-  <img alt="" src="{$headimage}" align=middle>{t}Change password{/t}
-</div>
-
-<p>
-  {t}Your password has expired. To change your personal password use the fields below. The changes take effect immediately. Please memorize the new password, because you wouldn't be able to login without it.{/t}
-</p>
-
-<p>
-  {t}Changing the password affects your authentification on mail, proxy, samba and unix services.{/t}
-</p>
-
-<table summary="" style="vertical-align:top; text-align:left;" cellpadding=4 border=0>
-  <tr>
-    <td><b><LABEL for="current_password">{t}Current password{/t}</LABEL></b></td>
-    <td><input id="current_password" type="password" name="current_password" size="30" maxlength="40"
-               onFocus="nextfield= 'new_password';"></td>
-  </tr>
-  <tr>
-    <td><b><LABEL for="new_password">{t}New password{/t}</LABEL></b></td>
-    <td><input id="new_password" type="password" name="new_password" size="30" maxlength="40"
-               onFocus="nextfield= 'repeated_password';"></td>
-  </tr>
-  <tr>
-    <td><b><LABEL for="repeated_password">{t}Repeat new password{/t}</LABEL></b></td>
-    <td><input id="repeated_password" type="password" name="repeated_password" size="30" maxlength="40"
-               onFocus="nextfield= 'password_finish';"></td>
-  </tr>
-</table>
-
-<br>
-
-<p class="plugbottom">
-  <input type=submit name="password_finish" value="{t}Set password{/t}">
-  &nbsp;
-  <input type=reset id="password_cancel" name="password_cancel" value="{t}Clear fields{/t}">
-</p>
-
-<input type="hidden" name="ignore">
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-  nextfield= 'current_password';
-  document.mainform.current_password.focus();
-  -->
-</script>
-