From 40fc655fc551f57d6463e4265ce39e72ebbc1132 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 10 Jul 2006 16:08:05 +0000 Subject: [PATCH] Integrated acl/reference dialog by default. ACL's still not working! git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4080 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 14 -------------- include/class_tabs.inc | 12 ++++++++++++ include/functions.inc | 7 +++++++ plugins/admin/acl/class_acl.inc | 6 +++++- plugins/admin/acl/contents.tpl | 9 --------- plugins/admin/applications/tabs_application.inc | 3 +++ plugins/admin/departments/tabs_department.inc | 4 ++++ plugins/admin/groups/tabs_group.inc | 3 +++ plugins/admin/mimetypes/tabs_mimetypes.inc | 3 +++ plugins/admin/ogroups/tabs_ogroups.inc | 3 +++ plugins/admin/systems/tabs_component.inc | 3 +++ plugins/admin/systems/tabs_phone.inc | 3 +++ plugins/admin/systems/tabs_printers.inc | 3 +++ plugins/admin/systems/tabs_server.inc | 3 +++ plugins/admin/systems/tabs_terminal.inc | 3 +++ plugins/admin/systems/tabs_winstation.inc | 3 +++ plugins/admin/systems/tabs_workstation.inc | 3 +++ plugins/admin/users/tabs_user.inc | 3 +++ plugins/gofon/conference/tabs_conference.inc | 3 +++ 19 files changed, 67 insertions(+), 24 deletions(-) diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 8add0e9c0..7afd0e727 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -87,7 +87,6 @@ - @@ -100,24 +99,20 @@ - - - - @@ -126,7 +121,6 @@ - @@ -135,7 +129,6 @@ - @@ -145,17 +138,14 @@ - - - @@ -178,22 +168,18 @@ - - - - diff --git a/include/class_tabs.inc b/include/class_tabs.inc index bef90ef96..a4ef265c7 100644 --- a/include/class_tabs.inc +++ b/include/class_tabs.inc @@ -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; + } + + } ?> diff --git a/include/functions.inc b/include/functions.inc index e45807dc4..2ac55c8a4 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -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: ?> diff --git a/plugins/admin/acl/class_acl.inc b/plugins/admin/acl/class_acl.inc index bbfdefc4b..cf904605e 100644 --- a/plugins/admin/acl/class_acl.inc +++ b/plugins/admin/acl/class_acl.inc @@ -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'))); } diff --git a/plugins/admin/acl/contents.tpl b/plugins/admin/acl/contents.tpl index d33905909..84a108cea 100644 --- a/plugins/admin/acl/contents.tpl +++ b/plugins/admin/acl/contents.tpl @@ -1,16 +1,7 @@ -This plugin is only simulating the interface. Therefore it's not functional. Please don't use. -
- {if $dialogState eq 'head'}

{t}Assigned ACLs for current entry{/t}

{$aclList} -

 

