summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d426ec0)
raw | patch | inline | side by side (parent: d426ec0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Sep 2006 03:28:01 +0000 (03:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Sep 2006 03:28:01 +0000 (03:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4618 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc
index 2fd85ecb3cd627485b77ad8b819b843319bbb680..da7850468fe0c8e31c25cb70be7881352c9d9e4e 100755 (executable)
/* Create listhead, it will be shown on top of the divlist.
* It provides general navigation and object creation
*/
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype");
+
$listhead = "<div style='background:#F0F0F9;padding:5px;'>".
" <input class='center' type='image' src='images/list_root.png' align='middle' ".
"title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
"title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
$listhead .= $this->get_snapshot_header($this->selectedBase);
- $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_mime.png' alt='"._("new").
- "' title='"._("Create new mime type")."' name='mime_new'> ".
+
+ if(preg_match("/c/",$acl)){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_mime.png' alt='"._("new").
+ "' title='"._("Create new mime type")."' name='mime_new'> ";
+ }
+
+ $listhead .=
$Copy_Paste.
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
_("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
Attach objects
********************/
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype");
+
+ print_a($list);
foreach($list as $key => $val){
/* Create action icons */
$actions = $this->GetSnapShotActions($val['dn']);
+
+
+ /* Get copy Paste icons */
if($this->parent->CopyPasteHandler){
- $actions.= "<input class='center' type='image'
- src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+
+ /* Only add cut icon, if we are allowed to move this user */
+ if(preg_match("/m/",$acl)){
+ $actions.= "<input class='center' type='image'
+ src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ }else{
+ $actions.= "<img src='images/empty.png' alt=' '>";
+ }
+
+ /* Copy is allowed everytime */
$actions.= "<input class='center' type='image'
src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}
+
+ /* Add edit button */
$actions.= "<input class='center' type='image'
src='images/edit.png' alt='"._("edit")."' name='mime_edit_%KEY%' title='"._("Edit this entry")."'>";
- $actions.= "<input class='center' type='image'
- src='images/edittrash.png' alt='"._("delete")."' name='mime_del_%KEY%' title='"._("Delete this entry")."'>";
+
+ /* Add delete button */
+ if(preg_match("/d/",$acl)){
+ $actions.= "<input class='center' type='image'
+ src='images/edittrash.png' alt='"._("delete")."' name='mime_del_%KEY%' title='"._("Delete this entry")."'>";
+ }else{
+ $actions.= "<img src='images/empty.png' alt=' '>";
+ }
$title = "title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'";
$field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
$this->AddElement(array($field1,$field2,$field3));
}
-
}
function Save()
diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc
index f5d7f3ae10c4b04a774c890aa372488fea9d00d3..f200bca2650920c6a1669f73ab33c576892f773e 100644 (file)
"gotoMimeGroup");
/* Class vars */
- var $acl;
var $ui;
var $cn = "";
var $gotoMimeLeftClickAction = "I";
{
$smarty = get_smarty();
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation){
+ $smarty->assign($name."ACL",$this->getacl($name));
+ }
+
+ /* Assign base ACL */
+ $baseACL = $this->getacl("base");
+ if(!$this->acl_is_moveable()) {
+ $baseACL = preg_replace("/w/","",$baseACL);
+ }
+ $smarty->assign("baseACL", $baseACL);
+
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
/* Execute a command with the given attribute and entry
e.g. $this->gotoMimeFilePattern = $this->ArrayUp(3,$this->gotoMimeFilePattern) */
- if(chkacl($this->acl,$attr) == ""){
+ if($this->acl_is_writeable($attr)){
$this->$attr= $this->$func($s_entry,$this->$attr,true);
}
}
/* Add gotoMimeFilePattern */
if(isset($_POST['AddNewFilePattern']) && isset($_POST['NewFilePattern'])){
- if(chkacl($this->acl,"gotoMimeFilePattern") == ""){
+ if($this->acl_is_writeable("gotoMimeFilePattern")){
$str = $_POST['NewFilePattern'];
if(!empty($str)){
$this->use_gotoMimeFilePattern[] = $str;
/* Add gotoMimeFilePattern */
if(isset($_POST['AddNewApplication']) && isset($_POST['NewApplication'])){
- if(chkacl($this->acl,"gotoMimeApplication") == ""){
+ if($this->acl_is_writeable("gotoMimeApplication")){
$str = $_POST['NewApplication'];
if(!empty($str)){
$this->use_gotoMimeApplication[] = $str;
/* Add gotoMimeFilePattern */
if(isset($_POST['AddNewEmbeddedApplication']) && isset($_POST['NewEmbeddedApplication'])){
- if(chkacl($this->acl,"gotoMimeEmbeddedApplication") == ""){
+ if($this->acl_is_writeable("gotoMimeEmbeddedApplication")){
$str = $_POST['NewEmbeddedApplication'];
if(!empty($str)){
$this->use_gotoMimeEmbeddedApplication[] = $str;
$DivEApps -> SetHeight(100);
- if(chkacl($this->acl,"gotoMimeFilePattern") == ""){
+ if($this->acl_is_writeable("gotoMimeFilePattern")){
$Pattern_Actions= " <input type='image' src='images/sort_up.png' class='center' name='Pattern_SortUp_%s' >
<input type='image' src='images/sort_down.png' class='center' name='Pattern_SortDown_%s'>
<input type='image' src='images/edittrash.png' class='center' name='Pattern_Remove_%s'>";
$Pattern_Actions= "";
}
- if(chkacl($this->acl,"gotoMimeApplication") == ""){
+ if($this->acl_is_writeable("gotoMimeApplication")){
$Apps_Actions = " <input type='image' src='images/sort_up.png' class='center' name='Apps_SortUp_%s' >
<input type='image' src='images/sort_down.png' class='center' name='Apps_SortDown_%s'>
<input type='image' src='images/edittrash.png' class='center' name='Apps_Remove_%s'>";
$Apps_Actions= "";
}
- if(chkacl($this->acl,"gotoMimeEmbeddedApplication") == ""){
+ if($this->acl_is_writeable("gotoMimeEmbeddedApplication")){
$EApps_Actions = " <input type='image' src='images/sort_up.png' class='center' name='EApps_SortUp_%s' >
<input type='image' src='images/sort_down.png' class='center' name='EApps_SortDown_%s'>
<input type='image' src='images/edittrash.png' class='center' name='EApps_Remove_%s'>";
$fields = array($field1,$field2);
$DivEApps -> AddEntry($fields);
}
- $smarty->assign("baseACL", chkacl($this->acl,"base"));
$smarty->assign("bases", $this->config->idepartments);
$smarty->assign("base_select", $this->base);
$smarty->assign("isReleaseMimeType", $this->isReleaseMimeType);
/* Assign class vars to smarty */
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
}
/* Assign additional vars that are not included in attributes*/
{
if(isset($_POST['MimeGeneric'])){
plugin::save_object();
-
+
+ print_a($this);
+
/* Only save base if we are not in release mode */
if(!$this->isReleaseMimeType){
if(isset($_POST['base'])){
}
/* Save radio buttons */
- if(chkacl($this->acl,"gotoMimeLeftClickAction")== ""){
+ if($this->acl_is_writeable("gotoMimeLeftClickAction")){
if(isset($_POST['gotoMimeLeftClickAction_IE'])){
$chr = $_POST['gotoMimeLeftClickAction_IE'];
if($chr == "E"){
} else {
$new_dn= $this->dn;
}
- if (chkacl($this->acl, "create") != ""){
+ if (!$this->acl_is_createable() && $this->dn == "new"){
$message[]= _("You have no permissions to create a mime type on this 'Base'.");
}
diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc
index a4da4d430fb733be84339de8230e682380f997b0..c18cae801722f1206d8f4b7d6310ee231423cc03 100755 (executable)
var $enableReleaseManagement = false;
var $mimetabs = NULL;
var $snapDialog = NULL;
- var $acl = NULL;
var $CopyPasteHandler = NULL;
function mimetypeManagement ($config, $ui)
$this->DivListMimeTypes->DisableCheckBox("SubSearch");
}
- /* Get acls */
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $this->acl= get_module_permission($acl, "mimetype", $ui->dn);
}
$this->dn= "new";
/* Create new usertab object */
- $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn);
-
- /* set acl */
- $acl= get_permissions ($this->DivListMimeTypes->selectedBase, $this->ui->subtreeACL);
- $this->mimetabs->set_acl($acl);
- }
+ $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes/mimetype");
+ $this->mimetabs->set_acl_base($this->DivListMimeTypes->selectedBase);
+ }
/****************
/* Register mimetabs to trigger edit dialog */
- $this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn);
-
- /* Set up the users ACL's for this 'dn' */
- $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
- $this->mimetabs->set_acl($acl);
+ $this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes/mimetype");
+ $this->mimetabs->set_acl_base($this->dn);
$_SESSION['objectinfo']= $this->dn;
}
/* Load permissions for selected 'dn' and check if
we're allowed to remove this 'dn' */
- if (chkacl($this->acl, "delete") == ""){
+ if ($this->acl_is_removeable()){
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
/* Some nice guy may send this as POST, so we've to check
for the permissions again. */
- if (chkacl($this->acl, "delete") == ""){
+ if ($this->acl_is_removeable()){
/* Delete request is permitted, perform LDAP action */
- $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn);
- $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
- $this->mimetabs->set_acl($acl);
+ $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes/mimetype");
+ $this->mimetabs->set_acl_base($this->dn);
$this->mimetabs->delete ();
gosa_log ("Mime type object'".$this->dn."' has been removed");
unset ($this->mimetabs);
/* Get results and create index */
$res= get_list($Filter, "mimetypes", $use_base, array("cn","description","dn","objectClass"), $Flags);
+ echo $Filter;
+ print_a(array($res));
foreach ($res as $val){
$tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
}
diff --git a/plugins/admin/mimetypes/tabs_mimetypes.inc b/plugins/admin/mimetypes/tabs_mimetypes.inc
index 57026421c3577fb10533a25a8fd8521edfe880c2..4d09f39f25b88b17be2ff96cb9dd15a84fad1233 100755 (executable)
{
var $Release= "";
- function mimetabs($config, $data, $dn)
+ function mimetabs($config, $data, $dn,$category)
{
- tabs::tabs($config, $data, $dn);
+ tabs::tabs($config, $data, $dn,$category);
/* Add references/acls/snapshots */
$this->addSpecialTabs();