From 473cdc7966e72e2b3bc05ffc5e66c9a1b0815c85 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 26 Oct 2006 06:08:16 +0000 Subject: [PATCH] Inital acl fixed for conferences git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4943 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_phoneConferenceGeneric.inc | 53 +-- .../class_phoneConferenceManagment.inc | 28 +- plugins/gofon/conference/generic.tpl | 374 ++++++++++-------- plugins/gofon/conference/main.inc | 3 - 4 files changed, 262 insertions(+), 196 deletions(-) diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index 1e9340b23..18878127d 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -84,9 +84,6 @@ class conference extends plugin $this->base= preg_replace ("/^[^,]+,/", "", $this->dn); } - $ui= get_userinfo(); - $acl= get_permissions ($ui->dn, $this->ui->subtreeACL); - $this->acl= get_module_permission($acl, "conference", $ui->dn); $this->goFonConferenceOwner=$this->ui->dn; /* Parse Options ... @@ -118,8 +115,26 @@ class conference extends plugin $smarty= get_smarty(); - $smarty->assign("bases" ,$this->config->idepartments); - $smarty->assign("base" ,$this->base); + /* Assign base ACL */ + $baseACL = $this->getacl("base"); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); + + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + if($this->acl_is_writeable("base")){ + $smarty->assign("baseSelect",true); + }else{ + $smarty->assign("baseSelect",false); + } + + $smarty->assign("bases" ,$this->get_allowed_bases()); + $smarty->assign("base_select" ,$this->base); $once = true; foreach($_POST as $name => $value){ @@ -151,7 +166,6 @@ class conference extends plugin foreach ($this->attributes as $val){ $smarty->assign("$val", $this->$val); - $smarty->assign("$val"."ACL", chkacl($this->acl, "$val")); if(!$this->$val){ $smarty->assign($val."CHK", ""); }else{ @@ -161,11 +175,11 @@ class conference extends plugin if($_SESSION['js']==1){ if($this->goFonConferenceOption_P != "P"){ - $smarty->assign("goFonPINACL"," disabled "); + $smarty->assign("goFonPINACL", $this->getacl("goFonPIN",TRUE)); $smarty->assign("goFonPIN",""); } if($this->goFonConferenceOption_r != "r"){ - $smarty->assign("goFonConferenceOptionFormatACL"," disabled "); + $smarty->assign("goFonConferenceOptionFormatACL", $this->getacl("goFonConferenceOptionr",TRUE)); } } return($smarty->fetch (get_template_path('generic.tpl', TRUE))); @@ -486,12 +500,6 @@ 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->cd($this->config->current['BASE']); $ldap->cat($this->dn, array('dn')); @@ -518,7 +526,7 @@ class conference extends plugin function plInfo() { return (array( - "plShortName" => _("Phone conferences"), + "plShortName" => _("Conference"), "plDescription" => _("Phone conference management"), "plSelfModify" => TRUE, "plDepends" => array(), @@ -528,17 +536,18 @@ class conference extends plugin "objectClass" => "gofonConference")), "plProvidedAcls" => array( + "cn" => _("Name"), "base" => _("Base"), "description" => _("Description"), "goFonPIN" => _("Conference PIN"), - "goFonConferenceOption_P" => _("Preset PIN"), - "goFonConferenceOption_r" => _("Record conference"), - "goFonConferenceOption_M" => _("Play music on hold"), - "goFonConferenceOption_s" => _("Activate menu"), - "goFonConferenceOption_i" => _("Announce user activity"), - "goFonConferenceOption_c" => _("Count user"), - "goFonConferenceOption_D" => _("Conference type"), + "goFonConferenceOptionP" => _("Preset PIN"), + "goFonConferenceOptionr" => _("Record conference"), + "goFonConferenceOptionM" => _("Play music on hold"), + "goFonConferenceOptions" => _("Activate menu"), + "goFonConferenceOptioni" => _("Announce user activity"), + "goFonConferenceOptionc" => _("Count user"), + "goFonConferenceOptionD" => _("Conference type"), "goFonConferenceOptionFormat" => _("Format"), "goFonConferenceOptionLifetime" => _("Lifetime"), diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc index 1bfb9b2f8..5f2ade729 100644 --- a/plugins/gofon/conference/class_phoneConferenceManagment.inc +++ b/plugins/gofon/conference/class_phoneConferenceManagment.inc @@ -36,19 +36,15 @@ class phoneConferenceManagment extends plugin var $conferences = array(); var $conftab = false; - + var $ui = NULL; var $DivListConference = NULL; /* Initialise Class */ function phoneConferenceManagment ($config, $ui) { - $this->ui = $ui; - $this->dn = ""; + $this->ui = $ui; + $this->dn = ""; $this->config = $config; - - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $this->acl= get_module_permission($acl, "conference", $ui->dn); - $this->DivListConference = new divListConference($this->config,$this); } @@ -144,8 +140,10 @@ class phoneConferenceManagment extends plugin /* If department deletion is accepted ... * Finally delete department */ + $acl = $this->ui->get_permissions($this->dn,"gofon/conference"); if (isset($_POST['delete_department_confirm'])){ - if (chkacl($this->acl, "delete") == ""){ + echo "What the hell is going on here ? Huh ?!!"; + if(preg_match("/d/",$acl)){ $this->remove_from_parent(); gosa_log ("Department object'".$this->dn."' has been removed"); } else { @@ -173,7 +171,9 @@ class phoneConferenceManagment extends plugin add_lock ($this->dn, $this->ui->dn); /* Register conftab to trigger edit dialog */ - $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn); + $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofon"); + $this->conftab->set_acl_category("gofon"); + $this->conftab->set_acl_base($this->dn); $_SESSION['objectinfo']= $this->dn; } @@ -183,11 +183,13 @@ class phoneConferenceManagment extends plugin ***************/ /* Insert new entry*/ - if($s_action == "new"){ + if($s_action == "new" ){ /* Set up the users ACL's for this 'dn' */ $this->dn= "new"; - $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn); + $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofon"); + $this->conftab->set_acl_category("gofon"); + $this->conftab->set_acl_base($this->DivListConference->selectedBase); unset($_SESSION['objectinfo']); } @@ -304,7 +306,11 @@ class phoneConferenceManagment extends plugin function remove_from_parent() { + /* Ehm what are we doinf here ? */ + $cfg = new conference($this->config, $this->dn); + $cfg->set_acl_category("gofon"); + $cfg->set_acl_base($this->dn); $cfg->remove_from_parent(); $ldap= $this->config->get_ldap_link(); diff --git a/plugins/gofon/conference/generic.tpl b/plugins/gofon/conference/generic.tpl index f7b25a2d2..75548aca2 100644 --- a/plugins/gofon/conference/generic.tpl +++ b/plugins/gofon/conference/generic.tpl @@ -1,170 +1,221 @@ - - - - - + + - - + + + + + + + + + - - - - - - - - - + + - - - + +
-

{t}Properties{/t}

-
- - - - - - - - - - - - - - - + + + + + +
- - {$must} - - -
{$must} - -

{$must} - - {if $baseACL == ""} +
+

+ {t}Properties{/t} +

+
+ + + + + + + + + + + + + + + - -
+ + {$must} + +{render acl=$cnACL} + +{/render} +
+ + {$must} + +{render acl=$goFonConferenceOptionDACL} + +{/render} +
+
+
+ + {$must} + + +{render acl=$baseACL} + +{/render} + +{render acl=$baseACL disable_picture='images/folder_gray.png'} - {else} - - {/if} -
+{/render} + +
+ +
+   + + + + + + + + + + + + + + +
+ + +{render acl=$descriptionACL} + +{/render} +
+ {t}Lifetime (in days){/t} + +{render acl=$goFonConferenceOptionLifetimeACL} + +{/render} +
+ {t}Phone number{/t} + {$must} + +{render acl=$telephoneNumberACL} + +{/render} +
-
-   - - - - - - - - - - - - - - -
- - - -
- {t}Lifetime (in days){/t} - - -
- {t}Phone number{/t} - {$must} - - -
+
+

 

+
+

+ {t}Options{/t} +

+
-
-

 

-
-

{t}Options{/t}

-
+ + + + + + + + + + + + + + + + +
+{render acl=$goFonConferenceOptionPACL} + +{/render} + + {t}Preset PIN{/t} +
+   + + {t}PIN{/t} +{render acl=$goFonPINACL} + +{/render} +
+{render acl=$goFonConferenceOptionrACL} + +{/render} + {t}Record conference{/t} +
+   + + {t}Sound file format{/t}  +{render acl=$goFonConferenceOptionFormatACL} + +{/render} +
- - - - - - - - - - - - - - - -
- - - {t}Preset PIN{/t} -
-   - - {t}PIN{/t} -
- - {t}Record conference{/t} -
-   - - {t}Sound file format{/t}  - -
+
+   + - -   - - - - - - - - - - - - - - -
- - {t}Play music on hold{/t} -
- - {t}Activate session menu{/t} -
- - {t}Announce users joining or leaving the conference{/t} -
- - {t}Count users{/t} -
+ + + + + + + + + + + + + +
+{render acl=$goFonConferenceOptionMACL} + +{/render} + {t}Play music on hold{/t} +
+{render acl=$goFonConferenceOptionsACL} + +{/render} + {t}Activate session menu{/t} +
+{render acl=$goFonConferenceOptioniACL} + +{/render} + {t}Announce users joining or leaving the conference{/t} +
+{render acl=$goFonConferenceOptioncACL} + +{/render} + {t}Count users{/t} +
-
@@ -173,3 +224,6 @@ document.mainform.cn.focus(); --> + diff --git a/plugins/gofon/conference/main.inc b/plugins/gofon/conference/main.inc index fd3ea7ef8..d75fc78d9 100644 --- a/plugins/gofon/conference/main.inc +++ b/plugins/gofon/conference/main.inc @@ -41,9 +41,6 @@ if ($remove_lock){ $display= print_header(get_template_path('images/conference.png'), _("Conference management")); } - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $conference->acl= get_module_permission($acl, "conference", $ui->dn); - /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ del_lock ($ui->dn); -- 2.30.2