diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
index 1b6b1f6cdda125600f2b00fda394bbd6e2fc242b..b6caa4d92e41ee5becc1d495299430004d078fb3 100644 (file)
$this->base= dn2base($ui->dn);
}
} else {
- $this->base= preg_replace ("/^[^,]+,".get_ou('applicationou')."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".get_ou('applicationRDN')."/", "", $this->dn);
}
$this->orig_cn = $this->cn;
$this->orig_base = $this->base;
+ $this->gosaApplicationFlags = preg_replace("/[^GDLMO]/","",$this->gosaApplicationFlags);
}
restore_error_handler();
/* Parse release out of object dn */
- $release = preg_replace("/".get_ou("applicationou").normalizePreg($this->base)."$/","",$this->dn);
+ $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base, '/')."$/","",$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;
}
}
}
/* Permissions for that base? */
if ($this->base != ""){
- $new_dn= "cn=".$this->cn.",".get_ou('applicationou').$this->base;
+ $new_dn= "cn=".$this->cn.",".get_ou('applicationRDN').$this->base;
} else {
$new_dn= $this->dn;
}
if($this->is_release()){
$base = $this->parent->parent->app_release;
}else{
- $base = get_ou('applicationou').$this->base;
+ $base = get_ou('applicationRDN').$this->base;
}
$ldap->ls("(&(objectClass=gosaApplication)(cn=".$this->cn."))",$base,array("cn"));
/* 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;
function set_picture($filename)
{
if (!is_file($filename)){
- $filename= "./images/default_icon.png";
+ $filename= "./plugins/goto/images/default_icon.png";
$this->gosaApplicationIcon= "*removed*";
}