summaryrefslogtreecommitdiff
path: root/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin.php')
-rw-r--r--admin.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/admin.php b/admin.php
index c5563f6..d72d4a0 100644
--- a/admin.php
+++ b/admin.php
@@ -18,7 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
require_once('header.inc.php');
-
+
+/* Service creation: only useful services are created */
$userservice = & ServiceFactory :: getServiceInstance('UserService');
$bookmark2tagservice = & ServiceFactory :: getServiceInstance('Bookmark2Tagservice');
$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
@@ -27,19 +28,21 @@ $templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
// Header variables
$tplVars['subtitle'] = T_('Manage users');
-$tplVars['loadjs'] = true;
+$tplVars['loadjs'] = true;
+$tplVars['sidebar_blocks'] = array('users' );
if ( !$userservice->isLoggedOn() ) {
header('Location: '. createURL('login', ''));
exit();
}
-$currentUser = $userservice->getCurrentUser();
-$currentUserID = $userservice->getCurrentUserId();
-$currentUsername = $currentUser[$userservice->getFieldName('username')];
+//$currentUser = $userservice->getCurrentUser();
+//$currentUserID = $userservice->getCurrentUserId();
+//$currentUsername = $currentUser[$userservice->getFieldName('username')];
+$currentObjectUser = $userservice->getCurrentObjectUser();
-if ( !$userservice->isAdmin($currentUserID) ) {
- header('Location: '. createURL('bookmarks', $currentUsername));
+if ( !$currentObjectUser->isAdmin() ) {
+ header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
exit();
}
@@ -66,7 +69,7 @@ if ( $action ) {
}
$templatename = 'userlist.tpl';
-$users =& $userservice->getAllUsers();
+$users =& $userservice->getObjectUsers();
if ( !is_array($users) ) {
$users = array();