From 75584d79c20b1dd944d4a78150ab36d7b27e806e Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 19 Jul 2006 06:30:02 +0000 Subject: [PATCH] Added shortcut to acls Added is_moveable acl to user generic git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4216 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 7 +++++++ plugins/personal/generic/class_user.inc | 21 +++++++++++++-------- plugins/personal/generic/generic.tpl | 8 ++------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 18b8867f4..3f2a2160a 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -1432,6 +1432,13 @@ echo "FIXME: remove_snapshot uses old acl's
"; $ui= get_userinfo(); return preg_match('/m/', $ui->get_permissions($this->dn, get_class($this), '0')); } + + + function getacl($attribute) + { + $ui= get_userinfo(); + return $ui->get_permissions($this->dn, get_class($this), $attribute)); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 5a8964902..40f817649 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -480,17 +480,22 @@ class user extends plugin $ui =get_userinfo(); foreach($this->attributes as $val){ $smarty->assign("$val", $this->$val); - $smarty->assign("$val"."ACL", $ui->get_permissions($this->dn, "user", $val)); + $smarty->assign("$val"."ACL", $this->getacl($val)); } $smarty->assign("pwmode", $hashes); $smarty->assign("pwmode_select", $this->pw_storage); - $smarty->assign("passwordStorageACL", $ui->get_permissions($this->dn,"user", "userPassword")); + $smarty->assign("passwordStorageACL", $this->getacl("userPassword")); $smarty->assign("base_select", $this->base); - $smarty->assign("baseACL", $ui->get_permissions($this->dn,"user", "base")); - $smarty->assign("selectmode", $ui->get_permissions($this->dn,"user", "create")); - $smarty->assign("CertificatesACL", $ui->get_permissions($this->dn,"user", "Certificate")); - $smarty->assign("userPictureACL", $ui->get_permissions($this->dn,"user", "userPicture")); + $smarty->assign("CertificatesACL", $this->getacl("Certificate")); + $smarty->assign("userPictureACL", $this->getacl("userPicture")); + + /* Create base acls */ + $baseACL = $this->("base"); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); /* Show us the edit screen */ @$smarty->assign("bases", $this->allowedBasesToMoveTo()); @@ -506,14 +511,14 @@ class user extends plugin $smarty->assign("ivbbmodes", $ivbbmodes); foreach ($this->govattrs as $val){ $smarty->assign("$val", $this->$val); - $smarty->assign("$val"."ACL", $ui->get_permissions($this->dn,"user",$val)); + $smarty->assign("$val"."ACL", $this->getacl($val)); } } else { $smarty->assign("governmentmode", "false"); } /* Special mode for uid */ - $uidACL= $ui->get_permissions($this->dn,"user", "uid"); + $uidACL= $this->getacl("uid"); if (isset ($this->dn)){ if ($this->dn != "new"){ $uidACL= preg_replace("/w/","",$uidACL); diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index bac5756b1..a1f4b9e63 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -143,14 +143,10 @@
{render acl=$baseACL} - {html_options options=$bases selected=$base_select} - {if $selectmode==""} - - {else} - - {/if} + {/render} -- 2.30.2