Code

Integrated acl/reference dialog by default.
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Jul 2006 16:08:05 +0000 (16:08 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Jul 2006 16:08:05 +0000 (16:08 +0000)
ACL's still not working!

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

19 files changed:
contrib/gosa.conf
include/class_tabs.inc
include/functions.inc
plugins/admin/acl/class_acl.inc
plugins/admin/acl/contents.tpl
plugins/admin/applications/tabs_application.inc
plugins/admin/departments/tabs_department.inc
plugins/admin/groups/tabs_group.inc
plugins/admin/mimetypes/tabs_mimetypes.inc
plugins/admin/ogroups/tabs_ogroups.inc
plugins/admin/systems/tabs_component.inc
plugins/admin/systems/tabs_phone.inc
plugins/admin/systems/tabs_printers.inc
plugins/admin/systems/tabs_server.inc
plugins/admin/systems/tabs_terminal.inc
plugins/admin/systems/tabs_winstation.inc
plugins/admin/systems/tabs_workstation.inc
plugins/admin/users/tabs_user.inc
plugins/gofon/conference/tabs_conference.inc

index 8add0e9c0d49e4f3611265216c7c34479e60e8c7..7afd0e727914a5831d6bb771ae5bb7cb91655c38 100644 (file)
@@ -87,7 +87,6 @@
                <tab class="gofaxAccount" name="Fax" />
                <tab class="phoneAccount" name="Phone" />
 <!--            <tab class="nagiosAccount" name="Nagios" /> -->
-               <tab class="reference" name="References" />
        </usertabs>
 
        <mimetabs>
                <tab class="appgroup" name="Applications" />
                <tab class="mailgroup" name="Mail" />
                <tab class="acl" name="ACL" />
-               <tab class="reference" name="References" />
        </grouptabs>
 
        <appstabs>
                <tab class="application" name="Generic" />
                <tab class="applicationParameters" name="Options" />
-               <tab class="reference" name="References" />
        </appstabs>
 
        <conferencetabs>
                <tab class="conference" name="Generic" />
-               <tab class="reference" name="References" />
        </conferencetabs>
 
        <macrotabs>
                <tab class="macro" name="Generic" />
                <tab class="macroParameter" name="Parameter" />
-               <tab class="reference" name="References" />
        </macrotabs>
 
        <termtabs>
                <tab class="termservice" name="Devices" />
                <tab class="printgeneric" name="Printer" />
                <tab class="terminfo" name="Information" />
-               <tab class="reference" name="References" />
        </termtabs>
 
        <servtabs>
                <tab class="serverService" name="Services" />
                <tab class="faiSummaryTab" name="FAI summary" />
                <tab class="terminfo" name="Information" />
-               <tab class="reference" name="References" />
        </servtabs>
 
        <worktabs>
                <tab class="printgeneric" name="Printer" />
                <tab class="terminfo" name="Information" />
                <tab class="faiSummaryTab" name="FAI summary" />
-               <tab class="reference" name="References" />
        </worktabs>
 
        <printtabs>
                <tab class="printgeneric" name="Generic" />
-               <tab class="reference" name="References" />
        </printtabs>
 
     <phonetabs>
         <tab class="phonegeneric" name="Generic" />
-        <tab class="reference" name="References" />
     </phonetabs>
 
        <serverservice>
 
     <componenttabs>
        <tab class="componentgeneric" name="Generic" />
-       <tab class="reference" name="References" />
     </componenttabs>
 
     <wintabs>
        <tab class="wingeneric" name="Generic" />
-       <tab class="reference" name="References" />
     </wintabs>
 
     <deptabs>
        <tab class="department" name="Generic" />
-       <tab class="reference" name="References" />
     </deptabs>
 
     <ogrouptabs>
        <tab class="ogroup" name="Generic" />
-       <tab class="reference" name="References" />
     </ogrouptabs>
 
     <connectivity>
index bef90ef9633a3563930dc9632ecd82c9f2d2d92d..a4ef265c766d48a5cd5d84e21629de45a7f06c15 100644 (file)
@@ -288,6 +288,18 @@ class tabs
          return($ret);
   }
 
