openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0b197c59f564e398724ca0a0516777fd34ebd32e
parent 4f7c2e5cba1ca4bc661d81acbbde96abad927d27
Author: dankert <devnull@localhost>
Date:   Fri, 30 Apr 2004 22:31:47 +0200

Berechtigungen anzeigen

Diffstat:
actionClasses/LinkAction.class.php | 50++++++++++++++++++++++++++++++++++++++------------
actionClasses/PageAction.class.php | 43+++++++++++++++++++++++++++++--------------
2 files changed, 67 insertions(+), 26 deletions(-)

diff --git a/actionClasses/LinkAction.class.php b/actionClasses/LinkAction.class.php @@ -20,7 +20,10 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // --------------------------------------------------------------------------- // $Log$ -// Revision 1.1 2004-04-24 15:14:52 dankert +// Revision 1.2 2004-04-30 20:31:47 dankert +// Berechtigungen anzeigen +// +// Revision 1.1 2004/04/24 15:14:52 dankert // Initiale Version // // --------------------------------------------------------------------------- @@ -58,6 +61,14 @@ class LinkAction extends Action } + function addACL() + { + $this->objectAddACL(); + + $this->callSubAction('rights'); + } + + function delACL() { $this->objectDelACL(); @@ -189,24 +200,39 @@ class LinkAction extends Action function rights() { - $acl = new Acl(); - $acl->objectid = $this->link->objectid; + global $SESS; + global $conf_php; + if ($SESS['user']['is_admin'] != '1') die('nice try'); - $var['access_acls'] = array(); + $acllist = array(); + foreach( $this->link->getAllInheritedAclIds() as $aclid ) + { + $acl = new Acl( $aclid ); + $acl->load(); + $key = 'au'.$acl->username.'g'.$acl->groupname.'a'.$aclid; + $acllist[$key] = $acl->getProperties(); + } - foreach( $acl->getAccessACLsFromObject() as $id ) + foreach( $this->link->getAllAclIds() as $aclid ) { - $acl = new Acl( $id ); + $acl = new Acl( $aclid ); $acl->load(); - $var['access_acls'][$id] = $acl->getProperties(); - $var['access_acls'][$id]['delete_url'] = 'folder.'.$conf_php.'?folderaction=delACL&aclid='.$id; + $key = 'bu'.$acl->username.'g'.$acl->groupname.'a'.$aclid; + $acllist[$key] = $acl->getProperties(); + $acllist[$key]['delete_url'] = Html::url(array('subaction'=>'delACL','aclid'=>$aclid)); } + ksort( $acllist ); + + $this->setTemplateVar('acls',$acllist ); + + $this->setTemplateVar('users' ,User::listAll() ); + $this->setTemplateVar('groups' ,Group::getAll() ); - $var['users'] = User::listAll(); - $var['groups'] = Group::getAll(); - $var['languages'] = Language::getAll(); + $languages = Language::getAll(); + $languages[0] = lang('ALL_LANGUAGES'); + $this->setTemplateVar('languages',$languages); - $this->forward('link_rights'); + $this->forward('link_rights'); } } \ No newline at end of file diff --git a/actionClasses/PageAction.class.php b/actionClasses/PageAction.class.php @@ -20,7 +20,10 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // --------------------------------------------------------------------------- // $Log$ -// Revision 1.3 2004-04-25 19:01:02 dankert +// Revision 1.4 2004-04-30 20:31:47 dankert +// Berechtigungen anzeigen +// +// Revision 1.3 2004/04/25 19:01:02 dankert // Speichern von Elementen, die in allen Sprachen gleich sind // // Revision 1.2 2004/04/24 16:55:27 dankert @@ -60,9 +63,9 @@ class PageAction extends Action } - function addAccessACL() + function addACL() { - $this->objectAddAccessACL(); + $this->objectAddACL(); $this->callSubAction('rights'); } @@ -291,26 +294,38 @@ class PageAction extends Action function rights() { global $SESS; + global $conf_php; if ($SESS['user']['is_admin'] != '1') die('nice try'); - - $acl = new Acl(); - $acl->objectid = $this->page->objectid; - $var['access_acls'] = array(); + $acllist = array(); + foreach( $this->page->getAllInheritedAclIds() as $aclid ) + { + $acl = new Acl( $aclid ); + $acl->load(); + $key = 'au'.$acl->username.'g'.$acl->groupname.'a'.$aclid; + $acllist[$key] = $acl->getProperties(); + } - foreach( $acl->getAccessACLsFromObject() as $id ) + foreach( $this->page->getAllAclIds() as $aclid ) { - $acl = new Acl( $id ); + $acl = new Acl( $aclid ); $acl->load(); - $var['access_acls'][$id] = $acl->getProperties(); - $var['access_acls'][$id]['delete_url'] = '?pageaction=delACL&aclid='.$id; + $key = 'bu'.$acl->username.'g'.$acl->groupname.'a'.$aclid; + $acllist[$key] = $acl->getProperties(); + $acllist[$key]['delete_url'] = Html::url(array('subaction'=>'delACL','aclid'=>$aclid)); } + ksort( $acllist ); + + $this->setTemplateVar('acls',$acllist ); - $var['users'] = User::listAll(); - $var['groups'] = Group::getAll(); + $this->setTemplateVar('users' ,User::listAll() ); + $this->setTemplateVar('groups' ,Group::getAll() ); + + $languages = Language::getAll(); + $languages[0] = lang('ALL_LANGUAGES'); + $this->setTemplateVar('languages',$languages); $this->forward('page_rights'); - } }