{"action":"created","comment":{"url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/comments/80409491","id":80409491,"diff_hunk":"@@ -358,20 +362,92 @@ public static function zrdn_menu_pages() {\n \n \t\t$settings_title = \"Settings\";\n \t\tadd_submenu_page(\n-\t\t\t$settings_title, // parent_slug\n+            $menu_slug, // parent_slug\n \t\t\t$page_title, // page_title\n \t\t\t$settings_title, // menu_title\n \t\t\t$capability, // capability\n \t\t\t$menu_slug, // menu_slug\n \t\t\t$function // callback function\n \t\t);\n \n-\t\tdo_action(\"zrdn__menu_page\", array(\n-\t\t\t\"capability\" => $capability,\n-\t\t\t\"parent_slug\" => $menu_slug,\n-\t\t\t));\n+\n+        if (!get_option('zrdn_registered')) {\n+            // registration\n+            $page_reg_title = 'Zip Recipes Registration';\n+            $reg_menu_slug = 'zrdn-register';\n+            $reg_function = __NAMESPACE__ . '\\ZipRecipes::zrdn_registration';\n+\n+            $register_title = \"Register\";\n+            add_submenu_page(\n+                $menu_slug, // parent_slug\n+                $page_reg_title, // page_title\n+                $register_title, // menu_title\n+                $capability, // capability\n+                $reg_menu_slug, // menu_slug\n+                $reg_function // callback function\n+            );\n+        }\n+\n+        do_action(\"zrdn__menu_page\", array(\n+            \"capability\" => $capability,\n+            \"parent_slug\" => $menu_slug,\n+        ));\n \t}\n \n+    public static function preload_check_registered() {\n+        if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n+            foreach ($_POST as $key => $val) {\n+                $_POST[$key] = stripslashes($val);\n+            }\n+\n+            if ($_POST['action'] === \"zrdn-register\") {\n+                // if first, last name and email are provided, we assume that user is registering\n+                $registered = $_POST['first_name'] && $_POST['last_name'] && $_POST['email'];\n+                if ($registered) {\n+                    update_option('zrdn_registered', true);\n+                    if (isset($_POST['ajax'])) {\n+                        echo 200;\n+                        die();\n+                    }\n+                    wp_redirect(admin_url( 'admin.php?page=' . 'zrdn-settings' ));\n+                    exit();\n+                }\n+            }\n+        }\n+\n+        if (isset( $_GET['page']) && $_GET['page']=='zrdn-settings') {\n+            if (!get_option('zrdn_registered')) {\n+                wp_redirect(admin_url('admin.php?page=' . 'zrdn-register'));\n+                exit();\n+            }\n+        }\n+        if (isset($_GET['page']) && $_GET['page']=='zrdn-register' && isset( $_GET['skipped-reg'])) {\n+            setcookie( 'skip-registration', 1, time()+60*60*24*7, '/' );\n+            wp_redirect(admin_url( 'admin.php?page=' . 'zrdn-settings' ));\n+            exit();\n+        }\n+    }\n+\n+    public static function zrdn_registration() {","path":"src/class.ziprecipes.php","position":null,"original_position":102,"commit_id":"82b7978108be51f392c0d95ee453a565290f19f0","original_commit_id":"8c4351bbfcb09e33e1023d737b88836aaa039764","user":{"login":"Noilleris","id":3234684,"avatar_url":"https://avatars.githubusercontent.com/u/3234684?v=3","gravatar_id":"","url":"https://api.github.com/users/Noilleris","html_url":"https://github.com/Noilleris","followers_url":"https://api.github.com/users/Noilleris/followers","following_url":"https://api.github.com/users/Noilleris/following{/other_user}","gists_url":"https://api.github.com/users/Noilleris/gists{/gist_id}","starred_url":"https://api.github.com/users/Noilleris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noilleris/subscriptions","organizations_url":"https://api.github.com/users/Noilleris/orgs","repos_url":"https://api.github.com/users/Noilleris/repos","events_url":"https://api.github.com/users/Noilleris/events{/privacy}","received_events_url":"https://api.github.com/users/Noilleris/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2016-09-26T05:27:05Z","updated_at":"2016-09-26T05:27:05Z","html_url":"https://github.com/hgezim/zip-recipes/pull/51#discussion_r80409491","pull_request_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/comments/80409491"},"html":{"href":"https://github.com/hgezim/zip-recipes/pull/51#discussion_r80409491"},"pull_request":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51","id":85203245,"html_url":"https://github.com/hgezim/zip-recipes/pull/51","diff_url":"https://github.com/hgezim/zip-recipes/pull/51.diff","patch_url":"https://github.com/hgezim/zip-recipes/pull/51.patch","issue_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/51","number":51,"state":"open","locked":false,"title":"Registration upgrade","user":{"login":"Noilleris","id":3234684,"avatar_url":"https://avatars.githubusercontent.com/u/3234684?v=3","gravatar_id":"","url":"https://api.github.com/users/Noilleris","html_url":"https://github.com/Noilleris","followers_url":"https://api.github.com/users/Noilleris/followers","following_url":"https://api.github.com/users/Noilleris/following{/other_user}","gists_url":"https://api.github.com/users/Noilleris/gists{/gist_id}","starred_url":"https://api.github.com/users/Noilleris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noilleris/subscriptions","organizations_url":"https://api.github.com/users/Noilleris/orgs","repos_url":"https://api.github.com/users/Noilleris/repos","events_url":"https://api.github.com/users/Noilleris/events{/privacy}","received_events_url":"https://api.github.com/users/Noilleris/received_events","type":"User","site_admin":false},"body":"Registration upgraded, need to to discuss, need you to review.","created_at":"2016-09-14T10:29:50Z","updated_at":"2016-09-26T05:27:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"633dec4e781c38d1c5a3969e1ffc56b5a0e1d7b7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51/commits","review_comments_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51/comments","review_comment_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/51/comments","statuses_url":"https://api.github.com/repos/hgezim/zip-recipes/statuses/82b7978108be51f392c0d95ee453a565290f19f0","head":{"label":"hgezim:registration_upgrade","ref":"registration_upgrade","sha":"82b7978108be51f392c0d95ee453a565290f19f0","user":{"login":"hgezim","id":124675,"avatar_url":"https://avatars.githubusercontent.com/u/124675?v=3","gravatar_id":"","url":"https://api.github.com/users/hgezim","html_url":"https://github.com/hgezim","followers_url":"https://api.github.com/users/hgezim/followers","following_url":"https://api.github.com/users/hgezim/following{/other_user}","gists_url":"https://api.github.com/users/hgezim/gists{/gist_id}","starred_url":"https://api.github.com/users/hgezim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgezim/subscriptions","organizations_url":"https://api.github.com/users/hgezim/orgs","repos_url":"https://api.github.com/users/hgezim/repos","events_url":"https://api.github.com/users/hgezim/events{/privacy}","received_events_url":"https://api.github.com/users/hgezim/received_events","type":"User","site_admin":false},"repo":{"id":26945466,"name":"zip-recipes","full_name":"hgezim/zip-recipes","owner":{"login":"hgezim","id":124675,"avatar_url":"https://avatars.githubusercontent.com/u/124675?v=3","gravatar_id":"","url":"https://api.github.com/users/hgezim","html_url":"https://github.com/hgezim","followers_url":"https://api.github.com/users/hgezim/followers","following_url":"https://api.github.com/users/hgezim/following{/other_user}","gists_url":"https://api.github.com/users/hgezim/gists{/gist_id}","starred_url":"https://api.github.com/users/hgezim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgezim/subscriptions","organizations_url":"https://api.github.com/users/hgezim/orgs","repos_url":"https://api.github.com/users/hgezim/repos","events_url":"https://api.github.com/users/hgezim/events{/privacy}","received_events_url":"https://api.github.com/users/hgezim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hgezim/zip-recipes","description":"Zip Recipes WordPress Plugin","fork":false,"url":"https://api.github.com/repos/hgezim/zip-recipes","forks_url":"https://api.github.com/repos/hgezim/zip-recipes/forks","keys_url":"https://api.github.com/repos/hgezim/zip-recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hgezim/zip-recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hgezim/zip-recipes/teams","hooks_url":"https://api.github.com/repos/hgezim/zip-recipes/hooks","issue_events_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/events{/number}","events_url":"https://api.github.com/repos/hgezim/zip-recipes/events","assignees_url":"https://api.github.com/repos/hgezim/zip-recipes/assignees{/user}","branches_url":"https://api.github.com/repos/hgezim/zip-recipes/branches{/branch}","tags_url":"https://api.github.com/repos/hgezim/zip-recipes/tags","blobs_url":"https://api.github.com/repos/hgezim/zip-recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hgezim/zip-recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hgezim/zip-recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/hgezim/zip-recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hgezim/zip-recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/hgezim/zip-recipes/languages","stargazers_url":"https://api.github.com/repos/hgezim/zip-recipes/stargazers","contributors_url":"https://api.github.com/repos/hgezim/zip-recipes/contributors","subscribers_url":"https://api.github.com/repos/hgezim/zip-recipes/subscribers","subscription_url":"https://api.github.com/repos/hgezim/zip-recipes/subscription","commits_url":"https://api.github.com/repos/hgezim/zip-recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/hgezim/zip-recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/hgezim/zip-recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/hgezim/zip-recipes/contents/{+path}","compare_url":"https://api.github.com/repos/hgezim/zip-recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hgezim/zip-recipes/merges","archive_url":"https://api.github.com/repos/hgezim/zip-recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hgezim/zip-recipes/downloads","issues_url":"https://api.github.com/repos/hgezim/zip-recipes/issues{/number}","pulls_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/hgezim/zip-recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/hgezim/zip-recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hgezim/zip-recipes/labels{/name}","releases_url":"https://api.github.com/repos/hgezim/zip-recipes/releases{/id}","deployments_url":"https://api.github.com/repos/hgezim/zip-recipes/deployments","created_at":"2014-11-21T04:27:49Z","updated_at":"2016-01-18T03:26:40Z","pushed_at":"2016-09-25T14:59:52Z","git_url":"git://github.com/hgezim/zip-recipes.git","ssh_url":"git@github.com:hgezim/zip-recipes.git","clone_url":"https://github.com/hgezim/zip-recipes.git","svn_url":"https://github.com/hgezim/zip-recipes","homepage":null,"size":5135,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"hgezim:master","ref":"master","sha":"f77138a2272b97f4263fc7f073fc1c08e31c3ec2","user":{"login":"hgezim","id":124675,"avatar_url":"https://avatars.githubusercontent.com/u/124675?v=3","gravatar_id":"","url":"https://api.github.com/users/hgezim","html_url":"https://github.com/hgezim","followers_url":"https://api.github.com/users/hgezim/followers","following_url":"https://api.github.com/users/hgezim/following{/other_user}","gists_url":"https://api.github.com/users/hgezim/gists{/gist_id}","starred_url":"https://api.github.com/users/hgezim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgezim/subscriptions","organizations_url":"https://api.github.com/users/hgezim/orgs","repos_url":"https://api.github.com/users/hgezim/repos","events_url":"https://api.github.com/users/hgezim/events{/privacy}","received_events_url":"https://api.github.com/users/hgezim/received_events","type":"User","site_admin":false},"repo":{"id":26945466,"name":"zip-recipes","full_name":"hgezim/zip-recipes","owner":{"login":"hgezim","id":124675,"avatar_url":"https://avatars.githubusercontent.com/u/124675?v=3","gravatar_id":"","url":"https://api.github.com/users/hgezim","html_url":"https://github.com/hgezim","followers_url":"https://api.github.com/users/hgezim/followers","following_url":"https://api.github.com/users/hgezim/following{/other_user}","gists_url":"https://api.github.com/users/hgezim/gists{/gist_id}","starred_url":"https://api.github.com/users/hgezim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgezim/subscriptions","organizations_url":"https://api.github.com/users/hgezim/orgs","repos_url":"https://api.github.com/users/hgezim/repos","events_url":"https://api.github.com/users/hgezim/events{/privacy}","received_events_url":"https://api.github.com/users/hgezim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hgezim/zip-recipes","description":"Zip Recipes WordPress Plugin","fork":false,"url":"https://api.github.com/repos/hgezim/zip-recipes","forks_url":"https://api.github.com/repos/hgezim/zip-recipes/forks","keys_url":"https://api.github.com/repos/hgezim/zip-recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hgezim/zip-recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hgezim/zip-recipes/teams","hooks_url":"https://api.github.com/repos/hgezim/zip-recipes/hooks","issue_events_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/events{/number}","events_url":"https://api.github.com/repos/hgezim/zip-recipes/events","assignees_url":"https://api.github.com/repos/hgezim/zip-recipes/assignees{/user}","branches_url":"https://api.github.com/repos/hgezim/zip-recipes/branches{/branch}","tags_url":"https://api.github.com/repos/hgezim/zip-recipes/tags","blobs_url":"https://api.github.com/repos/hgezim/zip-recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hgezim/zip-recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hgezim/zip-recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/hgezim/zip-recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hgezim/zip-recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/hgezim/zip-recipes/languages","stargazers_url":"https://api.github.com/repos/hgezim/zip-recipes/stargazers","contributors_url":"https://api.github.com/repos/hgezim/zip-recipes/contributors","subscribers_url":"https://api.github.com/repos/hgezim/zip-recipes/subscribers","subscription_url":"https://api.github.com/repos/hgezim/zip-recipes/subscription","commits_url":"https://api.github.com/repos/hgezim/zip-recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/hgezim/zip-recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/hgezim/zip-recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/hgezim/zip-recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/hgezim/zip-recipes/contents/{+path}","compare_url":"https://api.github.com/repos/hgezim/zip-recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hgezim/zip-recipes/merges","archive_url":"https://api.github.com/repos/hgezim/zip-recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hgezim/zip-recipes/downloads","issues_url":"https://api.github.com/repos/hgezim/zip-recipes/issues{/number}","pulls_url":"https://api.github.com/repos/hgezim/zip-recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/hgezim/zip-recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/hgezim/zip-recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hgezim/zip-recipes/labels{/name}","releases_url":"https://api.github.com/repos/hgezim/zip-recipes/releases{/id}","deployments_url":"https://api.github.com/repos/hgezim/zip-recipes/deployments","created_at":"2014-11-21T04:27:49Z","updated_at":"2016-01-18T03:26:40Z","pushed_at":"2016-09-25T14:59:52Z","git_url":"git://github.com/hgezim/zip-recipes.git","ssh_url":"git@github.com:hgezim/zip-recipes.git","clone_url":"https://github.com/hgezim/zip-recipes.git","svn_url":"https://github.com/hgezim/zip-recipes","homepage":null,"size":5135,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51"},"html":{"href":"https://github.com/hgezim/zip-recipes/pull/51"},"issue":{"href":"https://api.github.com/repos/hgezim/zip-recipes/issues/51"},"comments":{"href":"https://api.github.com/repos/hgezim/zip-recipes/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hgezim/zip-recipes/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/hgezim/zip-recipes/statuses/82b7978108be51f392c0d95ee453a565290f19f0"}}}}
{"actor":{"display_login":"Noilleris"}}