Code

Added sambaLogonHoursAcl and fixed save_object for
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 05:16:17 +0000 (05:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 05:16:17 +0000 (05:16 +0000)
 sambaLogonTime,sambaLogoffTime,sambaKickoffTime,sambaPwdMustChange
these attributes could be set without any acl.

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

plugins/admin/groups/acl_definition.inc
plugins/personal/samba/class_sambaAccount.inc
plugins/personal/samba/samba3.tpl

index a0cf24ac68f471b83bcb55f6e26ffc524e8cf672..68745830f0a241c4fd57f0a36a5d741f7086b87b 100644 (file)
@@ -287,6 +287,8 @@ $ACLD['sambaAccount']=
                        "sambaLogonScript"      ,//=> _("Logon script"),
                        "sambaProfilePath"      ,//=> _("Profile path"),         
 
+                       "sambaLogonHours",
+
                        "sambaLogonTime",//     => _("Limit Logon Time"),
                        "sambaLogoffTime",//    => _("Limit Logoff Time"), 
                        "sambaKickoffTime",//   => _("Account expiry"),         
index 2a84bd2988ee2c45b8114a8e2a90267025ec22f6..690ece7f51dae6268e5761f8c3e01d7fb0087b55 100644 (file)
@@ -235,7 +235,7 @@ class sambaAccount extends plugin
 
 
     /* Open Samaba Logong hours dialog */
-    if(isset($_POST['SetSambaLogonHours']) && $this->samba3){
+    if(isset($_POST['SetSambaLogonHours']) && $this->samba3 && chkacl($this->acl,"sambaLogonHours") == ""){
       $this->dialog = new sambaLogonHours($this->config,$this->dn,$this->sambaLogonHours);
     }
 
@@ -252,7 +252,7 @@ class sambaAccount extends plugin
     }
 
     /* Display dialog */
-    if(isset($this->dialog)){
+    if((isset($this->dialog)) && (is_object($this->dialog))){
       $this->dialog->save_object();
       return($this->dialog->execute());
     }
@@ -625,6 +625,7 @@ class sambaAccount extends plugin
     $smarty->assign("sambaLogoffTimeACL",       chkacl($this->acl, "sambaLogoffTime"));
     $smarty->assign("sambaKickoffTimeACL",      chkacl($this->acl, "sambaKickoffTime"));
 
+    $smarty->assign("sambaLogonHoursACL",       chkacl($this->acl, "sambaLogonHours"));
 
     /* In case of javascript, disable some fields on demand */
     if ($this->samba3){
@@ -739,13 +740,17 @@ class sambaAccount extends plugin
           $tmp.= "N";
         }
       }
-      if (isset($_POST["password_expires"])){
-        if ($_POST["password_expires"] == 1){
-          $this->password_expires= 1;
+
+      if(chkacl($this->acl,"sambaPwdMustChange") == ""){
+        if (isset($_POST["password_expires"])){
+          if ($_POST["password_expires"] == 1){
+            $this->password_expires= 1;
+          }
+        } else {
+          $this->password_expires= 0;
         }
-      } else {
-        $this->password_expires= 0;
       }
+
       if (isset($_POST["temporary_disable"])){
         if ($_POST["temporary_disable"] == 1){
           if (is_integer(strpos($this->sambaAcctFlags, "L"))) {
@@ -755,26 +760,35 @@ class sambaAccount extends plugin
           }
         }
       }
-      if (isset($_POST["logon_time_set"])){
-        if ($_POST["logon_time_set"] == 1){
-          $this->logon_time_set= 1;
+
+      if(chkacl($this->acl,"sambaLogonTime") ==""){
+        if (isset($_POST["logon_time_set"])){
+          if ($_POST["logon_time_set"] == 1){
+            $this->logon_time_set= 1;
+          }
+        } else {
+          $this->logon_time_set= 0;
         }
-      } else {
-        $this->logon_time_set= 0;
       }
-      if (isset($_POST["logoff_time_set"])){
-        if ($_POST["logoff_time_set"] == 1){
-          $this->logoff_time_set= 1;
+
+      if(chkacl($this->acl,"sambaLogoffTime") == ""){
+        if (isset($_POST["logoff_time_set"])){
+          if ($_POST["logoff_time_set"] == 1){
+            $this->logoff_time_set= 1;
+          }
+        } else {
+          $this->logoff_time_set= 0;
         }
-      } else {
-        $this->logoff_time_set= 0;
       }
-      if (isset($_POST["kickoff_time_set"])){
-        if ($_POST["kickoff_time_set"] == 1){
-          $this->kickoff_time_set= 1;
+
+      if(chkacl($this->acl,"sambaKickoffTime") == ""){
+        if (isset($_POST["kickoff_time_set"])){
+          if ($_POST["kickoff_time_set"] == 1){
+            $this->kickoff_time_set= 1;
+          }
+        } else {
+          $this->kickoff_time_set= 0;
         }
-      } else {
-        $this->kickoff_time_set= 0;
       }
       
       $fill= "";
index f3a4ffb828e92d63d72b05b3ac57a33c98d3ff91..30d0a1a33080a9491497da448f812ef08d0fdb86 100644 (file)
    <input type="hidden" name="sambaLogoffTime" value="{$sambaLogoffTime}">
    <input type="hidden" name="sambaKickoffTime" value="{$sambaKickoffTime}">
    <br>
-   {t}Samba logon times{/t}&nbsp;<input type='submit' name='SetSambaLogonHours' value='{t}Edit settings...{/t}'>
+   {t}Samba logon times{/t}&nbsp;<input type='submit' name='SetSambaLogonHours' value='{t}Edit settings...{/t}' {$sambaLogonHoursACL}>
   </td>        
   <td style="border-left:1px solid #A0A0A0">
    &nbsp;