Code

Updated password expiration handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Jul 2010 12:31:26 +0000 (12:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Jul 2010 12:31:26 +0000 (12:31 +0000)
-Force user to change his password

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18928 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/index.php
gosa-core/html/main.php
gosa-core/ihtml/themes/default/framework.tpl

index 02a4af1b4dd80ba88e880e99c6447c1ef1c9d9c2..f8743b0605f7688c7656442f2b8e53952177f4e7 100644 (file)
@@ -371,16 +371,6 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
           new log("security","login","",array(),"Account for user \"$username\" has expired") ;
           displayLogin();
           exit();
-        } elseif ($expired == 3){
-          $plist= new pluglist($config, $ui);
-          foreach ($plist->dirlist as $key => $value){
-            if (preg_match("/\bpassword\b/i",$value)){
-              $plug=$key;
-              new log("security","login","",array(),"User \"$username\" password forced to change") ;
-              header ("Location: main.php?plug=$plug&amp;reset=1");
-              exit;
-            }
-          }
         }
       }
 
index 3a47c061c8e684fa60d4c9f6ab4ab95c244e4cd2..2f19db629a72e526cb23a74502777817d3311612 100644 (file)
@@ -333,13 +333,15 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){
 }
 
 /* check if we are using account expiration */
+$smarty->assign("hideMenus", FALSE);
 if ($config->get_cfg_value("handleExpiredAccounts") == "true"){
-  $expired= ldap_expired_account($config, $ui->dn, $ui->username);
-
-  if ($expired == 2){
-    new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ;
-    msg_dialog::display(_("Password change"), _("Your password is about to expire, please change your password!"), INFO_DIALOG);
-  }
+    $expired= ldap_expired_account($config, $ui->dn, $ui->username);
+    if ($expired == 2){
+        new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ;
+        msg_dialog::display(_("Password change"), _("Your password is about to expire, please change your password!"), INFO_DIALOG);
+    } elseif ($expired == 3){
+        $smarty->assign("hideMenus", TRUE);
+    }
 }
 
 /* Load plugin */
index c02e265760406fd0775f45ce44571bee9f5a457a..163f81a9490a3e18ed0e25ec349d0cb32d254708 100644 (file)
   <b>{t}GOsa main menu{/t}</b>
 </div>-->
 
-<table summary="" class="framework" cellspacing="0" cellpadding="0" style='margin-top:7px'>
-  <tr style="vertical-align:top;">
-    <!-- Menu -->
-    <td style="background-color:white; vertical-align:top;" id="menucell">
-      {$menu}
-         <br />
-         <div style="height:1px; width:140px;"></div>
-    </td>
-    <!-- Plugin window -->
-    <td style="background-color:white; width:100%; vertical-align:top; height:15px;" colspan="2">
-      <table style="vertical-align:top; text-align:justify; background-color: white; border:1px solid #AAA; margin-top:0px; margin-left:7px; margin-right:7px; width:99%" summary="">
-       <tr>
-        <td>
-       {$msg_dialogs}
-        {$contents}
-       </td>
-      </tr>
-     </table>
-    </td>
-  </tr>
- {if $channel != ""}
-       <input type="hidden" name="_channel_" value="{$channel}">
- {/if}
-</table>{$errors}{$focus}<input type="hidden" name="php_c_check" value="1"></form></body></html>
+{if !$hideMenus}
+
+    <table summary="" class="framework" cellspacing="0" cellpadding="0" style='margin-top:7px'>
+        <tr style="vertical-align:top;">
+
+            <!-- Menu -->
+            <td style="background-color:white; vertical-align:top;" id="menucell">
+                {$menu}
+                <br />
+                <div style="height:1px; width:140px;"></div>
+            </td>
+
+            <!-- Plugin window -->
+            <td style="background-color:white; width:100%; vertical-align:top; height:15px;" colspan="2">
+                <table style="vertical-align:top; text-align:justify; 
+                    background-color: white; border:1px solid #AAA; 
+                    margin-top:0px; margin-left:7px; margin-right:7px; 
+                    width:99%" summary="">
+                    <tr>
+                        <td>
+                            {$msg_dialogs}
+                            {$contents}
+                        </td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+        {if $channel != ""}
+            <input type="hidden" name="_channel_" value="{$channel}">
+        {/if}
+    </table>
+
+{else}
+
+    <table summary="" class="framework" cellspacing="0" cellpadding="0" style='margin-top:7px' width="99%">
+        <tr style="vertical-align:top;">
+            <td style="background-color:white; vertical-align:top;" id="menucell">
+                {$msg_dialogs}
+                {$contents}
+                {if $channel != ""}
+                   <input type="hidden" name="_channel_" value="{$channel}">
+                {/if}
+            </td>
+        </tr>
+    </table>
+
+{/if}
+
+{$errors}{$focus}<input type="hidden" name="php_c_check" value="1"></form></body></html>