{"action":"created","comment":{"url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments/88847581","pull_request_review_id":9404067,"id":88847581,"diff_hunk":"@@ -0,0 +1,46 @@\n+<?php\n+    // Start a new PHP session (or continue an existing one)\n+    session_start();\n+    $pwhash =  parse_ini_file(\"/etc/pihole/setupVars.conf\")['WEBPASSWORD'];\n+\n+    // If the user wants to log out, we free all session variables currently registered\n+    if(isset($_GET[\"logout\"]))\n+        session_unset();\n+\n+    // Test if password is set\n+    if(strlen($pwhash) > 0)","path":"php/password.php","position":11,"original_position":11,"commit_id":"1cf031ab68599a0fdab294738f070cff54224738","original_commit_id":"1cf031ab68599a0fdab294738f070cff54224738","user":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"body":"No. It is unlikely, but it might be that someone deletes the password while he is logged in. Then strange thinks would happen if he clicks on \"Logout\". If the user visited \"index.php?logout\" I still have to check all the various possibilities.","created_at":"2016-11-21T08:33:50Z","updated_at":"2016-11-21T08:33:54Z","html_url":"https://github.com/pi-hole/AdminLTE/pull/197#discussion_r88847581","pull_request_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197","_links":{"self":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments/88847581"},"html":{"href":"https://github.com/pi-hole/AdminLTE/pull/197#discussion_r88847581"},"pull_request":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197"}}},"pull_request":{"url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197","id":93943398,"html_url":"https://github.com/pi-hole/AdminLTE/pull/197","diff_url":"https://github.com/pi-hole/AdminLTE/pull/197.diff","patch_url":"https://github.com/pi-hole/AdminLTE/pull/197.patch","issue_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/197","number":197,"state":"open","locked":false,"title":"Add server-side password protection for the web interface","user":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"body":"Fixes #128.\r\n\r\nChanges proposed in this pull request:\r\n\r\n- Add an effective password protection to the web interface as I always felt that the current way of doing it is to inconvenient for most of the users.\r\n\r\nBehavior:\r\n\r\n1. No password is set: No surprises, everything is always shown to everyone.\r\n\r\n2. The user sets a password in `setupVars.conf`: Now, the user will be shown a \"login\" page:\r\n![screenshot at 2016-11-16 11-51-48](https://cloud.githubusercontent.com/assets/16748619/20344501/4fabcff8-abf3-11e6-897e-4eae1597270e.png)\r\nAlso, clicking on the links \"Enable/Disable\" doesn't do anything completely locking out any non-authorized user.\r\nOnce logged in, the hashed password is always carried around in all links to be sure that we only have to log in once.\r\n![screenshot at 2016-11-16 12-11-02](https://cloud.githubusercontent.com/assets/16748619/20345124/00d0674c-abf6-11e6-9899-aef38d343c1b.png)\r\nThe hashing of the password guarantees that the password is never visible in plain-text to someone who might look over your shoulder.\r\n\r\nOnce we agree on how we like to have it, we should definitely add an (clearly documented) option for the pihole command to make it easy to set the password. We might even ask for it during the installation.\r\n\r\nSyntax for `setupVars.conf`: `webpassword=\"ABC\"`\r\n\r\n@pi-hole/dashboard\r\n\r\n","created_at":"2016-11-16T10:57:04Z","updated_at":"2016-11-21T08:33:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88fa22bfc16f29747caada2c72a9f62661d20369","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197/commits","review_comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197/comments","review_comment_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/197/comments","statuses_url":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/1cf031ab68599a0fdab294738f070cff54224738","head":{"label":"DL6ER:auth","ref":"auth","sha":"1cf031ab68599a0fdab294738f070cff54224738","user":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"repo":{"id":72882438,"name":"AdminLTE","full_name":"DL6ER/AdminLTE","owner":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DL6ER/AdminLTE","description":"Pi-hole Dashboard for stats and more","fork":true,"url":"https://api.github.com/repos/DL6ER/AdminLTE","forks_url":"https://api.github.com/repos/DL6ER/AdminLTE/forks","keys_url":"https://api.github.com/repos/DL6ER/AdminLTE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DL6ER/AdminLTE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DL6ER/AdminLTE/teams","hooks_url":"https://api.github.com/repos/DL6ER/AdminLTE/hooks","issue_events_url":"https://api.github.com/repos/DL6ER/AdminLTE/issues/events{/number}","events_url":"https://api.github.com/repos/DL6ER/AdminLTE/events","assignees_url":"https://api.github.com/repos/DL6ER/AdminLTE/assignees{/user}","branches_url":"https://api.github.com/repos/DL6ER/AdminLTE/branches{/branch}","tags_url":"https://api.github.com/repos/DL6ER/AdminLTE/tags","blobs_url":"https://api.github.com/repos/DL6ER/AdminLTE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DL6ER/AdminLTE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DL6ER/AdminLTE/git/refs{/sha}","trees_url":"https://api.github.com/repos/DL6ER/AdminLTE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DL6ER/AdminLTE/statuses/{sha}","languages_url":"https://api.github.com/repos/DL6ER/AdminLTE/languages","stargazers_url":"https://api.github.com/repos/DL6ER/AdminLTE/stargazers","contributors_url":"https://api.github.com/repos/DL6ER/AdminLTE/contributors","subscribers_url":"https://api.github.com/repos/DL6ER/AdminLTE/subscribers","subscription_url":"https://api.github.com/repos/DL6ER/AdminLTE/subscription","commits_url":"https://api.github.com/repos/DL6ER/AdminLTE/commits{/sha}","git_commits_url":"https://api.github.com/repos/DL6ER/AdminLTE/git/commits{/sha}","comments_url":"https://api.github.com/repos/DL6ER/AdminLTE/comments{/number}","issue_comment_url":"https://api.github.com/repos/DL6ER/AdminLTE/issues/comments{/number}","contents_url":"https://api.github.com/repos/DL6ER/AdminLTE/contents/{+path}","compare_url":"https://api.github.com/repos/DL6ER/AdminLTE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DL6ER/AdminLTE/merges","archive_url":"https://api.github.com/repos/DL6ER/AdminLTE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DL6ER/AdminLTE/downloads","issues_url":"https://api.github.com/repos/DL6ER/AdminLTE/issues{/number}","pulls_url":"https://api.github.com/repos/DL6ER/AdminLTE/pulls{/number}","milestones_url":"https://api.github.com/repos/DL6ER/AdminLTE/milestones{/number}","notifications_url":"https://api.github.com/repos/DL6ER/AdminLTE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DL6ER/AdminLTE/labels{/name}","releases_url":"https://api.github.com/repos/DL6ER/AdminLTE/releases{/id}","deployments_url":"https://api.github.com/repos/DL6ER/AdminLTE/deployments","created_at":"2016-11-04T20:19:55Z","updated_at":"2016-11-11T20:00:47Z","pushed_at":"2016-11-20T20:15:09Z","git_url":"git://github.com/DL6ER/AdminLTE.git","ssh_url":"git@github.com:DL6ER/AdminLTE.git","clone_url":"https://github.com/DL6ER/AdminLTE.git","svn_url":"https://github.com/DL6ER/AdminLTE","homepage":"https://pi-hole.net","size":23217,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"devel"}},"base":{"label":"pi-hole:devel","ref":"devel","sha":"0e75c8e516e4861fc977fcb2d43e122e0206f230","user":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars.githubusercontent.com/u/16827203?v=3","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"repo":{"id":39698170,"name":"AdminLTE","full_name":"pi-hole/AdminLTE","owner":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars.githubusercontent.com/u/16827203?v=3","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pi-hole/AdminLTE","description":"Pi-hole Dashboard for stats and more","fork":true,"url":"https://api.github.com/repos/pi-hole/AdminLTE","forks_url":"https://api.github.com/repos/pi-hole/AdminLTE/forks","keys_url":"https://api.github.com/repos/pi-hole/AdminLTE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pi-hole/AdminLTE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pi-hole/AdminLTE/teams","hooks_url":"https://api.github.com/repos/pi-hole/AdminLTE/hooks","issue_events_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/events{/number}","events_url":"https://api.github.com/repos/pi-hole/AdminLTE/events","assignees_url":"https://api.github.com/repos/pi-hole/AdminLTE/assignees{/user}","branches_url":"https://api.github.com/repos/pi-hole/AdminLTE/branches{/branch}","tags_url":"https://api.github.com/repos/pi-hole/AdminLTE/tags","blobs_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/refs{/sha}","trees_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/{sha}","languages_url":"https://api.github.com/repos/pi-hole/AdminLTE/languages","stargazers_url":"https://api.github.com/repos/pi-hole/AdminLTE/stargazers","contributors_url":"https://api.github.com/repos/pi-hole/AdminLTE/contributors","subscribers_url":"https://api.github.com/repos/pi-hole/AdminLTE/subscribers","subscription_url":"https://api.github.com/repos/pi-hole/AdminLTE/subscription","commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/commits{/sha}","git_commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/commits{/sha}","comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/comments{/number}","issue_comment_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/comments{/number}","contents_url":"https://api.github.com/repos/pi-hole/AdminLTE/contents/{+path}","compare_url":"https://api.github.com/repos/pi-hole/AdminLTE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pi-hole/AdminLTE/merges","archive_url":"https://api.github.com/repos/pi-hole/AdminLTE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pi-hole/AdminLTE/downloads","issues_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues{/number}","pulls_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls{/number}","milestones_url":"https://api.github.com/repos/pi-hole/AdminLTE/milestones{/number}","notifications_url":"https://api.github.com/repos/pi-hole/AdminLTE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pi-hole/AdminLTE/labels{/name}","releases_url":"https://api.github.com/repos/pi-hole/AdminLTE/releases{/id}","deployments_url":"https://api.github.com/repos/pi-hole/AdminLTE/deployments","created_at":"2015-07-25T18:45:30Z","updated_at":"2016-10-31T09:17:30Z","pushed_at":"2016-11-20T23:23:31Z","git_url":"git://github.com/pi-hole/AdminLTE.git","ssh_url":"git@github.com:pi-hole/AdminLTE.git","clone_url":"https://github.com/pi-hole/AdminLTE.git","svn_url":"https://github.com/pi-hole/AdminLTE","homepage":"https://pi-hole.net","size":37850,"stargazers_count":71,"watchers_count":71,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":24,"forks":55,"open_issues":24,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197"},"html":{"href":"https://github.com/pi-hole/AdminLTE/pull/197"},"issue":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/issues/197"},"comments":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/issues/197/comments"},"review_comments":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197/comments"},"review_comment":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/197/commits"},"statuses":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/1cf031ab68599a0fdab294738f070cff54224738"}}}}
{"actor":{"display_login":"DL6ER"}}