From b85190409df407aef5320dbb9bb8a4f3f845a7c8 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Dec 2006 10:05:06 +0000 Subject: [PATCH] Some acl fixes for several addons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5304 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_userinfo.inc | 3 +++ plugins/addons/ldapmanager/class_exportxls.inc | 4 +++- plugins/gofax/blocklists/class_blocklistManagement.inc | 2 +- plugins/gofax/faxreports/class_faxreport.inc | 1 + plugins/gofon/fonreports/class_fonreport.inc | 9 +++++---- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 85417cdb1..4b2f11b2e 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -352,6 +352,9 @@ class userinfo function mergeACL($acl, $type, $newACL) { + if(preg_match("/w/",$newACL) && !preg_match("/r/",$newACL)){ + $newACL .= "r"; + } foreach(str_split($newACL) as $char){ /* Ignore invalid characters */ diff --git a/plugins/addons/ldapmanager/class_exportxls.inc b/plugins/addons/ldapmanager/class_exportxls.inc index 8a830d106..0135d6e90 100644 --- a/plugins/addons/ldapmanager/class_exportxls.inc +++ b/plugins/addons/ldapmanager/class_exportxls.inc @@ -32,6 +32,8 @@ class xlsexport extends plugin $smarty->assign("type",FALSE); $smarty->assign("depselectivbb",""); + if(!isset($_POST['selfull'])) $_POST['selfull'] = "Somehow not posted"; + /* Check permissions for export */ // fill in old vars in the Export form if((isset($_POST['single']))&&(isset($_POST['sfrmgetsingle']))){ @@ -96,7 +98,7 @@ class xlsexport extends plugin $acls = $this->ui->get_permissions($dn,"all/all"); } - if((!preg_match("/r/",$acls)) && isset($dn)){ + if(!preg_match("/r/",$acls)){ /* Show error msg */ print_red(sprintf(_("You are not allowed to export the given ldap entry (%s)"),@LDAP::fix($dn))); diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index ef2332d83..c5b08286b 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -580,7 +580,7 @@ class blocklist extends plugin return (array( "plShortName" => _("Fax"), "plDescription" => _("Fax Blocklists"), - "plSelfModify" => TRUE, + "plSelfModify" => FALSE, "plDepends" => array(), "plPriority" => 0, diff --git a/plugins/gofax/faxreports/class_faxreport.inc b/plugins/gofax/faxreports/class_faxreport.inc index 0e1340d3f..bed39e0ca 100644 --- a/plugins/gofax/faxreports/class_faxreport.inc +++ b/plugins/gofax/faxreports/class_faxreport.inc @@ -30,6 +30,7 @@ class faxreport extends plugin var $objectclasses= array(); var $fax_users = array(); + /* Create class */ function faxreport ($config, $ui) { diff --git a/plugins/gofon/fonreports/class_fonreport.inc b/plugins/gofon/fonreports/class_fonreport.inc index a01579672..defaa4e79 100644 --- a/plugins/gofon/fonreports/class_fonreport.inc +++ b/plugins/gofon/fonreports/class_fonreport.inc @@ -203,8 +203,10 @@ class fonreport extends plugin $no_acl = ""._("Insufficient permissions").""; + $no_acl = " "; + while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { - + foreach($line as $attr => $value){ if($attr == "duration") continue; @@ -318,12 +320,11 @@ class fonreport extends plugin $s = preg_replace("/\%/","",$s); $s2 = preg_replace("/\*/","%",$s); - $filter = "(&(objectClass=gosaAccount)(!(objectClass=gosaUserTemplate))(objectClass=gofonAccount)". + $filter = "(&(objectClass=gosaAccount)(!(objectClass=gosaUserTemplate))". "(|(uid=$s)(l=$s)(homePhone=$s)(telephoneNumber=$s)(facsimileTelephoneNumber=$s)(mobile=$s)". "(pager=$s)(cn=$s)(givenName=$s)(sn=$s)(personalTitle=$s)(title=$s)))"; $attrs = array("uid"); - $res = get_list($filter,"users",$this->search_base,$attrs); $str = " AND ("; @@ -387,7 +388,7 @@ class fonreport extends plugin { return (array( "plShortName" => _("Phone reports"), - "plDescription" => _("Phone reports"), + "plDescription" => _("Phone reports")." "._("All entries are readonly")."", "plSelfModify" => TRUE, "plDepends" => array(), "plPriority" => 0, -- 2.30.2