index c308999b2706c44ec75f5c66c04f7fc4679ad4b7..054c3dcb628980867480066f060554e938093f16 100644 (file)
/* Load Attributes */
plugin::plugin ($config, $dn);
- $this->acl ="#all#";
-
/* If "dn==new" we try to create a new entry
* Else we must read all objects from ldap which belong to this entry.
* First read SubObjects from ldap ... and then the partition definitions for the SubObjects.
*/
if($dn != "new"){
- /* Set acls
- */
- $ui = get_userinfo();
- $acl = get_permissions ($this->dn, $ui->subtreeACL);
- $acli = get_module_permission($acl, "FAIclass", $this->dn);
- $this->acl=$acli;
-
$this->dn =$dn;
/* Get FAIstate
/* check if this is a binary entry */
if(in_array_ics($attrs,$this->subBinary)){
- $var = addslashes( $ldap->get_attribute($object['dn'], $attrs,$r_array=0));
+ $var = $ldap->get_attribute($object['dn'], $attrs,$r_array=0);
}
/* Fix slashes */
/* Add new sub object */
if(isset($_POST['AddSubObject'])){
$this->dialog= new $this->subClassName($this->config,"new");
- $this->dialog->acl = $this->acl;
+ $this->dialog->set_acl_base($_SESSION['CurrentMainBase']);
+ $this->dialog->set_acl_category("fai");
$this->is_dialog=true;
}
$obj = $this->get_object_attributes($obj,$this->sub_Load_Later);
}
$this->dialog= new $this->subClassName($this->config,$this->dn,$obj);
+ $this->dialog->set_acl_base($this->dn);
+ $this->dialog->set_acl_category("fai");
$_SESSION['objectinfo'] = $obj['dn'];
if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){
$script = $_POST['SubObject'][0];
$this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$script]);
- $this->dialog->acl = $this->acl;
+ $this->dialog->set_acl_base($_SESSION['CurrentMainBase']);
+ $this->dialog->set_acl_category("fai");
$_SESSION['objectinfo'] = $this->SubObjects[$script]['dn'];
$this->is_dialog=true;
}
*/
$divlist = new divSelectBox("FAIscripts");
$divlist->setHeight(400);
- if((chkacl($this->acl,"cn")!="") || ($this->FAIstate == "freeze")){
+ if(($this->FAIstate == "freeze")){
$img_edit = "<input type='image' src='images/edit.png' name='editscript_%s' title='"._("edit")."' alt='"._("edit")."'>";
$img_remo = "";
}else{
}
}
- foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ $tmp = $this->plInfo();
+ $this->ui = get_userinfo();
+
+ $c_dn = $this->dn;
+ if($c_dn == "new"){
+ $c_dn = $_SESSION['CurrentMainBase'];
+ }
+ $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiScriptEntry")) && $this->FAIstate!="freeze");
+ foreach($tmp['plProvidedAcls'] as $name => $translated){
+ $smarty->assign($name."ACL",$this->getacl($name));
}
$display.= $smarty->fetch(get_template_path('faiScript.tpl', TRUE));
if($obj['status'] != "delete"){
if($use_dns){
if((isset($obj['description']))&&(!empty($obj['description']))){
- $a_return[$obj['cn']]['name']= $obj['cn']." [".$obj['description']."]";
+ $a_return[$obj['cn']]['name']= $obj['cn']." [".stripslashes($obj['description'])."]";
}else{
$a_return[$obj['cn']]['name']= $obj['cn'];
}
$a_return[$obj['cn']]['dn']= $obj['dn'];
}else{
if((isset($obj['description']))&&(!empty($obj['description']))){
- $a_return[$obj['cn']]= $obj['cn']." [".$obj['description']."]";
+ $a_return[$obj['cn']]= $obj['cn']." [".stripslashes($obj['description'])."]";
}else{
$a_return[$obj['cn']]= $obj['cn'];
}
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
- $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+# $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+ $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
if($_SESSION['faifilter']['branch'] == "main"){
$use_dn = $this->dn;
}
prepare_to_save_FAI_object($use_dn,array(),true);
foreach($this->SubObjects as $name => $obj){
- $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+# $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+ $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $obj['dn']);
if($_SESSION['faifilter']['branch'] == "main"){
$use_dn = $obj['dn'];
}
"plSection" => array("administration"),
"plCategory" => array("fai"),
"plProvidedAcls" => array(
- "cn" => _("Name"),
- "description" => _("Description"),
- "FAIpriority" => _("Script priority"),
- "FAIscript" => _("FAI script"))
+ "cn" => _("Name")." ("._("Readonly").")",
+ "description" => _("Description"))
));
}
}