summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7170393)
raw | patch | inline | side by side (parent: 7170393)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Sep 2006 04:47:34 +0000 (04:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Sep 2006 04:47:34 +0000 (04:47 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4717 594d385d-05f5-0310-b6e9-bd551577e9d8
index 239e89fc5eea63d5f47a4ce629088f543e2da9d2..72994996b059e6147bc535d7160bd2141d64423d 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
return $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute,$skip_write);
}
+ /* Get all allowed bases to move an object to or to create a new object.
+ Idepartments also contains all base departments which lead to the allowed bases */
+ function acl_get_bases($category = "")
+ {
+ $ui = get_userinfo();
+ $deps = array();
+
+ /* Set category */
+ if(empty($category)){
+ $category = $this->acl_category.get_class($this);
+ }
+
+ /* Is this a new object ? Or just an edited existing object */
+ if(!$this->initially_was_account && $this->is_account){
+ $new = true;
+ }else{
+ $new = false;
+ }
+
+ /* Add current base */
+ if(isset($this->base) && isset($this->config->idepartments[$this->base])){
+ $deps[$this->base] = $this->config->idepartments[$this->base];
+ }else{
+ echo "No default base found. <br>";
+ }
+
+ foreach($this->config->idepartments as $dn => $name){
+ $acl = $ui->get_permissions($dn,$category);
+ if($new && preg_match("/c/",$acl)){
+ $deps[$dn] = $name;
+ }elseif(!$new && preg_match("/m/",$acl)){
+ $deps[$dn] = $name;
+ }
+ }
+ return($deps);
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 21c7de4619e8b865518b9028eb6a6724a3f2be06..68b2ac8f59a1c23d226b214d7cc378c9fbfbc978 100644 (file)
/* Fill templating stuff */
$smarty->assign("cn", $this->cn);
- $smarty->assign("bases", $this->config->idepartments);
+ $smarty->assign("bases", $this->acl_get_bases());
if ($this->dn == "new"){
$smarty->assign("selectmode", "");
$smarty->assign("namemode", "");
foreach($_POST as $name => $value){
if(preg_match("/^chooseBase/",$name) && $once){
$once = false;
- $this->dialog = new baseSelectDialog($this->config,$this);
+ $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
$this->dialog->setCurrentBase($this->base);
}
}
diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc
index 8bda169974fddf5c49e6a1e9c7e87056511de19f..a29b3edc428c0e57137064cd3290e5c38b0b2634 100644 (file)
$smarty->assign($name."ACL",$this->getacl($name));
}
- /* Get bases */
- $ui = get_userinfo();
- $check = $ui->get_module_departments("department");
- $check[] = $this->base;
- $bases = array();
- foreach($check as $dn_allowed){
- $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed];
- }
-
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
if((preg_match("/^chooseBase/",$name) && $once) && ($this->acl_is_moveable())){
$once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$bases);
+ $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
$this->dialog->setCurrentBase($this->base);
}
}
}
/* Hide all departments, that are subtrees of this department */
+ $bases = $this->acl_get_bases();
if(($this->dn == "new")||($this->dn == "")){
$tmp = $bases;
}else{
diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc
index c7c47dd8588b099caf2a953bec0d2bc38e899233..ef5341b243f322cc00803d30007f1eb191ec58e8 100644 (file)
$this->reload();
}
- /* Get bases */
- $ui = get_userinfo();
- $check = $ui->get_module_departments("groups");
- $bases = array();
- foreach($check as $dn_allowed){
- $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed];
- }
-
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
if((preg_match("/^chooseBase/",$name) && $once) && ($this->acl_is_moveable())){
$once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$bases);
+ $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
$this->dialog->setCurrentBase($this->base);
}
}
$smarty->assign("launchimage", get_template_path('images/small_filter.png'));
$smarty->assign("tree_image", get_template_path('images/tree.png'));
- /* Get bases */
- $ui = get_userinfo();
- $check = $ui->get_module_departments("groups");
- $bases = array();
- foreach($check as $dn_allowed){
- $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed];
- }
-
- $smarty->assign("deplist", $bases_user_select);
+ $smarty->assign("deplist", $this->acl_get_bases("users/user"));
$smarty->assign("alphabet", generate_alphabet());
foreach( array("dselect", "regex","SubSearchGroup") as $type){
$smarty->assign("$type", $gufilter[$type]);
$this->base= $_POST['base'];
}
- $smarty->assign("bases", $bases);
+ $smarty->assign("bases", $this->acl_get_bases());
$smarty->assign("base_select", $this->base);
if ($this->samba3){
diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc
index cdadb5be263880255efca9e61257bd7cca4d1afd..37d45ca794e07734f7743737838f3ae7dab85edb 100644 (file)
foreach($_POST as $name => $value){
if(preg_match("/^chooseBase/",$name) && $once){
$once = false;
- $this->dialog = new baseSelectDialog($this->config,$this);
+ $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
echo $this->base;
$this->dialog->setCurrentBase($this->base);
}
$fields = array($field1,$field2);
$DivEApps -> AddEntry($fields);
}
- $smarty->assign("bases", $this->config->idepartments);
+ $smarty->assign("bases", $this->acl_get_bases());
$smarty->assign("base_select", $this->base);
$smarty->assign("isReleaseMimeType", $this->isReleaseMimeType);
$smarty->assign("gotoMimeFilePatterns", $DivPatterns->DrawList());
index 6add554439bbe6f3e92cd7b35abcc6019b525818..f619d71f9a6f3db95db91b4bc7a1ca9045fd8e47 100644 (file)
}
$smarty->assign("baseACL", $baseACL);
-
- /* Get bases */
- $ui = get_userinfo();
- $check = $ui->get_module_departments("ogroups");
- $bases = array();
- foreach($check as $dn_allowed){
- $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed];
- }
-
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){
$once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$bases);
+ $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
$this->dialog->setCurrentBase($this->base);
}
}
}
/* Assign variables */
- $smarty->assign("bases", $bases);
+ $smarty->assign("bases", $this->acl_get_bases());
$smarty->assign("base_select", $this->base);
$smarty->assign("department", $this->department);
$smarty->assign("members", $this->convert_list($this->memberList));
index df0c7c983f189ce66dd6f5803d13a8d48c47f2ee..117b015d90c736c294ce0aa9afe73525443a9ece 100644 (file)
function allowedBasesToMoveTo()
{
/* Get bases */
- $ui = get_userinfo();
- $check = $ui->get_module_departments("ogroups");
- $bases = array();
-
- foreach($check as $dn_allowed){
- $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed];
- }
-
- foreach($bases as $key => $base ){
- $acl = $ui->get_permissions($key,"users/user");
-
- /* Remove those bases, which are not allowed to move to, but keep current base ... */
- if(!preg_match("/m/",$acl) && $key != $this->base){
- unset($bases[$key]);
- }
- }
+ $bases = $this->acl_get_bases();
return($bases);
}
index 729d9d5c15e4b348d9e1f87f87770dced9a624db..ef1fa7c712a26bc20b9c935fb13b809266b84360 100644 (file)
$info = "";
/* Show page footer depending on the mode */
- if (!$user->cert_dialog && !$user->picture_dialog && $user->is_account){
+ if (!$user->cert_dialog && !$user->picture_dialog && !$user->dialog && $user->is_account){
$display.= "<p class=\"plugbottom\">";
/* Are we in edit mode? */