{"action":"created","comment":{"url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/comments/45295191","id":45295191,"diff_hunk":"@@ -0,0 +1,69 @@\n+<?php\n+\tinclude_once('connection.php');\n+\n+\tfunction studentAcess($email, $password){\n+\t\tglobal $db;\n+\t\t$securePassword = hash(\"sha256\", $password);\n+\t\t$stmt = $db->prepare(\"SELECT name, email FROM Student WHERE email = :email AND password = :securePassword\");\n+\t\t$stmt->bindParam(':email', $email, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':securePassword', $securePassword, PDO::PARAM_STR);\n+\t\ttry {\n+      $stmt->execute();\n+    } catch (PDOException $e) {\n+      return $e->getMessage();\n+    }\n+\t\t$result = $stmt->fetchAll();\n+    return $result;\n+\t}\n+\n+\tfunction createStudent($name, $password, $birthdate, $univerisity, $email, $cellphone, $cv, $linkedin){\n+\t\tglobal $db;\n+\t\t$stmt = $db->prepare('INSERT INTO Student (name, password, birthdate, univerisity, email, cellphone, cv, linkedin) VALUES (:name, :securePassword, :birthdate, :univerisity, :email, :cellphone, :cv, :linkedin)');\n+\t\t$securePassword = hash(\"sha256\", $password);\n+\t\t$stmt->bindParam(':name', $name, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':securePassword', $securePassword, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':birthdate', $birthdate, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':univerisity', $univerisity, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':email', $email, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':cellphone', $cellphone, PDO::PARAM_INT);\n+\t\t$stmt->bindParam(':cv', $cv, PDO::PARAM_STR);\n+\t\t$stmt->bindParam(':linkedin', $linkedin, PDO::PARAM_STR);\n+\t\ttry {\n+\t\t\t$stmt->execute();\n+\t\t} catch (PDOException $e) {\n+\t\t\treturn $e->getMessage();\n+\t\t}\n+\t}\n+\n+\tfunction existsStudent($email){\n+    global $db;\n+    $stmt = $db->prepare('SELECT email FROM Student WHERE email = :email');\n+    $stmt->bindParam(':email', $email, PDO::PARAM_STR);\n+    try {\n+      $stmt->execute();\n+    } catch (PDOException $e) {","path":"api/student.php","position":44,"original_position":44,"commit_id":"116e707dffc613a469d1a1cb235f8e09035fc7c8","original_commit_id":"116e707dffc613a469d1a1cb235f8e09035fc7c8","user":{"login":"jpdias","id":3944845,"avatar_url":"https://avatars.githubusercontent.com/u/3944845?v=3","gravatar_id":"","url":"https://api.github.com/users/jpdias","html_url":"https://github.com/jpdias","followers_url":"https://api.github.com/users/jpdias/followers","following_url":"https://api.github.com/users/jpdias/following{/other_user}","gists_url":"https://api.github.com/users/jpdias/gists{/gist_id}","starred_url":"https://api.github.com/users/jpdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpdias/subscriptions","organizations_url":"https://api.github.com/users/jpdias/orgs","repos_url":"https://api.github.com/users/jpdias/repos","events_url":"https://api.github.com/users/jpdias/events{/privacy}","received_events_url":"https://api.github.com/users/jpdias/received_events","type":"User","site_admin":false},"body":"identation\r\n","created_at":"2015-11-19T03:13:26Z","updated_at":"2015-11-19T03:13:26Z","html_url":"https://github.com/nuieee/casestudy-plat-shareup/pull/19#discussion_r45295191","pull_request_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/comments/45295191"},"html":{"href":"https://github.com/nuieee/casestudy-plat-shareup/pull/19#discussion_r45295191"},"pull_request":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19","id":51174994,"html_url":"https://github.com/nuieee/casestudy-plat-shareup/pull/19","diff_url":"https://github.com/nuieee/casestudy-plat-shareup/pull/19.diff","patch_url":"https://github.com/nuieee/casestudy-plat-shareup/pull/19.patch","issue_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/19","number":19,"state":"open","locked":false,"title":"Authentications and Student registation","user":{"login":"RuiVilares","id":7611363,"avatar_url":"https://avatars.githubusercontent.com/u/7611363?v=3","gravatar_id":"","url":"https://api.github.com/users/RuiVilares","html_url":"https://github.com/RuiVilares","followers_url":"https://api.github.com/users/RuiVilares/followers","following_url":"https://api.github.com/users/RuiVilares/following{/other_user}","gists_url":"https://api.github.com/users/RuiVilares/gists{/gist_id}","starred_url":"https://api.github.com/users/RuiVilares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RuiVilares/subscriptions","organizations_url":"https://api.github.com/users/RuiVilares/orgs","repos_url":"https://api.github.com/users/RuiVilares/repos","events_url":"https://api.github.com/users/RuiVilares/events{/privacy}","received_events_url":"https://api.github.com/users/RuiVilares/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-11-19T03:11:03Z","updated_at":"2015-11-19T03:13:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35f50e10dbd80097447c699dc529eee0050111a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19/commits","review_comments_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19/comments","review_comment_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/19/comments","statuses_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/statuses/116e707dffc613a469d1a1cb235f8e09035fc7c8","head":{"label":"nuieee:authentications","ref":"authentications","sha":"116e707dffc613a469d1a1cb235f8e09035fc7c8","user":{"login":"nuieee","id":5528217,"avatar_url":"https://avatars.githubusercontent.com/u/5528217?v=3","gravatar_id":"","url":"https://api.github.com/users/nuieee","html_url":"https://github.com/nuieee","followers_url":"https://api.github.com/users/nuieee/followers","following_url":"https://api.github.com/users/nuieee/following{/other_user}","gists_url":"https://api.github.com/users/nuieee/gists{/gist_id}","starred_url":"https://api.github.com/users/nuieee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuieee/subscriptions","organizations_url":"https://api.github.com/users/nuieee/orgs","repos_url":"https://api.github.com/users/nuieee/repos","events_url":"https://api.github.com/users/nuieee/events{/privacy}","received_events_url":"https://api.github.com/users/nuieee/received_events","type":"Organization","site_admin":false},"repo":{"id":45132741,"name":"casestudy-plat-shareup","full_name":"nuieee/casestudy-plat-shareup","owner":{"login":"nuieee","id":5528217,"avatar_url":"https://avatars.githubusercontent.com/u/5528217?v=3","gravatar_id":"","url":"https://api.github.com/users/nuieee","html_url":"https://github.com/nuieee","followers_url":"https://api.github.com/users/nuieee/followers","following_url":"https://api.github.com/users/nuieee/following{/other_user}","gists_url":"https://api.github.com/users/nuieee/gists{/gist_id}","starred_url":"https://api.github.com/users/nuieee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuieee/subscriptions","organizations_url":"https://api.github.com/users/nuieee/orgs","repos_url":"https://api.github.com/users/nuieee/repos","events_url":"https://api.github.com/users/nuieee/events{/privacy}","received_events_url":"https://api.github.com/users/nuieee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuieee/casestudy-plat-shareup","description":"Case Study platform for ShARE - UP","fork":false,"url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup","forks_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/forks","keys_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/teams","hooks_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/hooks","issue_events_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/events{/number}","events_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/events","assignees_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/assignees{/user}","branches_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/branches{/branch}","tags_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/tags","blobs_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/statuses/{sha}","languages_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/languages","stargazers_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/stargazers","contributors_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/contributors","subscribers_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/subscribers","subscription_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/subscription","commits_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/contents/{+path}","compare_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/merges","archive_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/downloads","issues_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues{/number}","pulls_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls{/number}","milestones_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/milestones{/number}","notifications_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/labels{/name}","releases_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/releases{/id}","created_at":"2015-10-28T18:15:55Z","updated_at":"2015-11-18T20:55:20Z","pushed_at":"2015-11-19T03:11:03Z","git_url":"git://github.com/nuieee/casestudy-plat-shareup.git","ssh_url":"git@github.com:nuieee/casestudy-plat-shareup.git","clone_url":"https://github.com/nuieee/casestudy-plat-shareup.git","svn_url":"https://github.com/nuieee/casestudy-plat-shareup","homepage":null,"size":7,"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":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"nuieee:master","ref":"master","sha":"832987681998c09a2e7190dfece2e6f6266b5cda","user":{"login":"nuieee","id":5528217,"avatar_url":"https://avatars.githubusercontent.com/u/5528217?v=3","gravatar_id":"","url":"https://api.github.com/users/nuieee","html_url":"https://github.com/nuieee","followers_url":"https://api.github.com/users/nuieee/followers","following_url":"https://api.github.com/users/nuieee/following{/other_user}","gists_url":"https://api.github.com/users/nuieee/gists{/gist_id}","starred_url":"https://api.github.com/users/nuieee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuieee/subscriptions","organizations_url":"https://api.github.com/users/nuieee/orgs","repos_url":"https://api.github.com/users/nuieee/repos","events_url":"https://api.github.com/users/nuieee/events{/privacy}","received_events_url":"https://api.github.com/users/nuieee/received_events","type":"Organization","site_admin":false},"repo":{"id":45132741,"name":"casestudy-plat-shareup","full_name":"nuieee/casestudy-plat-shareup","owner":{"login":"nuieee","id":5528217,"avatar_url":"https://avatars.githubusercontent.com/u/5528217?v=3","gravatar_id":"","url":"https://api.github.com/users/nuieee","html_url":"https://github.com/nuieee","followers_url":"https://api.github.com/users/nuieee/followers","following_url":"https://api.github.com/users/nuieee/following{/other_user}","gists_url":"https://api.github.com/users/nuieee/gists{/gist_id}","starred_url":"https://api.github.com/users/nuieee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuieee/subscriptions","organizations_url":"https://api.github.com/users/nuieee/orgs","repos_url":"https://api.github.com/users/nuieee/repos","events_url":"https://api.github.com/users/nuieee/events{/privacy}","received_events_url":"https://api.github.com/users/nuieee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuieee/casestudy-plat-shareup","description":"Case Study platform for ShARE - UP","fork":false,"url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup","forks_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/forks","keys_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/teams","hooks_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/hooks","issue_events_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/events{/number}","events_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/events","assignees_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/assignees{/user}","branches_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/branches{/branch}","tags_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/tags","blobs_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/statuses/{sha}","languages_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/languages","stargazers_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/stargazers","contributors_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/contributors","subscribers_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/subscribers","subscription_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/subscription","commits_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/contents/{+path}","compare_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/merges","archive_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/downloads","issues_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues{/number}","pulls_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls{/number}","milestones_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/milestones{/number}","notifications_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/labels{/name}","releases_url":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/releases{/id}","created_at":"2015-10-28T18:15:55Z","updated_at":"2015-11-18T20:55:20Z","pushed_at":"2015-11-19T03:11:03Z","git_url":"git://github.com/nuieee/casestudy-plat-shareup.git","ssh_url":"git@github.com:nuieee/casestudy-plat-shareup.git","clone_url":"https://github.com/nuieee/casestudy-plat-shareup.git","svn_url":"https://github.com/nuieee/casestudy-plat-shareup","homepage":null,"size":7,"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":15,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19"},"html":{"href":"https://github.com/nuieee/casestudy-plat-shareup/pull/19"},"issue":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/19"},"comments":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/nuieee/casestudy-plat-shareup/statuses/116e707dffc613a469d1a1cb235f8e09035fc7c8"}}}}