From 01f642762ae65b3e4fee377c5a95ea9a901b389c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 2 Nov 2006 05:25:13 +0000 Subject: [PATCH] Removed old acl functions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4981 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 1 - include/class_plugin.inc | 4 +- include/functions.inc | 92 ++++------------------------------------ 3 files changed, 9 insertions(+), 88 deletions(-) diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 7afd0e727..d182696ee 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -98,7 +98,6 @@ - diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 2f9041e1c..642676dc0 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -1122,10 +1122,8 @@ class plugin function remove_snapshot($dn) { $ui = get_userinfo(); - $acl = get_permissions ($dn, $ui->subtreeACL); - $acl = get_module_permission($acl, "snapshot", $dn); - if($this->acl_is_removeable()) + if($this->acl_is_removeable()){ $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ldap->rmdir_recursive($dn); diff --git a/include/functions.inc b/include/functions.inc index 21e35a822..286e0a18b 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -735,94 +735,17 @@ function getMenuCache() } -function get_permissions ($dn, $subtreeACL) +function get_permissions () { - global $config; -echo "get_permissions() - is deprecated
"; - return array("none"); - - $base= $config->current['BASE']; - $tmp= "d,".$dn; - $sacl= array(); - - /* Sort subacl's for lenght to simplify matching - for subtrees */ - foreach ($subtreeACL as $key => $value){ - $sacl[$key]= strlen($key); - } - arsort ($sacl); - reset ($sacl); - - /* Successively remove leading parts of the dn's until - it doesn't contain commas anymore */ - $tmp_dn= preg_replace('/\\\\,/', '', $tmp); - while (preg_match('/,/', $tmp_dn)){ - $tmp_dn= ltrim(strstr($tmp_dn, ","), ","); - $tmp= preg_replace('/\/', '\\,', $tmp); - - /* Check for acl that may apply */ - foreach ($sacl as $key => $value){ - if (preg_match("/$key$/", $tmp)){ - return ($subtreeACL[$key]); - } - } - } - + /* Look for attribute in ACL */ + trigger_error("Don't use get_permissions() its obsolete. Use userinfo::get_permissions() instead."); return array(""); } -function get_module_permission($acl_array, $module, $dn) +function get_module_permission() { - global $ui; -echo "get_module_permissions() - to be removed
"; - - $final= ""; - foreach($acl_array as $acl){ - - /* Check for selfflag (!) in ACL to determine if - the user is allowed to change parts of his/her - own account */ - if (preg_match("/^!/", $acl)){ - if ($dn != "" && $dn != $ui->dn){ - - /* No match for own DN, give up on this ACL */ - continue; - - } else { - - /* Matches own DN, remove the selfflag */ - $acl= preg_replace("/^!/", "", $acl); - - } - } - - /* Remove leading garbage */ - $acl= preg_replace("/^:/", "", $acl); - - /* Discover if we've access to the submodule by comparing - all allowed submodules specified in the ACL */ - $tmp= split(",", $acl); - foreach ($tmp as $mod){ - if (preg_match("/^$module#/", $mod)){ - $final= strstr($mod, "#")."#"; - continue; - } - if (preg_match("/[^#]$module$/", $mod)){ - return ("#all#"); - } - if (preg_match("/^all$/", $mod)){ - return ("#all#"); - } - } - } - - /* Return assembled ACL, or none */ - if ($final != ""){ - return (preg_replace('/##/', '#', $final)); - } - - /* Nothing matches - disable access for this object */ + trigger_error("Don't use get_module_permission() its obsolete."); return ("#none#"); } @@ -932,10 +855,11 @@ function get_base_from_people($dn) } -function chkacl($acl, $name) +function chkacl() { /* Look for attribute in ACL */ - return ("'\"> CHKACL is deprecated use this::getacl() instead <\"'"); + trigger_error("Don't use chkacl() its obsolete. Use userinfo::getacl() instead."); + return("-deprecated-"); } -- 2.30.2