GitHub PullRequestReviewCommentEvent at 2014-04-15 16:01:10
Repository: pkp-lib
Actor: asmecher
Payload: {"comment":{"url":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/11641811","id":11641811,"diff_hunk":"@@ -317,6 +317,77 @@ function savePassword($args, $request) {\n \t}\n \n \t/**\n+\t * Sign in as another user.\n+\t * @param $args array ($userId)\n+\t * @param $request PKPRequest\n+\t */\n+\tfunction signInAsUser($args, $request) {\n+\t\t$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_MANAGER)));\n+\t\t$this->validate();\n+\n+\t\tif (isset($args[0]) && !empty($args[0])) {\n+\t\t\t$userId = (int)$args[0];\n+\t\t\t$session = $request->getSession();\n+\n+\t\t\tif (!Validation::canAdminister($userId, $session->getUserId())) {\n+\t\t\t\t$this->setupTemplate($request);\n+\t\t\t\t// We don't have administrative rights\n+\t\t\t\t// over this user. Display an error.\n+\t\t\t\t$templateMgr = TemplateManager::getManager($request);\n+\t\t\t\t$templateMgr->assign('pageTitle', 'manager.people');\n+\t\t\t\t$templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');\n+\t\t\t\t$templateMgr->assign('backLink', $request->url(null, null, 'people', 'all'));\n+\t\t\t\t$templateMgr->assign('backLinkLabel', 'manager.people.allUsers');\n+\t\t\t\treturn $templateMgr->display('common/error.tpl');\n+\t\t\t}\n+\n+\t\t\t$userDao = DAORegistry::getDAO('UserDAO');\n+\t\t\t$newUser = $userDao->getById($userId);\n+\n+\t\t\t// FIXME Support \"stack\" of signed-in-as user IDs?","path":"pages/login/PKPLoginHandler.inc.php","position":31,"original_position":31,"commit_id":"552f43662beadc65377fa14a9ef815cf2b2f5b40","original_commit_id":"552f43662beadc65377fa14a9ef815cf2b2f5b40","user":{"login":"asmecher","id":200411,"avatar_url":"https://avatars.githubusercontent.com/u/200411?","gravatar_id":"871f5455b4630e874f5f5052cafd7319","url":"https://api.github.com/users/asmecher","html_url":"https://github.com/asmecher","followers_url":"https://api.github.com/users/asmecher/followers","following_url":"https://api.github.com/users/asmecher/following{/other_user}","gists_url":"https://api.github.com/users/asmecher/gists{/gist_id}","starred_url":"https://api.github.com/users/asmecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmecher/subscriptions","organizations_url":"https://api.github.com/users/asmecher/orgs","repos_url":"https://api.github.com/users/asmecher/repos","events_url":"https://api.github.com/users/asmecher/events{/privacy}","received_events_url":"https://api.github.com/users/asmecher/received_events","type":"User","site_admin":false},"body":"If you're making changes to this pull request, please remove this FIXME. It's been there for about a decade and nobody has ever asked for that feature. And I think it's a bad idea.","created_at":"2014-04-15T16:01:10Z","updated_at":"2014-04-15T16:01:10Z","html_url":"https://github.com/pkp/pkp-lib/pull/78#discussion_r11641811","pull_request_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/11641811"},"html":{"href":"https://github.com/pkp/pkp-lib/pull/78#discussion_r11641811"},"pull_request":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/78"}}}}