diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
index 953f45a823a21adad40343c7fc1d3c7611df7755..59a67c8b8dcdb9d9541ff37fe34525d738127231 100644 (file)
$this->base= dn2base($ui->dn);
}
} else {
- $this->base= preg_replace ("/^[^,]+,".get_ou('applicationRDN')."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou('applicationRDN'), '/')."/i", "", $this->dn);
}
$this->orig_cn = $this->cn;
$this->orig_base = $this->base;
+ $this->gosaApplicationFlags = preg_replace("/[^GDLMO]/","",$this->gosaApplicationFlags);
}
$smarty->assign("selectmode", "disabled");
}
- /* Base select dialog */
- $once = true;
- foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once && !preg_match("/freeze/i",$this->FAIstate)){
- $once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
- $this->dialog->setCurrentBase($this->base);
- }
- }
-
- /* Dialog handling */
- if(is_object($this->dialog)){
- /* Must be called before save_object */
- $this->dialog->save_object();
-
- if($this->dialog->isClosed()){
- $this->dialog = false;
- }elseif($this->dialog->isSelected()){
-
- /* Just allow selection valid bases */
- $tmp = $this->get_allowed_bases();
- if(isset($tmp[$this->dialog->isSelected()])){
- $this->base = $this->dialog->isSelected();
- }
- $this->dialog= false;
- }else{
- return($this->dialog->execute());
- }
- }
-
/* Get random number for pictures */
srand((double)microtime()*1000000);
$smarty->assign("rand", rand(0, 10000));
restore_error_handler();
/* Parse release out of object dn */
- $release = preg_replace("/".get_ou("applicationRDN").normalizePreg($this->base)."$/","",$this->dn);
+ $release = preg_replace("/".preg_quote(get_ou("applicationRDN").$this->base, '/')."$/i","",$this->dn);
$release = preg_replace("/^cn=[^,]+,/","",$release);
/* Get a list of all groups
$ldap->cd($release.$group);
$ldap->search("(objectClass=gotoMenuEntry)",array("dn"));
while($attrs = $ldap->fetch()){
- $info = preg_replace("/".normalizePreg($release.$group)."$/","",$attrs['dn']);
+ $info = preg_replace("/".preg_quote($release.$group, '/')."$/","",$attrs['dn']);
if(preg_match("/^cn=".$this->cn."/",$info) && !preg_match("/ou=[^,]+,/",$info)){
$found[] = $attrs['dn'];
}
"placeInStartmenu" => "M",
"overwriteConfig" => "O");
+
/* Save application flags */
foreach($checks as $name => $flag){
if($this->acl_is_writeable($name)){
$set = isset($_POST[$name]) && $_POST[$name] == 1;
- if(!$set && preg_match("/".$flag."/",$this->gosaApplicationFlags)){
- $this->gosaApplicationFlags = preg_replace("/".$flag."/","",$this->gosaApplicationFlags);
+ if(!$set && strstr($this->gosaApplicationFlags,$flag)){
+ $this->gosaApplicationFlags = str_replace($flag,"",$this->gosaApplicationFlags);
}elseif($set && !preg_match("/".$flag."/",$this->gosaApplicationFlags)){
- $this->gosaApplicationFlags = preg_replace("/]/",$flag."]",$this->gosaApplicationFlags);
+ $this->gosaApplicationFlags .= $flag;
}
}
}
/* Get application script without header part, to check if we must save the script itself */
$script = preg_replace('/.*### END HEADER ###/s', '', $this->gotoLogonScript);
+ $this->gosaApplicationFlags ="[{$this->gosaApplicationFlags}]";
plugin::save();
$this->attrs["gosaApplicationIcon"]= $this->gosaApplicationIcon;
{
$vars = array("cn");
- $str ="<h2>"._("Application settings")."</h2>
- <table>
+ $str ="<h3>"._("Application settings")."</h3>
+ <table summary=\""._("Application settings")."\">
<tr>
<td>".
_("Application name").