-
- -   - -
{/if} {if $dialogState eq 'create'} diff --git a/plugins/admin/applications/tabs_application.inc b/plugins/admin/applications/tabs_application.inc index 203cd69bf..594b05735 100644 --- a/plugins/admin/applications/tabs_application.inc +++ b/plugins/admin/applications/tabs_application.inc @@ -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) diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc index 285b93a79..d3e0d50ea 100644 --- a/plugins/admin/departments/tabs_department.inc +++ b/plugins/admin/departments/tabs_department.inc @@ -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: ?> diff --git a/plugins/admin/groups/tabs_group.inc b/plugins/admin/groups/tabs_group.inc index a4d0279db..397557ed5 100644 --- a/plugins/admin/groups/tabs_group.inc +++ b/plugins/admin/groups/tabs_group.inc @@ -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) diff --git a/plugins/admin/mimetypes/tabs_mimetypes.inc b/plugins/admin/mimetypes/tabs_mimetypes.inc index eb4368ce9..57026421c 100755 --- a/plugins/admin/mimetypes/tabs_mimetypes.inc +++ b/plugins/admin/mimetypes/tabs_mimetypes.inc @@ -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) diff --git a/plugins/admin/ogroups/tabs_ogroups.inc b/plugins/admin/ogroups/tabs_ogroups.inc index f67823d0d..dbae97bb2 100644 --- a/plugins/admin/ogroups/tabs_ogroups.inc +++ b/plugins/admin/ogroups/tabs_ogroups.inc @@ -182,6 +182,9 @@ class ogrouptabs extends tabs break; } } + + /* Add references/acls/snapshots */ + $this->addSpecialTabs(); } diff --git a/plugins/admin/systems/tabs_component.inc b/plugins/admin/systems/tabs_component.inc index 60facee5a..b45cf2c7d 100644 --- a/plugins/admin/systems/tabs_component.inc +++ b/plugins/admin/systems/tabs_component.inc @@ -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) diff --git a/plugins/admin/systems/tabs_phone.inc b/plugins/admin/systems/tabs_phone.inc index cae0a2493..a7266b2fd 100644 --- a/plugins/admin/systems/tabs_phone.inc +++ b/plugins/admin/systems/tabs_phone.inc @@ -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) diff --git a/plugins/admin/systems/tabs_printers.inc b/plugins/admin/systems/tabs_printers.inc index 0fbbccc22..cf1360ecf 100644 --- a/plugins/admin/systems/tabs_printers.inc +++ b/plugins/admin/systems/tabs_printers.inc @@ -24,6 +24,9 @@ class printtabs extends tabs $this->current= $tab['CLASS']; } } + + /* Add references/acls/snapshots */ + $this->addSpecialTabs(); } function save_object($save_current= FALSE) diff --git a/plugins/admin/systems/tabs_server.inc b/plugins/admin/systems/tabs_server.inc index 037aa8501..0caa90682 100644 --- a/plugins/admin/systems/tabs_server.inc +++ b/plugins/admin/systems/tabs_server.inc @@ -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) diff --git a/plugins/admin/systems/tabs_terminal.inc b/plugins/admin/systems/tabs_terminal.inc index 2bc8db0bf..17a7c32a1 100644 --- a/plugins/admin/systems/tabs_terminal.inc +++ b/plugins/admin/systems/tabs_terminal.inc @@ -24,6 +24,9 @@ class termtabs extends tabs $this->current= $tab['CLASS']; } } + + /* Add references/acls/snapshots */ + $this->addSpecialTabs(); } function save_object($save_current= FALSE) diff --git a/plugins/admin/systems/tabs_winstation.inc b/plugins/admin/systems/tabs_winstation.inc index b1b144b4d..94817ad0e 100644 --- a/plugins/admin/systems/tabs_winstation.inc +++ b/plugins/admin/systems/tabs_winstation.inc @@ -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) diff --git a/plugins/admin/systems/tabs_workstation.inc b/plugins/admin/systems/tabs_workstation.inc index 96a1ce69d..63c82bda9 100644 --- a/plugins/admin/systems/tabs_workstation.inc +++ b/plugins/admin/systems/tabs_workstation.inc @@ -24,6 +24,9 @@ class worktabs extends tabs $this->current= $tab['CLASS']; } } + + /* Add references/acls/snapshots */ + $this->addSpecialTabs(); } function save_object($save_current= FALSE) diff --git a/plugins/admin/users/tabs_user.inc b/plugins/admin/users/tabs_user.inc index 5ac4fb7b3..c5bcba3d7 100644 --- a/plugins/admin/users/tabs_user.inc +++ b/plugins/admin/users/tabs_user.inc @@ -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) diff --git a/plugins/gofon/conference/tabs_conference.inc b/plugins/gofon/conference/tabs_conference.inc index 05271c084..b588ee4d2 100644 --- a/plugins/gofon/conference/tabs_conference.inc +++ b/plugins/gofon/conference/tabs_conference.inc @@ -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() -- 2.30.2