+
+  function addSpecialTabs()
+  {
+       $this->by_name['acl']= _("ACL");
+       $this->by_object['acl']= new acl($this->config, $this->dn);
+       $this->by_object['acl']->parent= &$this;
+       $this->by_name['reference']= _("References");
+       $this->by_object['reference']= new reference($this->config, $this->dn);
+       $this->by_object['reference']->parent= &$this;
+  }
+
+
 }
 
 ?>
index e45807dc4e0c14f17e8e4bbe077cc86d67ab5778..2ac55c8a466e31a0a311bedbbc8d8ab37afea035 100644 (file)
@@ -2092,5 +2092,12 @@ function is_department_name_reserved($name,$base)
 }
 
 
+function get_base_dir()
+{
+  global $BASE_DIR;
+
+  return $BASE_DIR;
+}
+
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index bbfdefc4ba027ef02c1c16c384b36b0386e49f7f..cf904605e1f9d06dd4dc47bb2f497f405258102c 100644 (file)
@@ -139,6 +139,7 @@ class acl extends plugin
     /* Handle posts */
     if (isset($_POST['new_acl'])){
       $this->dialogState= 'create';
+      $this->dialog= TRUE;
       $this->currentIndex= count($this->gosaAclEntry);
       $this->loadAclEntry(TRUE);
     }
@@ -150,6 +151,7 @@ class acl extends plugin
       /* Actions... */
       if (preg_match('/^acl_edit_.*_x/', $name)){
         $this->dialogState= 'create';
+        $this->dialog= TRUE;
         $this->currentIndex= preg_replace('/^acl_edit_([0-9]+).*$/', '\1', $name);
         $this->loadAclEntry();
         continue;
@@ -228,6 +230,7 @@ class acl extends plugin
     /* Cancel new acl? */
     if (isset($_POST['cancel_new_acl'])){
       $this->dialogState= 'head';
+      $this->dialog= FALSE;
       if ($this->wasNewEntry){
         unset ($this->gosaAclEntry[$this->currentIndex]);
       }
@@ -239,6 +242,7 @@ class acl extends plugin
       $this->gosaAclEntry[$this->currentIndex]['members']= $this->recipients;
       $this->gosaAclEntry[$this->currentIndex]['acl']= $this->aclContents;
       $this->dialogState= 'head';
+      $this->dialog= FALSE;
     }
 
     /* Cancel edit acl? */
@@ -400,7 +404,7 @@ class acl extends plugin
 
     /* Show main page */
     $smarty->assign("dialogState", $this->dialogState);
-    return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
+    return ($smarty->fetch (get_template_path('contents.tpl', TRUE, get_base_dir().'/plugins/admin/acl')));
   }
 
   
index d33905909facffa9e7fa97140994dbcdce654a60..84a108ceac1474b3b7f951c92dce6c03de9b1ca9 100644 (file)
@@ -1,16 +1,7 @@
-<b><font style="color:red">This plugin is only simulating the interface. Therefore it's not functional. Please don't use.</font></b>
-<br>
-
 {if $dialogState eq 'head'}
 <h1>{t}Assigned ACLs for current entry{/t}</h1>
 {$aclList}
 <input type="submit" name="new_acl" value="{t}New ACL{/t}">
-<p class="seperator">&nbsp;</p>
-<div style='text-align:right;margin-top:5px'>
-       <input type="submit" name="save_acl" value="{t}Ok{/t}">
-       &nbsp;
-       <input type="submit" name="cancel_acl" value="{t}Cancel{/t}">
-</div>
 {/if}
 
 {if $dialogState eq 'create'}
index 203cd69bf9fa4369def2fd533d1772365148948d..594b057352c23f8b4c311229f80f2cba0c23c8f5 100644 (file)
@@ -7,6 +7,9 @@ class apptabs extends tabs
   function apptabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function set_release($newRelease)
