summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ffcd03)
raw | patch | inline | side by side (parent: 2ffcd03)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Sep 2006 04:43:32 +0000 (04:43 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Sep 2006 04:43:32 +0000 (04:43 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4612 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/departments/class_departmentGeneric.inc | patch | blob | history | |
plugins/admin/departments/class_divListDepartment.inc | patch | blob | history |
diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc
index 582a9edc2fee58869d7a338815e3c753a2854980..fb3ab679e640bb4fd85c6ae922d01163fe8b9559 100644 (file)
/* Permissions for that base? */
// $this->dn= "ou=$this->ou,".$this->base;
- if ($this->acl_is_createable() && $this->dn != "new"){
+ if ($this->acl_is_createable() && $this->dn == "new"){
$message[]= _("You have no permissions to create a department on this 'Base'.");
}
diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc
index f83a561d11b6afb95852c4a9eb0cde788aa01d15..5bb5c9d6e3f0c3ecfd1207f65d9220dc7324e6c0 100755 (executable)
}
/* Generate list head */
- $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
- " <input type='image' class='center' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='". _("Root")."'> ".
- " <input type='image' class='center' src='images/list_up.png' align='middle' title='"._("Go up one department")."' name='dep_back' alt='"._("Up"). "'> ".
- " <input type='image' class='center' src='images/list_home.png' align='middle' title='"._("Go to users home department")."' name='dep_home' alt='". _("Home")."'> ".
- " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' src='images/list_new_department.png' align='middle' alt='"._("Create new department")."' name='dep_new'> ".
- " <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>".
- " <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
- "</div>";
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions("ou=dummy,",$this->selectedBase ,"department/department");
+
+ $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
+ " <input type='image' class='center' src='images/list_root.png' align='middle' ".
+ " title='"._("Go to root department")."' name='dep_root' alt='". _("Root")."'> ".
+ " <input type='image' class='center' src='images/list_up.png' align='middle' ".
+ " title='"._("Go up one department")."' name='dep_back' alt='"._("Up"). "'> ".
+ " <input type='image' class='center' src='images/list_home.png' align='middle' ".
+ " title='"._("Go to users home department")."' name='dep_home' alt='". _("Home")."'> ".
+ " <input class='center' type='image' src='images/list_reload.png' align='middle' ".
+ " title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ";
+
+ if(preg_match("/c/",$acl)){
+ $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
+ " <input class='center' type='image' src='images/list_new_department.png' ".
+ " align='middle' alt='"._("Create new department")."' name='dep_new'> ";
+ }
+
+
+ $listhead .= " <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>".
+ " <input class='center' type='image' src='images/list_submit.png' align='middle' ".
+ " title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
+ "</div>";
$this->SetListHeader($listhead);
}
function setEntries($list)
{
- $actions= "<input class='center' type='image' src='images/edit.png'
- alt='"._("edit")."' name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
- $actions.= "<input class='center' type='image' src='images/edittrash.png'
- alt='"._("delete")."' name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
-
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
+ $ui = get_userinfo();
foreach($list as $key => $val) {
+
+ $actions= "";
+
+ $acl = $ui->get_permissions($this->config->departments[$key] ,"department/department");
+ if(preg_match("/r/",$acl)){
+ $actions.= "<input class='center' type='image' src='images/edit.png'
+ alt='"._("edit")."' name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
+ }
+
+ if(preg_match("/c/",$acl)){
+ $actions.= "<input class='center' type='image' src='images/edittrash.png'
+ alt='"._("delete")."' name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
+ }
+
if(!isset($this->config->departments[trim($key)])){
$this->config->departments[trim($key)]="";
}