From: hickert Date: Fri, 29 Sep 2006 08:18:27 +0000 (+0000) Subject: Some acl changes made for phone objects X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=90fe4d7876e1381c539a9d253c8f07125679e209;p=gosa.git Some acl changes made for phone objects git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4832 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 2a98149b2..f35a0ca03 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -192,7 +192,20 @@ class phoneGeneric extends plugin /* Fill templating stuff */ $smarty= get_smarty(); - $smarty->assign("bases", $this->config->idepartments); + + /* Assign base ACL */ + $baseACL = $this->getacl("base"); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); + $smarty->assign("bases", $this->get_allowed_bases()); + + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + $smarty->assign("staticAddress","*");// $this->config->idepartments); /* Create Arrays for samrty select boxes */ @@ -204,7 +217,7 @@ class phoneGeneric extends plugin /* deativate all fields that are not used by the specified type */ foreach($this->attributes as $att){ - if((!in_array($att,$this->usedattrs[$this->selected_categorie]))||(chkacl($this->acl,$att)!="")){ + if((!in_array($att,$this->usedattrs[$this->selected_categorie]))){ $smarty->assign($att."USED", "disabled" ); $smarty->assign($att, ""); }else{ @@ -216,11 +229,9 @@ class phoneGeneric extends plugin $smarty->assign("selected_categorie",$this->selected_categorie); /* Assign attributes */ - foreach ($this->attributes as $attr){ - $smarty->assign($attr."ACL", chkacl($this->acl, $attr)); - } + + $smarty->assign("base_select", $this->base); - $smarty->assign("baseACL", chkacl($this->acl,"base")); $smarty->assign("goFonDefaultIPs",array("dynamic"=>_("dynamic"),"network"=>_("Networksettings"))); @@ -264,7 +275,7 @@ class phoneGeneric extends plugin plugin::save_object(); $this->netConfigDNS->save_object(); /* Save base, since this is no LDAP attribute */ - if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){ + if (isset($_POST['base']) && $this->acl_is_moveable()){ $this->base= $_POST['base']; } } @@ -288,17 +299,15 @@ class phoneGeneric extends plugin } } - if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){ + if ($this->cn == ""){ $message[]= _("The required field 'Phone name' is not set."); } - if ($this->cn == "0" && chkacl ($this->acl, "cn") == ""){ + if ($this->cn == "0"){ $message[]= _("The 'Phone name' '0' is reserved and cannot be used."); } $ui= get_userinfo(); - $acl= get_permissions ($this->dn, $ui->subtreeACL); - $acl= get_module_permission($acl, "phone", $this->dn); - if (chkacl($acl, "create") != ""){ + if ($this->dn == "new" && $this->acl_is_createable()){ $message[]= _("You have no permissions to create a phone on this 'Base'."); } @@ -336,11 +345,6 @@ class phoneGeneric extends plugin if(!in_array($att,$this->usedattrs[$mode])){ $this->attrs[$att] = array(); } - - /* Test rights of this user ... */ - if(chkacl($this->acl,$att)!=""){ - unset($this->attrs[$att]); - } } /* unset the categorie*/ @@ -417,11 +421,18 @@ class phoneGeneric extends plugin "plProvidedAcls"=> array( "cn" => _("Name"), "description" => _("Description"), - "goFonType" => _("Mode"), - "goFonDmtfMode" => _("DTMF mode"), - "goFonDefaultIP" => _("Default ip"), - "goFonQualify" => _("Qualify"), - "selected_categorie" => _("Hardware type")) + "goFonType" => _("SIP Mode"), + "goFonDmtfMode" => _("SIP DTMF mode"), + "goFonDefaultIP" => _("SIP Default ip"), + "goFonQualify" => _("SIP Qualify"), + "goFonAuth" => _("IAX authentication type"), + "goFonSecret" => _("IAX secret"), + "goFonAccountCode" => _("IAX account code"), + "goFonTrunk" => _("IAX trunk lines"), + "goFonPermit" => _("IAX permit settings"), + "goFonDeny" => _("IAX deny settings"), + "goFonMSN" => _("CAPI MSN"), + "categorie" => _("Hardware type")) )); } diff --git a/plugins/admin/systems/phone.tpl b/plugins/admin/systems/phone.tpl index d8172cf63..a7e652cea 100644 --- a/plugins/admin/systems/phone.tpl +++ b/plugins/admin/systems/phone.tpl @@ -4,7 +4,11 @@ - + @@ -12,15 +16,15 @@ +{render acl=$baseACL} + +{/render} +{render acl=$baseACL disable_picture='images/folder_gray.png'} + +{/render} +
{$must} +{render acl=$cnACL} + +{/render} +
 
{$must} - - {if $baseACL == ""} - - {else} - - {/if} -
@@ -28,7 +32,11 @@ - +
+{render acl=$descriptionACL} + +{/render} +
diff --git a/plugins/admin/systems/phonesettings.tpl b/plugins/admin/systems/phonesettings.tpl index 2f1b9ced9..19385ac86 100644 --- a/plugins/admin/systems/phonesettings.tpl +++ b/plugins/admin/systems/phonesettings.tpl @@ -4,9 +4,11 @@ {$staticAddress} +{render acl=$categorieACL} +{/render} {if $javascript eq 'false'} {/if} @@ -24,9 +26,11 @@ +{render acl=$goFonTypeACL} +{/render} @@ -34,9 +38,11 @@ +{render acl=$goFonDmtfModeACL} +{/render} @@ -48,9 +54,11 @@ +{render acl=$goFonDefaultIPACL} +{/render} @@ -58,7 +66,9 @@ +{render acl=$goFonQualifyACL} +{/render} @@ -77,9 +87,11 @@ +{render acl=$goFonTypeACL} +{/render} @@ -87,7 +99,9 @@ +{render acl=$goFonDefaultIPACL} +{/render} @@ -95,7 +109,9 @@ +{render acl=$goFonQualifyACL} +{/render} @@ -108,9 +124,11 @@ +{render acl=$goFonAuthACL} +{/render} @@ -118,7 +136,9 @@ +{render acl=$goFonSecretACL} +{/render}