index 285b93a7940589aeb9cc7a6396727a5680f221e9..d3e0d50ea06aa0eacc892aca0ab07eeb9bcc9011 100644 (file)
@@ -8,6 +8,9 @@ class deptabs extends tabs
   {
     tabs::tabs($config, $data, $dn);
     $this->base= $this->by_object['department']->base;
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function check()
@@ -43,6 +46,7 @@ class deptabs extends tabs
     return(tabs::save(TRUE));
   }
 
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index a4d0279dbd444368a4ab094b919d4a982f394eea..397557ed5d35b546eb765742cd2db493d5f173b3 100644 (file)
@@ -12,6 +12,9 @@ class grouptabs extends tabs
                                $this->by_object[$name]->parent  = $this;
                        }
                }
+
+               /* Add references/acls/snapshots */
+               $this->addSpecialTabs();
        }
 
        function save_object($save_current= FALSE)
index eb4368ce91e363c3a33d5a727bce145b1b4f04f3..57026421c3577fb10533a25a8fd8521edfe880c2 100755 (executable)
@@ -7,6 +7,9 @@ class mimetabs extends tabs
   function mimetabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function set_release($newRelease)
index f67823d0d711b9100c090420c9d008f56821d9bc..dbae97bb2a337e1a635168aafbbe2a758c8d476f 100644 (file)
@@ -182,6 +182,9 @@ class ogrouptabs extends tabs
           break;
       }
     }
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
 
index 60facee5a7c6ea884f29804a158571db2f7f4958..b45cf2c7dc123737a70c6091d64222f66b99c451 100644 (file)
@@ -6,6 +6,9 @@ class componenttabs extends tabs
   function componenttabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index cae0a24934acfdad42b01080229207c6c1b2c2cf..a7266b2fd7957fe49a2a66944db527bf324e0696 100644 (file)
@@ -6,6 +6,9 @@ class phonetabs extends tabs
   function phonetabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 0fbbccc222005f837dc571db50c45f4bc3d6652d..cf1360ecfbaf0f3ed680c59df969e312769436de 100644 (file)
@@ -24,6 +24,9 @@ class printtabs extends tabs
         $this->current= $tab['CLASS'];
       }
     }
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 037aa850199ef91f1d45d9ecfe5ce965bc37968a..0caa90682d5a05a3a060f819331700239c7fca2b 100644 (file)
@@ -6,6 +6,9 @@ class servtabs extends tabs
   function servtabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 2bc8db0bfd1f2d5282620010bf0264abdd3a1511..17a7c32a1f02e3c09adb74e782d318a836b8898c 100644 (file)
@@ -24,6 +24,9 @@ class termtabs extends tabs
         $this->current= $tab['CLASS'];
       }
     }
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index b1b144b4dc7caf4537d1e0dfcad509fb6f1d6c61..94817ad0ef00f9145cb11ca90f37de8a73114376 100644 (file)
@@ -6,6 +6,9 @@ class wintabs extends tabs
   function wintabs($config, $data, $dn)
   {
     tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 96a1ce69da01461287ff3954bf7999afe7c47339..63c82bda9d00d9fd1854a2964d75e491868568ab 100644 (file)
@@ -24,6 +24,9 @@ class worktabs extends tabs
         $this->current= $tab['CLASS'];
       }
     }
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 5ac4fb7b3a1321b791928caf86904e9f3a2b59a9..c5bcba3d7d8a3dbf7c364ad9c339a179af133b34 100644 (file)
@@ -8,6 +8,9 @@ class usertabs extends tabs
   {
     tabs::tabs($config, $data, $dn);
     $this->base= $this->by_object['user']->base;
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function save_object($save_current= FALSE)
index 05271c0846759bdb6ab0f7f44649d8ccf9f1075f..b588ee4d2ad550d909f835b95ba6f8c81cd7e929 100644 (file)
@@ -8,6 +8,9 @@ class conferencetabs extends tabs
   {
          tabs::tabs($config, $data, $dn);
          $this->base= $this->by_object['conference']->base; 
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
   function check()