Code

Fixed acls for nagios && netatalk extension in user plugins
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 09:36:26 +0000 (09:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 09:36:26 +0000 (09:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5531 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/acl_definition.inc
plugins/personal/nagios/class_nagiosAccount.inc
plugins/personal/netatalk/class_netatalk.inc

index 19e7305f50c1b898027a482e1a4a945db6738aa0..651c2dd307702b6d9314e57b105040ab889f7864 100644 (file)
@@ -328,6 +328,7 @@ $ACLD['sambaAccount']=
                        ) ;
 
 $ACLD['netatalk']=     array(
+                       "create",
                        "netatalkShare",
                        "netatalkUserHomepath");
 
@@ -392,22 +393,24 @@ $ACLD['FAIclass']                 =array("FAIclass"               );
 $ACLD['phoneAccount'] = array("create","goFonDeliveryMode","goFonHomeServer",
       "goFonHardware","goFonPIN","goFonVoicemailPIN","telephoneNumber", "goFonMacro");
 
-$ACLD['nagiosAccount'] = array("NagiosAlias"
-, "NagiosPager"
-, "NagiosMail"
-, "HostNotificationPeriod"
-, "ServiceNotificationPeriod"
-, "HostNotificationCommands"
-, "ServiceNotificationCommands"
-, "HostNotificationOptions"
-, "ServiceNotificationOptions"
-, "AuthorizedAllHosts"
-, "AuthorizedAllServices"
-, "AuthorizedSystemCommands"
-, "AuthorizedAllHostCommands"
-, "AuthorizedAllServiceCommands"
-, "AuthorizedConfigurationInformation"
-, "AuthorizedSystemInformation");
+$ACLD['nagiosAccount'] = array(
+               "create",
+               "NagiosAlias",
+                "NagiosPager",
+                "NagiosMail",
+                "HostNotificationPeriod",
+                "ServiceNotificationPeriod",
+                "HostNotificationCommands",
+                "ServiceNotificationCommands",
+                "HostNotificationOptions",
+                "ServiceNotificationOptions",
+                "AuthorizedAllHosts",
+                "AuthorizedAllServices",
+                "AuthorizedSystemCommands",
+                "AuthorizedAllHostCommands",
+                "AuthorizedAllServiceCommands",
+                "AuthorizedConfigurationInformation",
+                "AuthorizedSystemInformation");
 
 $ACLD['addressbook']=  array("addressbook","add", "delete",
          "sn", "givenName", "mail", "title",
index ac489538ac5815cb274511262e390508b276ba8b..768483f1aad8f1468ec7df0bfb7976f3a9ab5d5a 100644 (file)
@@ -90,7 +90,13 @@ class nagiosAccount extends plugin
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
-      $this->is_account= !$this->is_account;
+
+      /* Onyl change account state if allowed */
+      if($this->is_account && $this->acl == "#all#"){
+        $this->is_account= !$this->is_account;
+      }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+        $this->is_account= !$this->is_account;
+      }
     }
 
     /* Do we represent a valid account? */
index 57edb1464129c6f57601892e8a88814199f23312..c2122330d64bad8f3db3bc0744dc10ffe5f03f9a 100644 (file)
@@ -157,9 +157,20 @@ class netatalk extends plugin {
     $smarty = get_smarty();
     $display = "";
 
+
+    /* Check if all dependencies are solved */
+    $all_ok = (isset($this->parent->by_object['posixAccount']) && $this->parent->by_object['posixAccount']->is_account) &&
+              (count($this->shares));
+
     /* Do we need to flip is_account state? */
-    if (isset ($_POST['modify_state'])) {
-      $this->is_account = !$this->is_account;
+    if (isset($_POST['modify_state'])){
+
+      /* Onyl change account state if allowed */
+      if($this->is_account && $this->acl == "#all#" && !$this->accountDelegationsConfigured()){
+        $this->is_account= !$this->is_account;
+      }elseif(!$this->is_account && chkacl($this->acl,"create") == "" && $all_ok){
+        $this->is_account= !$this->is_account;
+      }
     }
 
     /* Do we represent a valid account? */