diff --git a/resources/TODO b/resources/TODO index 57a626c315..f3a9722f85 100644 --- a/resources/TODO +++ b/resources/TODO @@ -1,6 +1,3 @@ - -/* $Id: */ - TODO: - configuration dialog for admin section don't use vfs @@ -25,14 +22,10 @@ TODO: add location functionality bug: loose html and picture on tab-switch (eTemplate bug --> Ralf) use eTemplates input validation + if only one cat is present --> chose it + bug: lang() returnmessages to often + make some returnmessages js dialogs - -acl : the acl realy sucks! it was copied from news_admin and persumaly needs to be rewritten... - use of class.db / or even better no dirct access to tables! - use of class.acl - use of class.eTemplate - define admin for each used cat - add right 'direct book' - + ---- if basics are working --> make it scheudable (meeting with ralf) \ No newline at end of file diff --git a/resources/inc/class.bo_acl.inc.php b/resources/inc/class.bo_acl.inc.php index 8a38d0bc74..9290a8d48b 100755 --- a/resources/inc/class.bo_acl.inc.php +++ b/resources/inc/class.bo_acl.inc.php @@ -10,6 +10,8 @@ * -------------------------------------------- * \**************************************************************************/ + /* $Id$ */ + class bo_acl { /*! @var $permissions Holds alls permissions for resources of user */ @@ -69,15 +71,28 @@ */ function get_cats($perm_type) { - foreach($this->permissions as $cat_id => $rights) + $cats = $this->egw_cats->return_sorted_array(0,False,'','','',!$type); + while (list(,$cat) = @each($cats)) { - if(strstr($cat_id,'L') && $rights & $perm_type) + if($this->is_permitted($cat['id'],$perm_type)) { - $cat_id = substr($cat_id,1); - $readcats[$cat_id] = $this->egw_cats->id2name($cat_id); + for ($j=0,$s=''; $j < $cat['level']; $j++) + { + $s .= ' '; + } + $s .= $GLOBALS['phpgw']->strip_html($cat['name']); + if ($cat['app_name'] == 'phpgw') + { + $s .= ' <' . lang('Global') . '>'; + } + if ($cat['owner'] == '-1') + { + $s .= ' <' . lang('Global') . ' ' . lang($cat['app_name']) . '>'; + } + $perm_cats[$cat['id']] = $s; } } - return $readcats; + return $perm_cats; } /*! @@ -116,6 +131,7 @@ return $this->so->get_rights('L'.$cat_id); } + // privat functions from here on ------------------------------------------------------------------------- function save_sessiondata() { diff --git a/resources/templates/default/acl.tpl b/resources/templates/default/acl.tpl index 35de299fe5..8386a5fb24 100755 --- a/resources/templates/default/acl.tpl +++ b/resources/templates/default/acl.tpl @@ -1,5 +1,5 @@
{title} |