{"action":"created","comment":{"url":"https://api.github.com/repos/codex-team/codex.edu/pulls/comments/48473659","id":48473659,"diff_hunk":"@@ -3,40 +3,42 @@\n class Controller_User extends Controller_Base_preDispatch\n {\n \n-    const USER_STATUS_ADMIN     = 2;\n-    const USER_STATUS_TEACHER   = 1;\n-    const USER_STATUS_STUDENT   = 0;\n-    const USER_STATUS_BANNED    = -1;\n-\n-\n     public function action_profile()\n     {\n-        $uid = $this->request->param('id');\n-        $act = Arr::get($_GET, 'act');\n+        $user_id = $this->request->param('id');\n \n-        $this->view['success'] = FALSE;\n+        $act = Arr::get($_GET, 'newStatus');\n \n-        $viewUser = new Model_User($uid);\n+        $viewUser = new Model_User($user_id);\n \n-        switch ($act) {\n-            case 'rise'    :\n-                $this->view['success'] = $viewUser->setUserStatus(self::USER_STATUS_TEACHER);\n-                break;\n-            case 'ban'     :\n-                $this->view['success'] = $viewUser->setUserStatus(self::USER_STATUS_BANNED);\n-                break;\n-            case 'degrade' :\n-            case 'unban'   :\n-                $this->view['success'] = $viewUser->setUserStatus(self::USER_STATUS_BANNED);\n-                break;\n+        if ($this->user->isAdmin && $act) {\n+            $success = self::set_user_status($viewUser, $act);","path":"application/classes/Controller/User.php","position":34,"original_position":34,"commit_id":"1cf1aead5aa7e7b4f8e8d9b2610527ebb4fd3299","original_commit_id":"1cf1aead5aa7e7b4f8e8d9b2610527ebb4fd3299","user":{"login":"neSpecc","id":3684889,"avatar_url":"https://avatars.githubusercontent.com/u/3684889?v=3","gravatar_id":"","url":"https://api.github.com/users/neSpecc","html_url":"https://github.com/neSpecc","followers_url":"https://api.github.com/users/neSpecc/followers","following_url":"https://api.github.com/users/neSpecc/following{/other_user}","gists_url":"https://api.github.com/users/neSpecc/gists{/gist_id}","starred_url":"https://api.github.com/users/neSpecc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neSpecc/subscriptions","organizations_url":"https://api.github.com/users/neSpecc/orgs","repos_url":"https://api.github.com/users/neSpecc/repos","events_url":"https://api.github.com/users/neSpecc/events{/privacy}","received_events_url":"https://api.github.com/users/neSpecc/received_events","type":"User","site_admin":false},"body":"почему сразу тут не назначить $this->view['success'] ","created_at":"2015-12-28T10:56:52Z","updated_at":"2015-12-28T10:56:52Z","html_url":"https://github.com/codex-team/codex.edu/pull/24#discussion_r48473659","pull_request_url":"https://api.github.com/repos/codex-team/codex.edu/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/comments/48473659"},"html":{"href":"https://github.com/codex-team/codex.edu/pull/24#discussion_r48473659"},"pull_request":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/codex-team/codex.edu/pulls/24","id":54370571,"html_url":"https://github.com/codex-team/codex.edu/pull/24","diff_url":"https://github.com/codex-team/codex.edu/pull/24.diff","patch_url":"https://github.com/codex-team/codex.edu/pull/24.patch","issue_url":"https://api.github.com/repos/codex-team/codex.edu/issues/24","number":24,"state":"open","locked":false,"title":"Form for pages","user":{"login":"illiiiillllilii","id":15259299,"avatar_url":"https://avatars.githubusercontent.com/u/15259299?v=3","gravatar_id":"","url":"https://api.github.com/users/illiiiillllilii","html_url":"https://github.com/illiiiillllilii","followers_url":"https://api.github.com/users/illiiiillllilii/followers","following_url":"https://api.github.com/users/illiiiillllilii/following{/other_user}","gists_url":"https://api.github.com/users/illiiiillllilii/gists{/gist_id}","starred_url":"https://api.github.com/users/illiiiillllilii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illiiiillllilii/subscriptions","organizations_url":"https://api.github.com/users/illiiiillllilii/orgs","repos_url":"https://api.github.com/users/illiiiillllilii/repos","events_url":"https://api.github.com/users/illiiiillllilii/events{/privacy}","received_events_url":"https://api.github.com/users/illiiiillllilii/received_events","type":"User","site_admin":false},"body":"issue #22\r\n\r\nПодзадачи\r\n- [x] перейти на дао\r\n- [x] добавить кэширование\r\n\r\nРевьюверы\r\n- [ ] @neSpecc \r\n- [ ] @eliseealex \r\n- [ ] @ivanszhuravlev ","created_at":"2015-12-22T13:41:45Z","updated_at":"2015-12-28T10:56:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1118fb048422ff4b8724e0e9a6f3dce0f091eea0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codex-team/codex.edu/pulls/24/commits","review_comments_url":"https://api.github.com/repos/codex-team/codex.edu/pulls/24/comments","review_comment_url":"https://api.github.com/repos/codex-team/codex.edu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codex-team/codex.edu/issues/24/comments","statuses_url":"https://api.github.com/repos/codex-team/codex.edu/statuses/1cf1aead5aa7e7b4f8e8d9b2610527ebb4fd3299","head":{"label":"codex-team:form_for_pages","ref":"form_for_pages","sha":"1cf1aead5aa7e7b4f8e8d9b2610527ebb4fd3299","user":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"repo":{"id":46662693,"name":"codex.edu","full_name":"codex-team/codex.edu","owner":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codex-team/codex.edu","description":"Project «Codex Education»","fork":false,"url":"https://api.github.com/repos/codex-team/codex.edu","forks_url":"https://api.github.com/repos/codex-team/codex.edu/forks","keys_url":"https://api.github.com/repos/codex-team/codex.edu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codex-team/codex.edu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codex-team/codex.edu/teams","hooks_url":"https://api.github.com/repos/codex-team/codex.edu/hooks","issue_events_url":"https://api.github.com/repos/codex-team/codex.edu/issues/events{/number}","events_url":"https://api.github.com/repos/codex-team/codex.edu/events","assignees_url":"https://api.github.com/repos/codex-team/codex.edu/assignees{/user}","branches_url":"https://api.github.com/repos/codex-team/codex.edu/branches{/branch}","tags_url":"https://api.github.com/repos/codex-team/codex.edu/tags","blobs_url":"https://api.github.com/repos/codex-team/codex.edu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codex-team/codex.edu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codex-team/codex.edu/git/refs{/sha}","trees_url":"https://api.github.com/repos/codex-team/codex.edu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codex-team/codex.edu/statuses/{sha}","languages_url":"https://api.github.com/repos/codex-team/codex.edu/languages","stargazers_url":"https://api.github.com/repos/codex-team/codex.edu/stargazers","contributors_url":"https://api.github.com/repos/codex-team/codex.edu/contributors","subscribers_url":"https://api.github.com/repos/codex-team/codex.edu/subscribers","subscription_url":"https://api.github.com/repos/codex-team/codex.edu/subscription","commits_url":"https://api.github.com/repos/codex-team/codex.edu/commits{/sha}","git_commits_url":"https://api.github.com/repos/codex-team/codex.edu/git/commits{/sha}","comments_url":"https://api.github.com/repos/codex-team/codex.edu/comments{/number}","issue_comment_url":"https://api.github.com/repos/codex-team/codex.edu/issues/comments{/number}","contents_url":"https://api.github.com/repos/codex-team/codex.edu/contents/{+path}","compare_url":"https://api.github.com/repos/codex-team/codex.edu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codex-team/codex.edu/merges","archive_url":"https://api.github.com/repos/codex-team/codex.edu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codex-team/codex.edu/downloads","issues_url":"https://api.github.com/repos/codex-team/codex.edu/issues{/number}","pulls_url":"https://api.github.com/repos/codex-team/codex.edu/pulls{/number}","milestones_url":"https://api.github.com/repos/codex-team/codex.edu/milestones{/number}","notifications_url":"https://api.github.com/repos/codex-team/codex.edu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codex-team/codex.edu/labels{/name}","releases_url":"https://api.github.com/repos/codex-team/codex.edu/releases{/id}","created_at":"2015-11-22T13:51:50Z","updated_at":"2015-12-19T23:42:34Z","pushed_at":"2015-12-27T23:01:53Z","git_url":"git://github.com/codex-team/codex.edu.git","ssh_url":"git@github.com:codex-team/codex.edu.git","clone_url":"https://github.com/codex-team/codex.edu.git","svn_url":"https://github.com/codex-team/codex.edu","homepage":null,"size":5090,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":1,"default_branch":"master"}},"base":{"label":"codex-team:master","ref":"master","sha":"0a1ca7dbae2175d84b7eec001ab890443a9827ad","user":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"repo":{"id":46662693,"name":"codex.edu","full_name":"codex-team/codex.edu","owner":{"login":"codex-team","id":16060815,"avatar_url":"https://avatars.githubusercontent.com/u/16060815?v=3","gravatar_id":"","url":"https://api.github.com/users/codex-team","html_url":"https://github.com/codex-team","followers_url":"https://api.github.com/users/codex-team/followers","following_url":"https://api.github.com/users/codex-team/following{/other_user}","gists_url":"https://api.github.com/users/codex-team/gists{/gist_id}","starred_url":"https://api.github.com/users/codex-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codex-team/subscriptions","organizations_url":"https://api.github.com/users/codex-team/orgs","repos_url":"https://api.github.com/users/codex-team/repos","events_url":"https://api.github.com/users/codex-team/events{/privacy}","received_events_url":"https://api.github.com/users/codex-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codex-team/codex.edu","description":"Project «Codex Education»","fork":false,"url":"https://api.github.com/repos/codex-team/codex.edu","forks_url":"https://api.github.com/repos/codex-team/codex.edu/forks","keys_url":"https://api.github.com/repos/codex-team/codex.edu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codex-team/codex.edu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codex-team/codex.edu/teams","hooks_url":"https://api.github.com/repos/codex-team/codex.edu/hooks","issue_events_url":"https://api.github.com/repos/codex-team/codex.edu/issues/events{/number}","events_url":"https://api.github.com/repos/codex-team/codex.edu/events","assignees_url":"https://api.github.com/repos/codex-team/codex.edu/assignees{/user}","branches_url":"https://api.github.com/repos/codex-team/codex.edu/branches{/branch}","tags_url":"https://api.github.com/repos/codex-team/codex.edu/tags","blobs_url":"https://api.github.com/repos/codex-team/codex.edu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codex-team/codex.edu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codex-team/codex.edu/git/refs{/sha}","trees_url":"https://api.github.com/repos/codex-team/codex.edu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codex-team/codex.edu/statuses/{sha}","languages_url":"https://api.github.com/repos/codex-team/codex.edu/languages","stargazers_url":"https://api.github.com/repos/codex-team/codex.edu/stargazers","contributors_url":"https://api.github.com/repos/codex-team/codex.edu/contributors","subscribers_url":"https://api.github.com/repos/codex-team/codex.edu/subscribers","subscription_url":"https://api.github.com/repos/codex-team/codex.edu/subscription","commits_url":"https://api.github.com/repos/codex-team/codex.edu/commits{/sha}","git_commits_url":"https://api.github.com/repos/codex-team/codex.edu/git/commits{/sha}","comments_url":"https://api.github.com/repos/codex-team/codex.edu/comments{/number}","issue_comment_url":"https://api.github.com/repos/codex-team/codex.edu/issues/comments{/number}","contents_url":"https://api.github.com/repos/codex-team/codex.edu/contents/{+path}","compare_url":"https://api.github.com/repos/codex-team/codex.edu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codex-team/codex.edu/merges","archive_url":"https://api.github.com/repos/codex-team/codex.edu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codex-team/codex.edu/downloads","issues_url":"https://api.github.com/repos/codex-team/codex.edu/issues{/number}","pulls_url":"https://api.github.com/repos/codex-team/codex.edu/pulls{/number}","milestones_url":"https://api.github.com/repos/codex-team/codex.edu/milestones{/number}","notifications_url":"https://api.github.com/repos/codex-team/codex.edu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codex-team/codex.edu/labels{/name}","releases_url":"https://api.github.com/repos/codex-team/codex.edu/releases{/id}","created_at":"2015-11-22T13:51:50Z","updated_at":"2015-12-19T23:42:34Z","pushed_at":"2015-12-27T23:01:53Z","git_url":"git://github.com/codex-team/codex.edu.git","ssh_url":"git@github.com:codex-team/codex.edu.git","clone_url":"https://github.com/codex-team/codex.edu.git","svn_url":"https://github.com/codex-team/codex.edu","homepage":null,"size":5090,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/24"},"html":{"href":"https://github.com/codex-team/codex.edu/pull/24"},"issue":{"href":"https://api.github.com/repos/codex-team/codex.edu/issues/24"},"comments":{"href":"https://api.github.com/repos/codex-team/codex.edu/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codex-team/codex.edu/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/codex-team/codex.edu/statuses/1cf1aead5aa7e7b4f8e8d9b2610527ebb4fd3299"}}}}