function plugin_typekey_action() { global $vars, $auth_api; if (!function_exists('pkwk_session_start')) { return ''; } if (pkwk_session_start() == 0) { return ''; } if (empty($auth_api['typekey']['site_token'])) { return ''; } $obj = new auth_typekey(); $obj->set_regkeys(); $obj->set_need_email($auth_api['typekey']['need_email']); $obj->set_sigKey($vars); $page = empty($vars['page']) ? '' : $vars['page']; if (!$obj->auth()) { if (isset($vars['logout'])) { $obj->auth_session_unset(); } header('Location: ' . get_page_location_uri($page)); die; } // 認証成功 $obj->auth_session_put(); header('Location: ' . get_page_location_uri($page)); die; }