GitHub PullRequestReviewCommentEvent at 2014-10-22 05:17:17
Repository: chamilo-lms
Actor: ywarnier
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/19194784","id":19194784,"diff_hunk":"@@ -0,0 +1,76 @@\n+<?php\n+/* For licensing terms, see /license.txt */\n+/**\n+ * Controller for REST request\n+ * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>\n+ * @package chamilo.plugin.tour\n+ */\n+/* Require libs and classes */\n+require_once '../main/inc/global.inc.php';\n+require_once './classes/WebService.class.php';\n+require_once './classes/MessagesWebService.class.php';\n+\n+/* Manage actions */\n+$json = array();\n+\n+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'nothing';\n+$username = Security::remove_XSS($_POST['username']);\n+$apiKey = isset($_POST['api_key']) ? Security::remove_XSS($_POST['api_key']) : null;\n+\n+switch ($action) {\n+    case 'loginNewMessages':\n+        $password = Security::remove_XSS($_POST['password']);\n+\n+        if (MessagesWebService::isValidUser($username, $password)) {\n+            $webService = new MessagesWebService();\n+\n+            $apiKey = $webService->getApiKey($username);\n+\n+            $json = array(\n+                'apiKey' => $apiKey\n+            );\n+        } else {\n+            $json = array(\n+                'status' => false\n+            );\n+        }\n+        break;\n+    case 'countNewMessages':\n+        if (MessagesWebService::isValidApiKey($username, $apiKey)) {\n+            $webService = new MessagesWebService();\n+            $webService->setApiKey($apiKey);\n+\n+            $lastId = isset($_POST['last']) ? $_POST['last'] : 0;\n+\n+            $count = $webService->countNewMessages($username, $lastId);\n+\n+            $json = array(\n+                'count' => $count\n+            );\n+        } else {\n+            $json = array(\n+                'status' => false\n+            );\n+        }\n+        break;\n+    case 'getNewMessages':\n+        if (MessagesWebService::isValidApiKey($username, $apiKey)) {\n+            $webService = new MessagesWebService();\n+            $webService->setApiKey($apiKey);\n+\n+            $lastId = isset($_POST['last']) ? $_POST['last'] : 0;\n+\n+            $messages = $webService->getNewMessages($username, $lastId);\n+\n+            $json = $messages;\n+        } else {\n+            $json = array(\n+                'status' => false\n+            );\n+        }\n+        break;\n+    default:\n+}\n+\n+/* View */\n+echo json_encode($json);","path":"webservices/rest.php","position":76,"original_position":76,"commit_id":"1825fc0b0ce3b5aa68ce54d7d5802ffe300b631b","original_commit_id":"1825fc0b0ce3b5aa68ce54d7d5802ffe300b631b","user":{"login":"ywarnier","id":609839,"avatar_url":"https://avatars.githubusercontent.com/u/609839?v=2","gravatar_id":"","url":"https://api.github.com/users/ywarnier","html_url":"https://github.com/ywarnier","followers_url":"https://api.github.com/users/ywarnier/followers","following_url":"https://api.github.com/users/ywarnier/following{/other_user}","gists_url":"https://api.github.com/users/ywarnier/gists{/gist_id}","starred_url":"https://api.github.com/users/ywarnier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywarnier/subscriptions","organizations_url":"https://api.github.com/users/ywarnier/orgs","repos_url":"https://api.github.com/users/ywarnier/repos","events_url":"https://api.github.com/users/ywarnier/events{/privacy}","received_events_url":"https://api.github.com/users/ywarnier/received_events","type":"User","site_admin":false},"body":"This looks globally very good.","created_at":"2014-10-22T05:17:17Z","updated_at":"2014-10-22T05:17:17Z","html_url":"https://github.com/chamilo/chamilo-lms/pull/391#discussion_r19194784","pull_request_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/19194784"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/391#discussion_r19194784"},"pull_request":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391","id":23114225,"html_url":"https://github.com/chamilo/chamilo-lms/pull/391","diff_url":"https://github.com/chamilo/chamilo-lms/pull/391.diff","patch_url":"https://github.com/chamilo/chamilo-lms/pull/391.patch","issue_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/391","number":391,"state":"open","locked":false,"title":"Add REST web service for get personal messages - refs #7338","user":{"login":"AngelFQC","id":1697880,"avatar_url":"https://avatars.githubusercontent.com/u/1697880?v=2","gravatar_id":"","url":"https://api.github.com/users/AngelFQC","html_url":"https://github.com/AngelFQC","followers_url":"https://api.github.com/users/AngelFQC/followers","following_url":"https://api.github.com/users/AngelFQC/following{/other_user}","gists_url":"https://api.github.com/users/AngelFQC/gists{/gist_id}","starred_url":"https://api.github.com/users/AngelFQC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AngelFQC/subscriptions","organizations_url":"https://api.github.com/users/AngelFQC/orgs","repos_url":"https://api.github.com/users/AngelFQC/repos","events_url":"https://api.github.com/users/AngelFQC/events{/privacy}","received_events_url":"https://api.github.com/users/AngelFQC/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-21T20:13:51Z","updated_at":"2014-10-22T05:17:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"389a775fe8486109ea07fa17e0b5799aeab15319","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391/commits","review_comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391/comments","review_comment_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/{number}","comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/391/comments","statuses_url":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/1825fc0b0ce3b5aa68ce54d7d5802ffe300b631b","head":{"label":"AngelFQC:7338","ref":"7338","sha":"1825fc0b0ce3b5aa68ce54d7d5802ffe300b631b","user":{"login":"AngelFQC","id":1697880,"avatar_url":"https://avatars.githubusercontent.com/u/1697880?v=2","gravatar_id":"","url":"https://api.github.com/users/AngelFQC","html_url":"https://github.com/AngelFQC","followers_url":"https://api.github.com/users/AngelFQC/followers","following_url":"https://api.github.com/users/AngelFQC/following{/other_user}","gists_url":"https://api.github.com/users/AngelFQC/gists{/gist_id}","starred_url":"https://api.github.com/users/AngelFQC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AngelFQC/subscriptions","organizations_url":"https://api.github.com/users/AngelFQC/orgs","repos_url":"https://api.github.com/users/AngelFQC/repos","events_url":"https://api.github.com/users/AngelFQC/events{/privacy}","received_events_url":"https://api.github.com/users/AngelFQC/received_events","type":"User","site_admin":false},"repo":{"id":22071905,"name":"chamilo-lms","full_name":"AngelFQC/chamilo-lms","owner":{"login":"AngelFQC","id":1697880,"avatar_url":"https://avatars.githubusercontent.com/u/1697880?v=2","gravatar_id":"","url":"https://api.github.com/users/AngelFQC","html_url":"https://github.com/AngelFQC","followers_url":"https://api.github.com/users/AngelFQC/followers","following_url":"https://api.github.com/users/AngelFQC/following{/other_user}","gists_url":"https://api.github.com/users/AngelFQC/gists{/gist_id}","starred_url":"https://api.github.com/users/AngelFQC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AngelFQC/subscriptions","organizations_url":"https://api.github.com/users/AngelFQC/orgs","repos_url":"https://api.github.com/users/AngelFQC/repos","events_url":"https://api.github.com/users/AngelFQC/events{/privacy}","received_events_url":"https://api.github.com/users/AngelFQC/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AngelFQC/chamilo-lms","description":"Chamilo is a learning management system focusing on ease of use, re-usability, collaboration and sharing.","fork":true,"url":"https://api.github.com/repos/AngelFQC/chamilo-lms","forks_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/forks","keys_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/teams","hooks_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/hooks","issue_events_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/issues/events{/number}","events_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/events","assignees_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/assignees{/user}","branches_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/branches{/branch}","tags_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/tags","blobs_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/languages","stargazers_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/stargazers","contributors_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/contributors","subscribers_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/subscribers","subscription_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/subscription","commits_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/issues/comments/{number}","contents_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/contents/{+path}","compare_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/merges","archive_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/downloads","issues_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/issues{/number}","pulls_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/labels{/name}","releases_url":"https://api.github.com/repos/AngelFQC/chamilo-lms/releases{/id}","created_at":"2014-07-21T16:36:20Z","updated_at":"2014-07-20T18:30:46Z","pushed_at":"2014-10-21T20:40:23Z","git_url":"git://github.com/AngelFQC/chamilo-lms.git","ssh_url":"git@github.com:AngelFQC/chamilo-lms.git","clone_url":"https://github.com/AngelFQC/chamilo-lms.git","svn_url":"https://github.com/AngelFQC/chamilo-lms","homepage":"http://www.chamilo.org","size":803002,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chamilo:1.9.x","ref":"1.9.x","sha":"0e8609a5104030dab0cec166bf81b9b1e263434b","user":{"login":"chamilo","id":3460664,"avatar_url":"https://avatars.githubusercontent.com/u/3460664?v=2","gravatar_id":"","url":"https://api.github.com/users/chamilo","html_url":"https://github.com/chamilo","followers_url":"https://api.github.com/users/chamilo/followers","following_url":"https://api.github.com/users/chamilo/following{/other_user}","gists_url":"https://api.github.com/users/chamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilo/subscriptions","organizations_url":"https://api.github.com/users/chamilo/orgs","repos_url":"https://api.github.com/users/chamilo/repos","events_url":"https://api.github.com/users/chamilo/events{/privacy}","received_events_url":"https://api.github.com/users/chamilo/received_events","type":"Organization","site_admin":false},"repo":{"id":9103211,"name":"chamilo-lms","full_name":"chamilo/chamilo-lms","owner":{"login":"chamilo","id":3460664,"avatar_url":"https://avatars.githubusercontent.com/u/3460664?v=2","gravatar_id":"","url":"https://api.github.com/users/chamilo","html_url":"https://github.com/chamilo","followers_url":"https://api.github.com/users/chamilo/followers","following_url":"https://api.github.com/users/chamilo/following{/other_user}","gists_url":"https://api.github.com/users/chamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilo/subscriptions","organizations_url":"https://api.github.com/users/chamilo/orgs","repos_url":"https://api.github.com/users/chamilo/repos","events_url":"https://api.github.com/users/chamilo/events{/privacy}","received_events_url":"https://api.github.com/users/chamilo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chamilo/chamilo-lms","description":"Chamilo is a learning management system focusing on ease of use, re-usability, collaboration and sharing.","fork":false,"url":"https://api.github.com/repos/chamilo/chamilo-lms","forks_url":"https://api.github.com/repos/chamilo/chamilo-lms/forks","keys_url":"https://api.github.com/repos/chamilo/chamilo-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chamilo/chamilo-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chamilo/chamilo-lms/teams","hooks_url":"https://api.github.com/repos/chamilo/chamilo-lms/hooks","issue_events_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/events{/number}","events_url":"https://api.github.com/repos/chamilo/chamilo-lms/events","assignees_url":"https://api.github.com/repos/chamilo/chamilo-lms/assignees{/user}","branches_url":"https://api.github.com/repos/chamilo/chamilo-lms/branches{/branch}","tags_url":"https://api.github.com/repos/chamilo/chamilo-lms/tags","blobs_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/chamilo/chamilo-lms/languages","stargazers_url":"https://api.github.com/repos/chamilo/chamilo-lms/stargazers","contributors_url":"https://api.github.com/repos/chamilo/chamilo-lms/contributors","subscribers_url":"https://api.github.com/repos/chamilo/chamilo-lms/subscribers","subscription_url":"https://api.github.com/repos/chamilo/chamilo-lms/subscription","commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/comments/{number}","contents_url":"https://api.github.com/repos/chamilo/chamilo-lms/contents/{+path}","compare_url":"https://api.github.com/repos/chamilo/chamilo-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chamilo/chamilo-lms/merges","archive_url":"https://api.github.com/repos/chamilo/chamilo-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chamilo/chamilo-lms/downloads","issues_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues{/number}","pulls_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/chamilo/chamilo-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/chamilo/chamilo-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chamilo/chamilo-lms/labels{/name}","releases_url":"https://api.github.com/repos/chamilo/chamilo-lms/releases{/id}","created_at":"2013-03-29T17:31:19Z","updated_at":"2014-10-17T12:27:35Z","pushed_at":"2014-10-22T04:59:00Z","git_url":"git://github.com/chamilo/chamilo-lms.git","ssh_url":"git@github.com:chamilo/chamilo-lms.git","clone_url":"https://github.com/chamilo/chamilo-lms.git","svn_url":"https://github.com/chamilo/chamilo-lms","homepage":"http://www.chamilo.org","size":900490,"stargazers_count":59,"watchers_count":59,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":4,"forks":71,"open_issues":4,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/391"},"issue":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/391"},"comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/1825fc0b0ce3b5aa68ce54d7d5802ffe300b631b"}}}}