{"action":"created","comment":{"url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/comments/39243062","id":39243062,"diff_hunk":"@@ -73,4 +84,98 @@ public function logout()\n         session_destroy();\n         redirect('user/login');\n     }\n+\n+    public function profile()\n+    {\n+        $user = new User();\n+        $user->id = Param::get('user_id');\n+        $user->getProfile();\n+\n+        if(!isset($user->username)) {\n+            redirect('notfound/pagenotfound');\n+        }\n+\n+        $threads_followed = array();\n+        $thread_followed_id = Follow::getFollowedThreadIds($user->id);\n+\n+        foreach($thread_followed_id as $thread) {\n+            $threads_followed[] = Thread::getById($thread['thread_id']);\n+        }\n+\n+        foreach ($threads_followed as $thread) {\n+            $thread->username = User::getUsernameById($thread->user_id);\n+        }\n+\n+        $threads_created = Thread::getByUserId($user->id);\n+\n+        foreach ($threads_created as $thread) {\n+            $thread->username = User::getUsernameById($thread->user_id);\n+        }\n+\n+        $this->set(get_defined_vars());\n+    }\n+\n+    public function edit()\n+    {\n+        $process = Param::get('process', 'edit');\n+        $user = new User();\n+\n+        switch($process) {\n+            case self::EDIT_ACCOUNT:\n+                $user->id = $_SESSION['userid'];","path":"app/controllers/user_controller.php","position":108,"original_position":108,"commit_id":"4ce89098d230861d9df818d3233c37439b24b9bd","original_commit_id":"4ce89098d230861d9df818d3233c37439b24b9bd","user":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"body":"Refactored my code po. I wrapped the  process po of authenticating the user id in my helper function so I will not have to repetitively write try and catch po. https://github.com/renzosunico/MyClassroom/commit/b38376515c72c296cf46c444804d9cd9c0324ba9","created_at":"2015-09-11T05:47:26Z","updated_at":"2015-09-11T05:47:26Z","html_url":"https://github.com/renzosunico/MyClassroom/pull/2#discussion_r39243062","pull_request_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/comments/39243062"},"html":{"href":"https://github.com/renzosunico/MyClassroom/pull/2#discussion_r39243062"},"pull_request":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2","id":44411045,"html_url":"https://github.com/renzosunico/MyClassroom/pull/2","diff_url":"https://github.com/renzosunico/MyClassroom/pull/2.diff","patch_url":"https://github.com/renzosunico/MyClassroom/pull/2.patch","issue_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/2","number":2,"state":"open","locked":false,"title":"Pull request to merge dev_1.1 to master.","user":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"body":"Modules\r\n\r\nSort/Filter\r\nFilter threads according to category.\r\nSort comments according to most likes.\r\nView threads created by a specific user.\r\nView top 10 most commented thread.\r\nPagination\r\n\r\nAccount\r\n    - Register Account\r\n    - View/Edit Account\r\n    - View other user\r\n    - Login/Logout\r\n\r\nThread\r\n    - Create Thread\r\n    - Edit/Delete own thread\r\n    - View Thread\r\n    - Follow/unfollow thread\r\n\r\nComment\r\n    - Create comment\r\n    - Edit/delete own comment\r\n    - view comment\r\n    - Like/unlike comment","created_at":"2015-09-08T09:38:05Z","updated_at":"2015-09-11T05:47:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e83c20fd2f7396992b3c4985f8a53abb61ac8c2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2/commits","review_comments_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2/comments","review_comment_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/2/comments","statuses_url":"https://api.github.com/repos/renzosunico/MyClassroom/statuses/4ce89098d230861d9df818d3233c37439b24b9bd","head":{"label":"renzosunico:dev_1.1","ref":"dev_1.1","sha":"4ce89098d230861d9df818d3233c37439b24b9bd","user":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"repo":{"id":40689972,"name":"MyClassroom","full_name":"renzosunico/MyClassroom","owner":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/renzosunico/MyClassroom","description":"","fork":false,"url":"https://api.github.com/repos/renzosunico/MyClassroom","forks_url":"https://api.github.com/repos/renzosunico/MyClassroom/forks","keys_url":"https://api.github.com/repos/renzosunico/MyClassroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renzosunico/MyClassroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renzosunico/MyClassroom/teams","hooks_url":"https://api.github.com/repos/renzosunico/MyClassroom/hooks","issue_events_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/events{/number}","events_url":"https://api.github.com/repos/renzosunico/MyClassroom/events","assignees_url":"https://api.github.com/repos/renzosunico/MyClassroom/assignees{/user}","branches_url":"https://api.github.com/repos/renzosunico/MyClassroom/branches{/branch}","tags_url":"https://api.github.com/repos/renzosunico/MyClassroom/tags","blobs_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renzosunico/MyClassroom/statuses/{sha}","languages_url":"https://api.github.com/repos/renzosunico/MyClassroom/languages","stargazers_url":"https://api.github.com/repos/renzosunico/MyClassroom/stargazers","contributors_url":"https://api.github.com/repos/renzosunico/MyClassroom/contributors","subscribers_url":"https://api.github.com/repos/renzosunico/MyClassroom/subscribers","subscription_url":"https://api.github.com/repos/renzosunico/MyClassroom/subscription","commits_url":"https://api.github.com/repos/renzosunico/MyClassroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/renzosunico/MyClassroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/renzosunico/MyClassroom/contents/{+path}","compare_url":"https://api.github.com/repos/renzosunico/MyClassroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renzosunico/MyClassroom/merges","archive_url":"https://api.github.com/repos/renzosunico/MyClassroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renzosunico/MyClassroom/downloads","issues_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues{/number}","pulls_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls{/number}","milestones_url":"https://api.github.com/repos/renzosunico/MyClassroom/milestones{/number}","notifications_url":"https://api.github.com/repos/renzosunico/MyClassroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renzosunico/MyClassroom/labels{/name}","releases_url":"https://api.github.com/repos/renzosunico/MyClassroom/releases{/id}","created_at":"2015-08-14T01:39:38Z","updated_at":"2015-09-08T09:45:44Z","pushed_at":"2015-09-11T05:44:27Z","git_url":"git://github.com/renzosunico/MyClassroom.git","ssh_url":"git@github.com:renzosunico/MyClassroom.git","clone_url":"https://github.com/renzosunico/MyClassroom.git","svn_url":"https://github.com/renzosunico/MyClassroom","homepage":null,"size":688,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev_1.1"}},"base":{"label":"renzosunico:master","ref":"master","sha":"27e334e943825b06b78affe82a725f728fd25fbd","user":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"repo":{"id":40689972,"name":"MyClassroom","full_name":"renzosunico/MyClassroom","owner":{"login":"renzosunico","id":13325504,"avatar_url":"https://avatars.githubusercontent.com/u/13325504?v=3","gravatar_id":"","url":"https://api.github.com/users/renzosunico","html_url":"https://github.com/renzosunico","followers_url":"https://api.github.com/users/renzosunico/followers","following_url":"https://api.github.com/users/renzosunico/following{/other_user}","gists_url":"https://api.github.com/users/renzosunico/gists{/gist_id}","starred_url":"https://api.github.com/users/renzosunico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renzosunico/subscriptions","organizations_url":"https://api.github.com/users/renzosunico/orgs","repos_url":"https://api.github.com/users/renzosunico/repos","events_url":"https://api.github.com/users/renzosunico/events{/privacy}","received_events_url":"https://api.github.com/users/renzosunico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/renzosunico/MyClassroom","description":"","fork":false,"url":"https://api.github.com/repos/renzosunico/MyClassroom","forks_url":"https://api.github.com/repos/renzosunico/MyClassroom/forks","keys_url":"https://api.github.com/repos/renzosunico/MyClassroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renzosunico/MyClassroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renzosunico/MyClassroom/teams","hooks_url":"https://api.github.com/repos/renzosunico/MyClassroom/hooks","issue_events_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/events{/number}","events_url":"https://api.github.com/repos/renzosunico/MyClassroom/events","assignees_url":"https://api.github.com/repos/renzosunico/MyClassroom/assignees{/user}","branches_url":"https://api.github.com/repos/renzosunico/MyClassroom/branches{/branch}","tags_url":"https://api.github.com/repos/renzosunico/MyClassroom/tags","blobs_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renzosunico/MyClassroom/statuses/{sha}","languages_url":"https://api.github.com/repos/renzosunico/MyClassroom/languages","stargazers_url":"https://api.github.com/repos/renzosunico/MyClassroom/stargazers","contributors_url":"https://api.github.com/repos/renzosunico/MyClassroom/contributors","subscribers_url":"https://api.github.com/repos/renzosunico/MyClassroom/subscribers","subscription_url":"https://api.github.com/repos/renzosunico/MyClassroom/subscription","commits_url":"https://api.github.com/repos/renzosunico/MyClassroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/renzosunico/MyClassroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/renzosunico/MyClassroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/renzosunico/MyClassroom/contents/{+path}","compare_url":"https://api.github.com/repos/renzosunico/MyClassroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renzosunico/MyClassroom/merges","archive_url":"https://api.github.com/repos/renzosunico/MyClassroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renzosunico/MyClassroom/downloads","issues_url":"https://api.github.com/repos/renzosunico/MyClassroom/issues{/number}","pulls_url":"https://api.github.com/repos/renzosunico/MyClassroom/pulls{/number}","milestones_url":"https://api.github.com/repos/renzosunico/MyClassroom/milestones{/number}","notifications_url":"https://api.github.com/repos/renzosunico/MyClassroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renzosunico/MyClassroom/labels{/name}","releases_url":"https://api.github.com/repos/renzosunico/MyClassroom/releases{/id}","created_at":"2015-08-14T01:39:38Z","updated_at":"2015-09-08T09:45:44Z","pushed_at":"2015-09-11T05:44:27Z","git_url":"git://github.com/renzosunico/MyClassroom.git","ssh_url":"git@github.com:renzosunico/MyClassroom.git","clone_url":"https://github.com/renzosunico/MyClassroom.git","svn_url":"https://github.com/renzosunico/MyClassroom","homepage":null,"size":688,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev_1.1"}},"_links":{"self":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2"},"html":{"href":"https://github.com/renzosunico/MyClassroom/pull/2"},"issue":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/issues/2"},"comments":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/renzosunico/MyClassroom/statuses/4ce89098d230861d9df818d3233c37439b24b9bd"}}}}