diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 94c6a831f372c879c2619e598b03b7a932bae9a6..c483bb97d3e71f8fb6338caed3e79767b3e5e848 100644 (file)
$smarty= get_smarty();
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation){
+ $smarty->assign($name."ACL",$this->getacl($name));
+ }
+
+ $baseACL = $this->getacl("base");
+ if(!$this->acl_is_moveable()) {
+ $baseACL = preg_replace("/w/","",$baseACL);
+ }
+ $smarty->assign("baseACL", $baseACL);
+
/* Do we represent a valid group? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
return ($display);
}
- $_SESSION['binary'] = $this->gotoLogonScript;
- $_SESSION['binarytype'] = "octet-stream";
- $_SESSION['binaryfile'] = $this->cn.".gosaApplication";
+ /* Download requested */
+ foreach($_POST as $name => $value){
+ if(preg_match("/^downloadScript/",$name)){
+ $_SESSION['binary'] = $this->gotoLogonScript;
+ $_SESSION['binarytype'] = "octet-stream";
+ $_SESSION['binaryfile'] = $this->cn.".gosaApplication";
+ header("location: getbin.php ");
+ exit();
+ }
+ }
+
+ /* Reassign picture data, sometimes its corrupt cause we started a download of application scripts */
+ $_SESSION['binary'] = $this->iconData;
+ $_SESSION['binarytype'] = "image/jpeg";
+
$smarty->assign("rand", rand(0, 10000));
$head = $this->generateTemplate();
$this->gotoLogonScript= $this->generateTemplate().preg_replace('/.*### END HEADER ###/s', '', $this->gotoLogonScript);
/* Variables */
foreach(array("description", "gosaApplicationExecute", "gosaApplicationName","cn") as $val){
$smarty->assign($val, $this->$val);
- $smarty->assign($val."ACL", chkacl($this->acl, $val));
}
- $smarty->assign("baseACL", chkacl($this->acl,"base"));
/* Checkboxes */
foreach (array("G" => "exec_for_groupmembers", "O" => "overwrite_config",
$smarty->assign("isReleaseApplikation" , $this->isReleaseApplikation);
$smarty->assign("gotoLogonScript",htmlentities($this->gotoLogonScript, ENT_COMPAT, 'UTF-8'));
$smarty->assign("base_select", $this->base);
- $smarty->assign("gosaApplicationFlagsACL", chkacl($this->acl, "gosaApplicationFlags"));
/* Show main page */
return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
}
if (isset($_POST['overwrite_config']) && $_POST['overwrite_config'] == 1){
$flag.= "O";
}
- if (chkacl ($this->acl, "gosaApplicationFlags") ==""){
+ if ($this->acl_is_writeable("gosaApplicationFlags")){
$this->gosaApplicationFlags= "[$flag]";
}
$this->set_picture($_FILES['picture_file']['tmp_name']);
}
-
- /* Save base, since this is no LDAP attribute */
- if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
- $this->base= $_POST['base'];
- }
+ $this->base= $_POST['base'];
}
if($this->isReleaseApplikation){
}
$ui= get_userinfo();
- $acl= get_permissions ($new_dn, $ui->subtreeACL);
- $acl= get_module_permission($acl, "application", $new_dn);
- if (chkacl($acl, "create") != ""){
+ if (!$this->acl_is_createable() && $this->dn == "new"){
$message[]= _("You have no permissions to create a application on this 'Base'.");
}
"objectClass" => "gosaApplication")),
"plProvidedAcls"=> array(
"cn" => _("Name"),
+ "base" => _("Base"),
"description" => _("Description"),
"gosaApplicationExecute" => _("Execute"),
"gosaApplicationName" => _("Name"),
"gosaApplicationIcon" => _("Icon"),
"gosaApplicationFlags" => _("Flag"),
"gotoLogonScript" => _("Script content"),
- "gosaApplicationParameter"=> _("Application parameter"),
"exec_for_groupmembers" => _("Only executable for members"), // G
"place_on_desktop" => _("Place icon on members desktop"), // D