Code

Backports from trunk
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2011 09:06:29 +0000 (09:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2011 09:06:29 +0000 (09:06 +0000)
-Readded sambaKickoffTime to samba-generic. It was removed by mistake.
-Fixed detection of sambaMaxPwdAge

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

gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc
gosa-plugins/samba/personal/samba/class_sambaAccount.inc
gosa-plugins/samba/personal/samba/samba3.tpl

index e53f284bc70d4424c535dc7bcf6fe8d5e9857455..56943662cd4b9cdf341355be1f571b2c4280b606 100644 (file)
@@ -42,7 +42,7 @@ class wingeneric extends plugin
                             "shadowInactive","uid","cn","sn","givenName","homeDirectory","sambaSID",
                             "sambaPrimaryGroupSID","displayName", "sambaPwdMustChange",
                             "sambaNTPassword","sambaPwdLastSet","sambaAcctFlags");
-  var $objectclasses= array("posixAccount","person","organizationalPerson","inetOrgPerson","gosaAccount","shadowAccount","sambaSamAccount","top");
+  var $objectclasses= array("posixAccount","person","organizationalPerson","inetOrgPerson","shadowAccount","sambaSamAccount","top");
 
   var $view_logged = FALSE;
 
@@ -54,6 +54,14 @@ class wingeneric extends plugin
     $this->netConfigDNS->MACisMust = FALSE;
     $this->netConfigDNS->IPisMust = FALSE;
 
+    // The combination of the used objectClasses may differ, remember the initial ones.
+    if(isset($this->attrs['objectClass'])){
+        $this->objectclasses = array();
+        for($i=0; $i < $this->attrs['objectClass']['count'] ;  $i++ ){
+            $this->objectclasses[] = $this->attrs['objectClass'][$i];
+        }
+    }
+
     /* Set base */
     if ($this->dn == "new"){
       $ui = get_userinfo();
index 1466f0a88662ab6900655f2787ba4814b44a3e81..d0ae05d2d606cd5bf003144ae5988fe19487fa08 100644 (file)
@@ -514,7 +514,7 @@ class sambaAccount extends plugin
         if(isset($this->attrs['sambaPwdLastSet'][0])){
             $last = $this->attrs['sambaPwdLastSet'][0];
             $sid = $this->get_domain_info();
-            if(isset($sid['sambaMaxPwdAge'][0])){
+            if(isset($sid['sambaMaxPwdAge'][0]) && $sid['sambaMaxPwdAge'][0] != -1){
                 $d = ($last + $sid['sambaMaxPwdAge'][0]) - time();
 
                 // A negative value means the password is outdated 
index fb2317cae5f77f39567af88263ac3aedd1c588c3..d0ae6d52d82c4e140fda7c52bdf7af2e813457da 100644 (file)
         </tr>            
     </table>
 
+    <table>
+        <tr>
+            <td colspan=2>
+                {render acl=$sambaKickoffTimeACL  checkbox=$multiple_support checked=$use_sambaKickoffTime}
+                    <input id="flag_sambaKickoffTime" type=checkbox name="flag_sambaKickoffTime" value="1"
+                        {if $flag_sambaKickoffTime} checked {/if} class="center">
+                {/render}
+                <label for="flag_sambaKickoffTime">{t}Account expires after{/t}</label>
+            </td>
+            <td style='width:200px;'>
+                {render acl=$sambaKickoffTimeACL}
+                    <input type="text" id="sambaKickoffTime" name="sambaKickoffTime" 
+                        class="date" style='width:100px' value="{$sambaKickoffTime}">
+                    {if $sambaKickoffTimeACL|regex_replace:"/[cdmr]/":"" == "w"}
+                        <script type="text/javascript">
+                            {literal}
+                               var datepicker2 = new DatePicker({
+                                    relative : 'sambaKickoffTime',
+                                    language : '{/literal}{$lang}{literal}',
+                                    keepFieldEmpty : true,
+                                    enableCloseEffect : false,
+                                    enableShowEffect : false });
+                            {/literal}
+                        </script>
+                    {/if}
+                {/render}
+            </td>
+        </tr>
+    </table>
+
+
     <hr>
 
     {render acl=$sambaLogonHoursACL mode=read_active  checkbox=$multiple_support checked=$use_SetSambaLogonHours}