From 66dd1e5863e1067a58b1efb08c8823efa96d8762 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Aug 2005 09:34:36 +0000 Subject: [PATCH] Added acl check for conferences git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1167 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/acl_definition.inc | 19 +++++++++++++ plugins/admin/ogroups/class_phonequeue.inc | 2 +- .../class_phoneConferenceGeneric.inc | 14 +++++++++- .../class_phoneConferenceManagment.inc | 27 ++++++++++++++++--- 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/plugins/admin/groups/acl_definition.inc b/plugins/admin/groups/acl_definition.inc index d3ee1ecf7..580029e60 100644 --- a/plugins/admin/groups/acl_definition.inc +++ b/plugins/admin/groups/acl_definition.inc @@ -174,6 +174,25 @@ $ACLD['pureftpd']= array("FTPUploadBandwidth", "FTPQuotaFiles", "FTPUploadRatio", "FTPDownloadRatio"); +$ACLD['goFonConference']= array( + "goFonConference", + "goFonPIN", + "base", + "cn", + "description", + "telephoneNumber", + "goFonConferenceOption", + "goFonConferenceOptionLifetime", + "goFonConferenceOptionFormat", + "goFonConferenceOption_s", + "goFonConferenceOption_i", + "goFonConferenceOption_r", + "goFonConferenceOption_d", + "goFonConferenceOption_D", + "goFonConferenceOption_P", + "goFonConferenceOption_M", + "goFonConferenceOption_c", + "goFonConferenceOwner"); $ACLD['global-addressbook']= array("create", "delete"); ?> diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 506984d55..96fbdf170 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -471,7 +471,7 @@ class phonequeue extends plugin { $ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(goFonConference))", array("telephoneNumber","cn","uid")); + $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue)(objectClass=goFonConference))", array("telephoneNumber","cn","uid")); while($attrs = $ldap->fetch()) { unset($attrs['telephoneNumber']['count']); foreach($attrs['telephoneNumber'] as $tele){ diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index 604bb7a76..be02495cf 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -26,6 +26,7 @@ class conference extends plugin var $base = ""; var $ou = ""; var $goFonPIN = ""; + var $acl = ""; var $goFonConferenceOption = ""; var $goFonConferenceOption_P = ""; // Set PIN @@ -79,7 +80,9 @@ class conference extends plugin $this->base= preg_replace ("/^[^,]+,/", "", $this->dn); } - $this->goFonConferenceOwner=$this->ui->dn; + $acl= get_permissions ($this->dn, $this->ui->subtreeACL); + $this->acl= get_module_permission($acl, "goFonConference", $this->dn); + $this->goFonConferenceOwner=$this->ui->dn; /* Parse Options ... * Parameter|Lifetime|number @@ -104,6 +107,9 @@ class conference extends plugin function execute() { + $acl= get_permissions ($this->dn, $this->ui->subtreeACL); + $this->acl= get_module_permission($acl, "goFonConference", $this->dn); + $this->config->departments = get_departments($this->dn); $this->config->make_idepartments(); $smarty= get_smarty(); @@ -408,6 +414,12 @@ class conference extends plugin unset($this->attrs['base']); + foreach($this->attributes as $atr){ + if(chkacl($this->acl, $atr)!=""){ + unset($this->attrs[$atr]); + } + } + $ldap= $this->config->get_ldap_link(); $ldap->cat($this->dn); diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc index 3a8ac2e72..f050f9faf 100644 --- a/plugins/gofon/conference/class_phoneConferenceManagment.inc +++ b/plugins/gofon/conference/class_phoneConferenceManagment.inc @@ -290,7 +290,8 @@ class phoneConferenceManagment extends plugin /* Images for delete / edit */ $actions = ""; $actions.= ""; - + + $actions2= ""; /* open an entry */ $linkopen= "%s"; @@ -339,7 +340,7 @@ class phoneConferenceManagment extends plugin /* Insert conferneces*/ foreach($this->conferences as $conferencekey => $conference ){ - if(isset($conference['goFonPIN'][0])){ + if((isset($conference['goFonPIN'][0]))&&($this->ui->dn==$conference['goFonConferenceOwner'][0])){ $pin = $conference['goFonPIN'][0]; }else{ $pin = " "; @@ -357,10 +358,28 @@ class phoneConferenceManagment extends plugin $cn = $data['cn'][0]; $a_field1 = array("string"=>sprintf($userimg,_("Conference"))); - $a_field2 = array("string"=>sprintf($editlink,$conferencekey,$conference['cn'][0].$number)); + + + if(($this->ui->dn==$conference['goFonConferenceOwner'][0])&&(chkacl($this->acl,"goFonConferenceOwner")=="")){ + $a_field2 = array("string"=>sprintf($editlink,$conferencekey,$conference['cn'][0].$number)); + }else{ + $a_field2 = array("string"=>$conference['cn'][0].$number); + } $a_field3 = array("string"=> $cn); $a_field4 = array("string"=> $pin); - $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions), "attach" => "style='text-align: right;border:none'"); + + $acl= get_permissions ($conference['dn'], $this->ui->subtreeACL); + $this->acl = get_module_permission($acl, "goFonConference", $conference['dn']); + + if(($this->ui->dn==$conference['goFonConferenceOwner'][0])&&(chkacl($this->acl,"goFonConferenceOwner")=="")){ + $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions), "attach" => "style='text-align: right;border:none'"); + }elseif(chkacl($this->acl,"goFonConferenceOwner")==""){ + $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions2), "attach" => "style='text-align: right;border:none'"); + }else{ + $a_field5 = array("string"=>" ", "attach" => "style='text-align: right;border:none'"); + } + + $divlist->AddEntry(array($a_field1,$a_field2,$a_field3,$a_field4,$a_field5)); } -- 2.30.2