getCurrentObjectUser(); // Header variables $tplVars['subtitle'] = T_('Manage users'); $tplVars['loadjs'] = true; $tplVars['sidebar_blocks'] = array('users' ); if ( !$userservice->isLoggedOn() ) { header('Location: '. createURL('login', '')); exit(); } if ( !$currentUser->isAdmin() ) { header('Location: '. createURL('bookmarks', $currentUser->getUsername())); exit(); } @list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL; if ( $action && strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0 // Prevent CSRF attacks ) { switch ( $action ) { case 'delete': if ( $user && ($userinfo = $userservice->getUserByUsername($user)) ) { $uId = $userinfo['uId']; $tag2tagservice->removeLinkedTags('','','',$uId); $userservice->deleteUser($uId); $bookmark2tagservice->deleteTagsForUser($uId); // XXX: don't delete bookmarks before tags, else tags can't be deleted !!! $bookmarkservice->deleteBookmarksForUser($uId); $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user); } break; case 'checkUrl' : $tplVars['msg'] = checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille"; break; default: // DO NOTHING } } $templatename = 'userlist.tpl'; $users =& $userservice->getObjectUsers(); if ( !is_array($users) ) { $users = array(); } $tplVars['users'] =& $users; $templateservice->loadTemplate($templatename, $tplVars); ?>