Code

Added acl check for conferences
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Aug 2005 09:34:36 +0000 (09:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Aug 2005 09:34:36 +0000 (09:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1167 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/acl_definition.inc
plugins/admin/ogroups/class_phonequeue.inc
plugins/gofon/conference/class_phoneConferenceGeneric.inc
plugins/gofon/conference/class_phoneConferenceManagment.inc

index d3ee1ecf7151f05d5b1476f2c06b7f76a8d09ed5..580029e607a2e97c2744a5f8201cf8fced61157b 100644 (file)
@@ -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");
 ?>
index 506984d55659a2be4381a61c9966893f4da9ee96..96fbdf170027e37f002438fe51641631b04d50f2 100644 (file)
@@ -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){
index 604bb7a7646ab3914bf9e8503dc2019b1abde84b..be02495cfc958ed2f030823432865fc54ae9f988 100644 (file)
@@ -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);
index 3a8ac2e724a9aa20a9bef789c18a3356eaa4dad7..f050f9faf579f501b5060b974a6e2ff0658534b0 100644 (file)
@@ -290,7 +290,8 @@ class phoneConferenceManagment extends plugin
     /* Images for delete / edit */
     $actions = "<input type='image' src='images/edit.png'               alt='"._("edit")."'      name='conf_edit_%KEY%' title='"._("Edit this entry")."'>";
     $actions.= "<input type='image' src='images/edittrash.png' alt='"._("delete")."'   name='conf_del_%KEY%'  title='"._("Delete this entry")."'>";
-
+    
+    $actions2= "<input type='image' src='images/edittrash.png' alt='"._("delete")."'   name='conf_del_%KEY%'  title='"._("Delete this entry")."'>";
     /* open an entry */
     $linkopen= "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
 
@@ -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 = "&nbsp;";
@@ -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"=>"&nbsp;", "attach" => "style='text-align:  right;border:none'");
+      }
+
+
       $divlist->AddEntry(array($a_field1,$a_field2,$a_field3,$a_field4,$a_field5));
     }