Create New Account
". "". "". "
Your real name:". "
Your gender:". "Male". "Female
Your location:
Verify Password:
Your avatar:
"; for ($i = 0; $i < $avatarmax; $i++) { $a = "display: inline-block; width: " . $avatarsize . "px; height: " . $avatarsize . "px; background: " . "url('" . $avatarurl . "') no-repeat -" . ($i * $avatarsize) . "px 0px;"; $s = "
"; $retval .= $s . "

"; } $retval .= "
"; return pmapi_output_cleaner($retval); } if($_REQUEST['pmpage'] == "PMCreate" ) { global $pmapi_create_api; if ($pmapi_create_api -> Result == "Ok") return "Success!
" . pmapi_userinfo_form(); return "Error: " . $pmapi_create_api -> Error . "
Click Back Button to correct."; } if($_REQUEST['pmpage'] == "PMUpdate" ) { global $pmapi_update_api; if ($pmapi_update_api -> Result == "Ok") return "Account Updated
" . pmapi_userinfo_form(); return "Error: " . $pmapi_update_api -> Error . "
" . pmapi_userinfo_form(); } if($_REQUEST['pmpage'] == "PMAPI_Validate" ) { if(!is_user_logged_in()) return "Please Sign In to use this function."; $retval = "

Poker Server Account Validation

". "You must validate you own this poker account.
". "This password may be different than your Website password.
". "
". "". "
Poker Account Password:
"; return pmapi_output_cleaner($retval); } if($_REQUEST['pmpage'] == "PMAPI_Validate_Check" ) { global $pmapi_validate; if ($pmapi_validate -> Result == "Ok") return "Success, Now Play!
" . pmapi_play_button(); return "Error: " . $pmapi_validate -> Error . "
Go back and try again."; return pmapi_output_cleaner($retval); } return "Page Contents Not Found."; } return $content; } function pmapi_title_filter($title) { if(isset($_REQUEST['pmpage']) && in_the_loop()) { if($_REQUEST['pmpage'] == "setup") return 'Account Setup'; if($_REQUEST['pmpage'] == "PMCreate") return 'Setup Results:'; if($_REQUEST['pmpage'] == "PMUpdate") return 'Settings:'; return "Page"; } return $title; } function pmapi_do_first() { if($_REQUEST['pmpage'] == "PMCreate" ) { $current_user = wp_get_current_user(); global $pmapi_create_api; $Password = $_REQUEST["Password"]; if (!wp_check_password($Password, $current_user -> user_pass, $current_user -> user_id)) { $pmapi_create_api = (object) array("Result" => "Error", "Error" => "Bad Password."); return; } $Player = $current_user->user_login; $RealName = $_REQUEST["RealName"]; $Gender = $_REQUEST["Gender"]; $Location = $_REQUEST["Location"]; $Email = $current_user->user_email;; $Avatar = $_REQUEST["Avatar"]; $params = array("Command" => "AccountsAdd", "Player" => $Player, "RealName" => $RealName, "PW" => $Password, "Location" => $Location, "Email" => $Email, "Avatar" => $Avatar, "Gender" => $Gender, "Chat" => "Yes", "Custom" => $current_user -> user_pass, "Note" => "Account created via API"); $pmapi_create_api = PMAPI_Poker_API($params); } if($_REQUEST['pmpage'] == "PMUpdate" ) { global $pmapi_update_api; $Player = pmapi_CurrentWPUser(); $RealName = $_REQUEST["RealName"]; $Gender = $_REQUEST["Gender"]; $Location = $_REQUEST["Location"]; $Email = $current_user->user_email;; $Avatar = $_REQUEST["Avatar"]; $params = array("Command" => "AccountsEdit", "Player" => $Player, "RealName" => $RealName, "Location" => $Location, "Email" => $Email, "Avatar" => $Avatar, "Gender" => $Gender); $pmapi_update_api = PMAPI_Poker_API($params); } if($_REQUEST['pmpage'] == "PMAPI_Validate_Check" ) { global $pmapi_validate; $Password = $_REQUEST["Password"]; $Player = pmapi_CurrentWPUser(); $params = array("Command" => "AccountsPassword", "Player" => $Player, "PW" => $Password); $pmapi_validate = PMAPI_Poker_API($params); if($pmapi_validate->Result=="Ok") { if($pmapi_validate->Verified=="Yes") { $current_user = wp_get_current_user(); $params = array("Command" => "AccountsEdit", "Player" => $Player, "Custom" => $current_user -> user_pass); $pmapi_validate = PMAPI_Poker_API($params); update_user_meta($current_user->ID, "pmapi_oldpwhash", $current_user->user_pass); } else $pmapi_validate = (object) array('Result' => 'Error', 'Error' => 'Password Missmatch, Sorry :(...'); } } } add_filter( 'the_content', 'pmapi_content_filter'); add_filter( 'the_title', 'pmapi_title_filter'); add_action( 'init', 'pmapi_do_first'); ?>