{"action":"created","comment":{"url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/comments/44286425","id":44286425,"diff_hunk":"@@ -0,0 +1,107 @@\n+<?php\n+\n+\n+class Staff {\n+\n+    function isStaff($user) {\n+        //See if user exists in mod table\n+        if (!mysql_query(\" SELECT * FROM \" . SQLMODSLOG . \" WHERE user='\" . $user . \"'\"))\n+            return true;           \n+        return false;\n+    }\n+    \n+    function addStaff($user = 0, $pass1 = 0, $pass2 = 0, $perm) {\n+        //add staff member\n+        if (!valid('admin'))\n+            error(\"Permission denied\");\n+\n+         if ($this->isStaff(mysql_real_escape_string($user)))\n+            error(\"This user already exists!\");\n+            \n+        switch ($perm) {\n+            case 'admin':\n+                $allowed = 'janitor_board,moderator,admin';\n+                $denied = 'none';\n+                break;\n+            case 'mod':\n+                $allowed = 'janitor_board,moderator';\n+                $denied = 'admin';\n+                break;\n+            case 'janitor':\n+                $allowed = 'janitor_board';\n+                $denied = 'moderator, admin';\n+                break;\n+            default:\n+                error(\"Attempted to set unknown permission type.\");\n+                break;\n+        }\n+        \n+        if ($pass1 !== $pass2)\n+            error(\"Passwords did not match!\");\n+            \n+        require_once(CORE_DIR . \"/crypt/legacy.php\");\n+        $crypt = new SaguaroCryptLegacy;\n+        $salt = $crypt->generate_hash($pass2);\n+\n+        mysql_query(\"INSERT INTO \" . SQLMODSLOG . \" (`user`, `password`, `public_salt`, `allowed`, `denied`) VALUES ('\" . mysql_real_escape_string($user) . \"', '\" . $salt['hash'] . \"', '\" . $salt['public_salt'] . \"', '\" . $allowed . \"', '\" . $denied . \"')\");\n+    }\n+    \n+    function remStaff($targUser = '', $actUser, $actPass) {\n+        //remove staff member\n+        $targUser = mysql_real_escape_string($targUser);\n+        \n+        if (!valid('admin'))\n+            error(\"Permission denied\");\n+        if ($this->isStaff($targUser))\n+            error(\"User doesn't exist! (GET error?\");\n+        if ($_COOKIE['saguaro_auser'] == $targUser)\n+            error(\"You can't delete yourself!\"); //oi ya cheeky shit ill bash yer fookin head in i sware on me mum\n+        \n+        mysql_query(\"DELETE FROM \" . SQLMODSLOG . \" WHERE user='\" . $targUser .\"'\");\n+    }\n+    \n+    function modifyStaff($targUser, $actUser, $actPass, $perms = array(), $self = 0) {\n+        //modify existing user\n+    }\n+\n+    function getStaff() {\n+        //Staff list for panel\n+        \n+        $active = mysql_query(\" SELECT * FROM \" . SQLMODSLOG . \"\");\n+        if ( !$result = mysql_call( \"select * from \" . SQLMODSLOG . \"\" ) )\n+                echo S_SQLFAIL;\n+        \n+        if ( !$active ) \n+            echo S_SQLFAIL;\n+        $j = 0;\n+        $temp = '';\n+        echo \"<br><br>[<a href='\" . PHP_ASELF_ABS . \"'>Back to Panel</a><input type=hidden name=mode value=admin>]\";\n+        echo \"<input type=hidden name=pass value=\\\"$pass\\\">\\n\";\n+        echo \"<div class=\\\"delbuttons\\\">\";\n+        $temp .= \"<table class=\\\"postlists\\\"><br>\";","path":"_core/admin/staff.php","position":81,"original_position":81,"commit_id":"6943556277e4365f1e418feb9c57464d3d4df856","original_commit_id":"6943556277e4365f1e418feb9c57464d3d4df856","user":{"login":"Apogate","id":8524639,"avatar_url":"https://avatars.githubusercontent.com/u/8524639?v=3","gravatar_id":"","url":"https://api.github.com/users/Apogate","html_url":"https://github.com/Apogate","followers_url":"https://api.github.com/users/Apogate/followers","following_url":"https://api.github.com/users/Apogate/following{/other_user}","gists_url":"https://api.github.com/users/Apogate/gists{/gist_id}","starred_url":"https://api.github.com/users/Apogate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Apogate/subscriptions","organizations_url":"https://api.github.com/users/Apogate/orgs","repos_url":"https://api.github.com/users/Apogate/repos","events_url":"https://api.github.com/users/Apogate/events{/privacy}","received_events_url":"https://api.github.com/users/Apogate/received_events","type":"User","site_admin":false},"body":"Missed those in cleanup.","created_at":"2015-11-09T15:22:56Z","updated_at":"2015-11-09T15:22:56Z","html_url":"https://github.com/spootTheLousy/saguaro/pull/143#discussion_r44286425","pull_request_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/comments/44286425"},"html":{"href":"https://github.com/spootTheLousy/saguaro/pull/143#discussion_r44286425"},"pull_request":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143","id":50085772,"html_url":"https://github.com/spootTheLousy/saguaro/pull/143","diff_url":"https://github.com/spootTheLousy/saguaro/pull/143.diff","patch_url":"https://github.com/spootTheLousy/saguaro/pull/143.patch","issue_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/143","number":143,"state":"open","locked":false,"title":"Actually nice user management","user":{"login":"Apogate","id":8524639,"avatar_url":"https://avatars.githubusercontent.com/u/8524639?v=3","gravatar_id":"","url":"https://api.github.com/users/Apogate","html_url":"https://github.com/Apogate","followers_url":"https://api.github.com/users/Apogate/followers","following_url":"https://api.github.com/users/Apogate/following{/other_user}","gists_url":"https://api.github.com/users/Apogate/gists{/gist_id}","starred_url":"https://api.github.com/users/Apogate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Apogate/subscriptions","organizations_url":"https://api.github.com/users/Apogate/orgs","repos_url":"https://api.github.com/users/Apogate/repos","events_url":"https://api.github.com/users/Apogate/events{/privacy}","received_events_url":"https://api.github.com/users/Apogate/received_events","type":"User","site_admin":false},"body":"This pull contains:\r\n\r\n+Idiot proof front end user management, all following permissions are\r\nAdmin+\r\n+Add users\r\n+Remove users\r\n+See all users in specific mod table\r\n\r\nTODO: See apo issue tracker (#127)","created_at":"2015-11-09T05:16:48Z","updated_at":"2015-11-09T15:22:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6611f0059798d961c061d7e0ca658a2bfcf5e7f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143/commits","review_comments_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143/comments","review_comment_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/143/comments","statuses_url":"https://api.github.com/repos/spootTheLousy/saguaro/statuses/6943556277e4365f1e418feb9c57464d3d4df856","head":{"label":"spootTheLousy:User-management-take2","ref":"User-management-take2","sha":"6943556277e4365f1e418feb9c57464d3d4df856","user":{"login":"spootTheLousy","id":6258346,"avatar_url":"https://avatars.githubusercontent.com/u/6258346?v=3","gravatar_id":"","url":"https://api.github.com/users/spootTheLousy","html_url":"https://github.com/spootTheLousy","followers_url":"https://api.github.com/users/spootTheLousy/followers","following_url":"https://api.github.com/users/spootTheLousy/following{/other_user}","gists_url":"https://api.github.com/users/spootTheLousy/gists{/gist_id}","starred_url":"https://api.github.com/users/spootTheLousy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spootTheLousy/subscriptions","organizations_url":"https://api.github.com/users/spootTheLousy/orgs","repos_url":"https://api.github.com/users/spootTheLousy/repos","events_url":"https://api.github.com/users/spootTheLousy/events{/privacy}","received_events_url":"https://api.github.com/users/spootTheLousy/received_events","type":"User","site_admin":false},"repo":{"id":32981459,"name":"saguaro","full_name":"spootTheLousy/saguaro","owner":{"login":"spootTheLousy","id":6258346,"avatar_url":"https://avatars.githubusercontent.com/u/6258346?v=3","gravatar_id":"","url":"https://api.github.com/users/spootTheLousy","html_url":"https://github.com/spootTheLousy","followers_url":"https://api.github.com/users/spootTheLousy/followers","following_url":"https://api.github.com/users/spootTheLousy/following{/other_user}","gists_url":"https://api.github.com/users/spootTheLousy/gists{/gist_id}","starred_url":"https://api.github.com/users/spootTheLousy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spootTheLousy/subscriptions","organizations_url":"https://api.github.com/users/spootTheLousy/orgs","repos_url":"https://api.github.com/users/spootTheLousy/repos","events_url":"https://api.github.com/users/spootTheLousy/events{/privacy}","received_events_url":"https://api.github.com/users/spootTheLousy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spootTheLousy/saguaro","description":"saguaro imgboard software","fork":false,"url":"https://api.github.com/repos/spootTheLousy/saguaro","forks_url":"https://api.github.com/repos/spootTheLousy/saguaro/forks","keys_url":"https://api.github.com/repos/spootTheLousy/saguaro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spootTheLousy/saguaro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spootTheLousy/saguaro/teams","hooks_url":"https://api.github.com/repos/spootTheLousy/saguaro/hooks","issue_events_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/events{/number}","events_url":"https://api.github.com/repos/spootTheLousy/saguaro/events","assignees_url":"https://api.github.com/repos/spootTheLousy/saguaro/assignees{/user}","branches_url":"https://api.github.com/repos/spootTheLousy/saguaro/branches{/branch}","tags_url":"https://api.github.com/repos/spootTheLousy/saguaro/tags","blobs_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/refs{/sha}","trees_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spootTheLousy/saguaro/statuses/{sha}","languages_url":"https://api.github.com/repos/spootTheLousy/saguaro/languages","stargazers_url":"https://api.github.com/repos/spootTheLousy/saguaro/stargazers","contributors_url":"https://api.github.com/repos/spootTheLousy/saguaro/contributors","subscribers_url":"https://api.github.com/repos/spootTheLousy/saguaro/subscribers","subscription_url":"https://api.github.com/repos/spootTheLousy/saguaro/subscription","commits_url":"https://api.github.com/repos/spootTheLousy/saguaro/commits{/sha}","git_commits_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/commits{/sha}","comments_url":"https://api.github.com/repos/spootTheLousy/saguaro/comments{/number}","issue_comment_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/comments{/number}","contents_url":"https://api.github.com/repos/spootTheLousy/saguaro/contents/{+path}","compare_url":"https://api.github.com/repos/spootTheLousy/saguaro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spootTheLousy/saguaro/merges","archive_url":"https://api.github.com/repos/spootTheLousy/saguaro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spootTheLousy/saguaro/downloads","issues_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues{/number}","pulls_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls{/number}","milestones_url":"https://api.github.com/repos/spootTheLousy/saguaro/milestones{/number}","notifications_url":"https://api.github.com/repos/spootTheLousy/saguaro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spootTheLousy/saguaro/labels{/name}","releases_url":"https://api.github.com/repos/spootTheLousy/saguaro/releases{/id}","created_at":"2015-03-27T11:00:28Z","updated_at":"2015-09-19T07:47:06Z","pushed_at":"2015-11-09T05:40:47Z","git_url":"git://github.com/spootTheLousy/saguaro.git","ssh_url":"git@github.com:spootTheLousy/saguaro.git","clone_url":"https://github.com/spootTheLousy/saguaro.git","svn_url":"https://github.com/spootTheLousy/saguaro","homepage":null,"size":3902,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":3,"default_branch":"master"}},"base":{"label":"spootTheLousy:master","ref":"master","sha":"10d6f342b94cd1c88c09450acb799081ce65196c","user":{"login":"spootTheLousy","id":6258346,"avatar_url":"https://avatars.githubusercontent.com/u/6258346?v=3","gravatar_id":"","url":"https://api.github.com/users/spootTheLousy","html_url":"https://github.com/spootTheLousy","followers_url":"https://api.github.com/users/spootTheLousy/followers","following_url":"https://api.github.com/users/spootTheLousy/following{/other_user}","gists_url":"https://api.github.com/users/spootTheLousy/gists{/gist_id}","starred_url":"https://api.github.com/users/spootTheLousy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spootTheLousy/subscriptions","organizations_url":"https://api.github.com/users/spootTheLousy/orgs","repos_url":"https://api.github.com/users/spootTheLousy/repos","events_url":"https://api.github.com/users/spootTheLousy/events{/privacy}","received_events_url":"https://api.github.com/users/spootTheLousy/received_events","type":"User","site_admin":false},"repo":{"id":32981459,"name":"saguaro","full_name":"spootTheLousy/saguaro","owner":{"login":"spootTheLousy","id":6258346,"avatar_url":"https://avatars.githubusercontent.com/u/6258346?v=3","gravatar_id":"","url":"https://api.github.com/users/spootTheLousy","html_url":"https://github.com/spootTheLousy","followers_url":"https://api.github.com/users/spootTheLousy/followers","following_url":"https://api.github.com/users/spootTheLousy/following{/other_user}","gists_url":"https://api.github.com/users/spootTheLousy/gists{/gist_id}","starred_url":"https://api.github.com/users/spootTheLousy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spootTheLousy/subscriptions","organizations_url":"https://api.github.com/users/spootTheLousy/orgs","repos_url":"https://api.github.com/users/spootTheLousy/repos","events_url":"https://api.github.com/users/spootTheLousy/events{/privacy}","received_events_url":"https://api.github.com/users/spootTheLousy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spootTheLousy/saguaro","description":"saguaro imgboard software","fork":false,"url":"https://api.github.com/repos/spootTheLousy/saguaro","forks_url":"https://api.github.com/repos/spootTheLousy/saguaro/forks","keys_url":"https://api.github.com/repos/spootTheLousy/saguaro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spootTheLousy/saguaro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spootTheLousy/saguaro/teams","hooks_url":"https://api.github.com/repos/spootTheLousy/saguaro/hooks","issue_events_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/events{/number}","events_url":"https://api.github.com/repos/spootTheLousy/saguaro/events","assignees_url":"https://api.github.com/repos/spootTheLousy/saguaro/assignees{/user}","branches_url":"https://api.github.com/repos/spootTheLousy/saguaro/branches{/branch}","tags_url":"https://api.github.com/repos/spootTheLousy/saguaro/tags","blobs_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/refs{/sha}","trees_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spootTheLousy/saguaro/statuses/{sha}","languages_url":"https://api.github.com/repos/spootTheLousy/saguaro/languages","stargazers_url":"https://api.github.com/repos/spootTheLousy/saguaro/stargazers","contributors_url":"https://api.github.com/repos/spootTheLousy/saguaro/contributors","subscribers_url":"https://api.github.com/repos/spootTheLousy/saguaro/subscribers","subscription_url":"https://api.github.com/repos/spootTheLousy/saguaro/subscription","commits_url":"https://api.github.com/repos/spootTheLousy/saguaro/commits{/sha}","git_commits_url":"https://api.github.com/repos/spootTheLousy/saguaro/git/commits{/sha}","comments_url":"https://api.github.com/repos/spootTheLousy/saguaro/comments{/number}","issue_comment_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues/comments{/number}","contents_url":"https://api.github.com/repos/spootTheLousy/saguaro/contents/{+path}","compare_url":"https://api.github.com/repos/spootTheLousy/saguaro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spootTheLousy/saguaro/merges","archive_url":"https://api.github.com/repos/spootTheLousy/saguaro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spootTheLousy/saguaro/downloads","issues_url":"https://api.github.com/repos/spootTheLousy/saguaro/issues{/number}","pulls_url":"https://api.github.com/repos/spootTheLousy/saguaro/pulls{/number}","milestones_url":"https://api.github.com/repos/spootTheLousy/saguaro/milestones{/number}","notifications_url":"https://api.github.com/repos/spootTheLousy/saguaro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spootTheLousy/saguaro/labels{/name}","releases_url":"https://api.github.com/repos/spootTheLousy/saguaro/releases{/id}","created_at":"2015-03-27T11:00:28Z","updated_at":"2015-09-19T07:47:06Z","pushed_at":"2015-11-09T05:40:47Z","git_url":"git://github.com/spootTheLousy/saguaro.git","ssh_url":"git@github.com:spootTheLousy/saguaro.git","clone_url":"https://github.com/spootTheLousy/saguaro.git","svn_url":"https://github.com/spootTheLousy/saguaro","homepage":null,"size":3902,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143"},"html":{"href":"https://github.com/spootTheLousy/saguaro/pull/143"},"issue":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/issues/143"},"comments":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/spootTheLousy/saguaro/statuses/6943556277e4365f1e418feb9c57464d3d4df856"}}}}