{"action":"created","comment":{"url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/comments/57710216","id":57710216,"diff_hunk":"@@ -0,0 +1,71 @@\n+var LOGIN =0;\n+var INVALID_PASSWORD =1;\n+var INVALID_USERNAME =2;\n+\n+var username= JSON.parse(usersJSON);\n+//console.log(username);\n+\n+function User(path){\n+  this.name= path.userName;\n+  this.email=path.email;\n+  this.password=path.password;\n+}\n+\n+function AccountService(){\n+  this.username=\"\";\n+  this.password=\"\";\n+  this.usersArray=[];\n+}\n+\n+AccountService.prototype.setUsername= function(username){\n+  this.username=username;\n+}\n+\n+AccountService.prototype.setPassword = function(password){\n+  this.password=password;\n+}\n+\n+AccountService.prototype.setPassword = function(user){\n+  this.usersArray.push(user);\n+}\n+\n+\n+AccountService.prototype.checkLogin = function(){\n+  var toReturn =false;\n+  for (var i = 0; i < this.usersArray.length; i++) {\n+    var tempUser=this.usersArray[i];\n+\n+    if(tempUser.userName==this.username)\n+    {\n+        if(tempUser.password==this.password){\n+          toReturn=LOGIN;\n+          break;\n+        }\n+      else{\n+        toReturn=INVALID_PASSWORD;\n+      }\n+    }\n+    else{\n+      toReturn=INVALID_USERNAME;\n+    }\n+\n+  }\n+  return toReturn;\n+}\n+\n+function validate()\n+{\n+  var username= document.getElementById(\"username\").value;\n+  var password= document.getElementById(\"password\").value;\n+  AccountService.setUsername(username);\n+  AccountService.setPassword(password);\n+\n+  if(AccountService.checkLogin()==0){\n+\n+    alert (\"Login successfully\");\n+    return false;\n+  }\n+  else{\n+    document.getElementById(\"username\").style.backgroundColor=\"rgba(200, 0, 0, 0.3)\";","path":"app/LoginValidate.js","position":69,"original_position":69,"commit_id":"a5bc76442039e6c944a35246d89307ff7c14f75e","original_commit_id":"8cb2e6e37c47e7e422c48c94262fff35d1d315c6","user":{"login":"andreisebastianc","id":636000,"avatar_url":"https://avatars.githubusercontent.com/u/636000?v=3","gravatar_id":"","url":"https://api.github.com/users/andreisebastianc","html_url":"https://github.com/andreisebastianc","followers_url":"https://api.github.com/users/andreisebastianc/followers","following_url":"https://api.github.com/users/andreisebastianc/following{/other_user}","gists_url":"https://api.github.com/users/andreisebastianc/gists{/gist_id}","starred_url":"https://api.github.com/users/andreisebastianc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreisebastianc/subscriptions","organizations_url":"https://api.github.com/users/andreisebastianc/orgs","repos_url":"https://api.github.com/users/andreisebastianc/repos","events_url":"https://api.github.com/users/andreisebastianc/events{/privacy}","received_events_url":"https://api.github.com/users/andreisebastianc/received_events","type":"User","site_admin":false},"body":"trebuie să fii consistentă: dacă returnezi false într-un caz, returnează true în celălalt","created_at":"2016-03-29T11:50:04Z","updated_at":"2016-03-29T11:50:04Z","html_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118#discussion_r57710216","pull_request_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/comments/57710216"},"html":{"href":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118#discussion_r57710216"},"pull_request":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118","id":64333501,"html_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118","diff_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118.diff","patch_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118.patch","issue_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/118","number":118,"state":"open","locked":false,"title":"Monday work","user":{"login":"ancacoroama","id":17825247,"avatar_url":"https://avatars.githubusercontent.com/u/17825247?v=3","gravatar_id":"","url":"https://api.github.com/users/ancacoroama","html_url":"https://github.com/ancacoroama","followers_url":"https://api.github.com/users/ancacoroama/followers","following_url":"https://api.github.com/users/ancacoroama/following{/other_user}","gists_url":"https://api.github.com/users/ancacoroama/gists{/gist_id}","starred_url":"https://api.github.com/users/ancacoroama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ancacoroama/subscriptions","organizations_url":"https://api.github.com/users/ancacoroama/orgs","repos_url":"https://api.github.com/users/ancacoroama/repos","events_url":"https://api.github.com/users/ancacoroama/events{/privacy}","received_events_url":"https://api.github.com/users/ancacoroama/received_events","type":"User","site_admin":false},"body":"2 commits: Ajax and API, Html and Css","created_at":"2016-03-28T15:28:31Z","updated_at":"2016-03-29T11:50:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"836b4b26b6107fe5d1d8733fee37e34b8389b5a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118/commits","review_comments_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118/comments","review_comment_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/118/comments","statuses_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/statuses/a5bc76442039e6c944a35246d89307ff7c14f75e","head":{"label":"ancacoroama:master","ref":"master","sha":"a5bc76442039e6c944a35246d89307ff7c14f75e","user":{"login":"ancacoroama","id":17825247,"avatar_url":"https://avatars.githubusercontent.com/u/17825247?v=3","gravatar_id":"","url":"https://api.github.com/users/ancacoroama","html_url":"https://github.com/ancacoroama","followers_url":"https://api.github.com/users/ancacoroama/followers","following_url":"https://api.github.com/users/ancacoroama/following{/other_user}","gists_url":"https://api.github.com/users/ancacoroama/gists{/gist_id}","starred_url":"https://api.github.com/users/ancacoroama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ancacoroama/subscriptions","organizations_url":"https://api.github.com/users/ancacoroama/orgs","repos_url":"https://api.github.com/users/ancacoroama/repos","events_url":"https://api.github.com/users/ancacoroama/events{/privacy}","received_events_url":"https://api.github.com/users/ancacoroama/received_events","type":"User","site_admin":false},"repo":{"id":53845036,"name":"cluj-pre-js-2016","full_name":"ancacoroama/cluj-pre-js-2016","owner":{"login":"ancacoroama","id":17825247,"avatar_url":"https://avatars.githubusercontent.com/u/17825247?v=3","gravatar_id":"","url":"https://api.github.com/users/ancacoroama","html_url":"https://github.com/ancacoroama","followers_url":"https://api.github.com/users/ancacoroama/followers","following_url":"https://api.github.com/users/ancacoroama/following{/other_user}","gists_url":"https://api.github.com/users/ancacoroama/gists{/gist_id}","starred_url":"https://api.github.com/users/ancacoroama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ancacoroama/subscriptions","organizations_url":"https://api.github.com/users/ancacoroama/orgs","repos_url":"https://api.github.com/users/ancacoroama/repos","events_url":"https://api.github.com/users/ancacoroama/events{/privacy}","received_events_url":"https://api.github.com/users/ancacoroama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ancacoroama/cluj-pre-js-2016","description":"Repository used for the 2016 JS pre-employment training in Cluj Napoca.","fork":true,"url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016","forks_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/forks","keys_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/teams","hooks_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/hooks","issue_events_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/issues/events{/number}","events_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/events","assignees_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/assignees{/user}","branches_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/branches{/branch}","tags_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/tags","blobs_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/statuses/{sha}","languages_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/languages","stargazers_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/stargazers","contributors_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/contributors","subscribers_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/subscribers","subscription_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/subscription","commits_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/contents/{+path}","compare_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/merges","archive_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/downloads","issues_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/issues{/number}","pulls_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/pulls{/number}","milestones_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/milestones{/number}","notifications_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/labels{/name}","releases_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/releases{/id}","deployments_url":"https://api.github.com/repos/ancacoroama/cluj-pre-js-2016/deployments","created_at":"2016-03-14T09:53:56Z","updated_at":"2016-03-14T10:32:33Z","pushed_at":"2016-03-28T15:26:52Z","git_url":"git://github.com/ancacoroama/cluj-pre-js-2016.git","ssh_url":"git@github.com:ancacoroama/cluj-pre-js-2016.git","clone_url":"https://github.com/ancacoroama/cluj-pre-js-2016.git","svn_url":"https://github.com/ancacoroama/cluj-pre-js-2016","homepage":null,"size":40519,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"SOFTVISION-University:master","ref":"master","sha":"97d47b40b07c94b75066074fad0078a871e80993","user":{"login":"SOFTVISION-University","id":17495385,"avatar_url":"https://avatars.githubusercontent.com/u/17495385?v=3","gravatar_id":"","url":"https://api.github.com/users/SOFTVISION-University","html_url":"https://github.com/SOFTVISION-University","followers_url":"https://api.github.com/users/SOFTVISION-University/followers","following_url":"https://api.github.com/users/SOFTVISION-University/following{/other_user}","gists_url":"https://api.github.com/users/SOFTVISION-University/gists{/gist_id}","starred_url":"https://api.github.com/users/SOFTVISION-University/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOFTVISION-University/subscriptions","organizations_url":"https://api.github.com/users/SOFTVISION-University/orgs","repos_url":"https://api.github.com/users/SOFTVISION-University/repos","events_url":"https://api.github.com/users/SOFTVISION-University/events{/privacy}","received_events_url":"https://api.github.com/users/SOFTVISION-University/received_events","type":"Organization","site_admin":false},"repo":{"id":53585573,"name":"cluj-pre-js-2016","full_name":"SOFTVISION-University/cluj-pre-js-2016","owner":{"login":"SOFTVISION-University","id":17495385,"avatar_url":"https://avatars.githubusercontent.com/u/17495385?v=3","gravatar_id":"","url":"https://api.github.com/users/SOFTVISION-University","html_url":"https://github.com/SOFTVISION-University","followers_url":"https://api.github.com/users/SOFTVISION-University/followers","following_url":"https://api.github.com/users/SOFTVISION-University/following{/other_user}","gists_url":"https://api.github.com/users/SOFTVISION-University/gists{/gist_id}","starred_url":"https://api.github.com/users/SOFTVISION-University/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOFTVISION-University/subscriptions","organizations_url":"https://api.github.com/users/SOFTVISION-University/orgs","repos_url":"https://api.github.com/users/SOFTVISION-University/repos","events_url":"https://api.github.com/users/SOFTVISION-University/events{/privacy}","received_events_url":"https://api.github.com/users/SOFTVISION-University/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016","description":"Repository used for the 2016 JS pre-employment training in Cluj Napoca.","fork":false,"url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016","forks_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/forks","keys_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/teams","hooks_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/hooks","issue_events_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/events{/number}","events_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/events","assignees_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/assignees{/user}","branches_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/branches{/branch}","tags_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/tags","blobs_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/statuses/{sha}","languages_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/languages","stargazers_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/stargazers","contributors_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/contributors","subscribers_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/subscribers","subscription_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/subscription","commits_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/contents/{+path}","compare_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/merges","archive_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/downloads","issues_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues{/number}","pulls_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls{/number}","milestones_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/milestones{/number}","notifications_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/labels{/name}","releases_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/releases{/id}","deployments_url":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/deployments","created_at":"2016-03-10T13:14:40Z","updated_at":"2016-03-15T07:26:46Z","pushed_at":"2016-03-29T06:59:38Z","git_url":"git://github.com/SOFTVISION-University/cluj-pre-js-2016.git","ssh_url":"git@github.com:SOFTVISION-University/cluj-pre-js-2016.git","clone_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016.git","svn_url":"https://github.com/SOFTVISION-University/cluj-pre-js-2016","homepage":null,"size":10139,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":12,"forks":15,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118"},"html":{"href":"https://github.com/SOFTVISION-University/cluj-pre-js-2016/pull/118"},"issue":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/118"},"comments":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/SOFTVISION-University/cluj-pre-js-2016/statuses/a5bc76442039e6c944a35246d89307ff7c14f75e"}}}}