From e366547ef2e268329691ec7356c09c9bec1fcd60 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 7 Sep 2006 07:10:59 +0000 Subject: [PATCH] Added acls to application generic git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4614 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../applications/class_applicationGeneric.inc | 27 ++++---- plugins/admin/applications/generic.tpl | 68 ++++++++++++++----- .../admin/applications/tabs_application.inc | 4 +- 3 files changed, 67 insertions(+), 32 deletions(-) diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 94c6a831f..0d4d5ea88 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -110,6 +110,17 @@ class application extends plugin $smarty= get_smarty(); + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + $baseACL = $this->getacl("base"); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); + /* Do we represent a valid group? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\" ". @@ -172,9 +183,7 @@ class application extends plugin /* Variables */ foreach(array("description", "gosaApplicationExecute", "gosaApplicationName","cn") as $val){ $smarty->assign($val, $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } - $smarty->assign("baseACL", chkacl($this->acl,"base")); /* Checkboxes */ foreach (array("G" => "exec_for_groupmembers", "O" => "overwrite_config", @@ -190,7 +199,6 @@ class application extends plugin $smarty->assign("isReleaseApplikation" , $this->isReleaseApplikation); $smarty->assign("gotoLogonScript",htmlentities($this->gotoLogonScript, ENT_COMPAT, 'UTF-8')); $smarty->assign("base_select", $this->base); - $smarty->assign("gosaApplicationFlagsACL", chkacl($this->acl, "gosaApplicationFlags")); /* Show main page */ return($smarty->fetch (get_template_path('generic.tpl', TRUE))); } @@ -254,7 +262,7 @@ class application extends plugin if (isset($_POST['overwrite_config']) && $_POST['overwrite_config'] == 1){ $flag.= "O"; } - if (chkacl ($this->acl, "gosaApplicationFlags") ==""){ + if ($this->acl_is_writeable("gosaApplicationFlags")){ $this->gosaApplicationFlags= "[$flag]"; } @@ -317,11 +325,7 @@ class application extends plugin $this->set_picture($_FILES['picture_file']['tmp_name']); } - - /* Save base, since this is no LDAP attribute */ - if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){ - $this->base= $_POST['base']; - } + $this->base= $_POST['base']; } if($this->isReleaseApplikation){ @@ -348,9 +352,7 @@ class application extends plugin } $ui= get_userinfo(); - $acl= get_permissions ($new_dn, $ui->subtreeACL); - $acl= get_module_permission($acl, "application", $new_dn); - if (chkacl($acl, "create") != ""){ + if (!$this->acl_is_createable() && $this->dn == "new"){ $message[]= _("You have no permissions to create a application on this 'Base'."); } @@ -500,6 +502,7 @@ class application extends plugin "objectClass" => "gosaApplication")), "plProvidedAcls"=> array( "cn" => _("Name"), + "base" => _("Base"), "description" => _("Description"), "gosaApplicationExecute" => _("Execute"), "gosaApplicationName" => _("Name"), diff --git a/plugins/admin/applications/generic.tpl b/plugins/admin/applications/generic.tpl index 30a0d2215..78ee97f97 100644 --- a/plugins/admin/applications/generic.tpl +++ b/plugins/admin/applications/generic.tpl @@ -5,42 +5,51 @@ - + - -
+{render acl=$cnACL} + +{/render} +
- +{render acl=$gosaApplicationNameACL} + +{/render}
- +{render acl=$gosaApplicationExecuteACL} + +{/render}
- +{render acl=$descriptionACL} + +{/render}
+{render acl=$baseACL} - {if $baseACL == "" && !$isReleaseApplikation} - - {else} - - {/if} - +{/render} +{render acl=$baseACL disable_picture='images/folder_gray.png'} + +{/render}
@@ -58,9 +67,14 @@  
+ +{render acl=$gosaApplicationIconACL} +{/render} +{render acl=$gosaApplicationIconACL} +{/render} @@ -74,18 +88,30 @@ @@ -97,9 +123,15 @@ diff --git a/plugins/admin/applications/tabs_application.inc b/plugins/admin/applications/tabs_application.inc index 594b05735..ec83a0851 100644 --- a/plugins/admin/applications/tabs_application.inc +++ b/plugins/admin/applications/tabs_application.inc @@ -4,9 +4,9 @@ class apptabs extends tabs { var $Release= ""; - function apptabs($config, $data, $dn) + function apptabs($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); -- 2.30.2
- {t}Only executable for members{/t} +{render acl=$gosaApplicationFlagsACL} + +{/render} + {t}Only executable for members{/t}
- {t}Replace user configuration on startup{/t} +{render acl=$gosaApplicationFlagsACL} + +{/render} + {t}Replace user configuration on startup{/t}
- +{render acl=$gosaApplicationFlagsACL} + +{/render} {t}Place icon on members desktop{/t}
- +{render acl=$gosaApplicationFlagsACL} + +{/render} {t}Place entry in members startmenu{/t}
- +{render acl=$gosaApplicationFlagsACL} + +{/render} {t}Place entry in members launch bar{/t}

{t}Script{/t} {t}Script{/t}

+{render acl=$gotoLogonScriptACL} +{/render} +{render acl=$gotoLogonScriptACL} +{/render} +{render acl=$gotoLogonScriptACL} +{/render} {t}Download{/t}