echo "<h3>Delegate an OpenID</h3>\n";
        echo '<form action="" method="post"><div>';
        echo '<label for="openid_server">Server URI</label> &nbsp;<input type="text" name="openid_server" id="openid_server" value="' . htmlentities($services['OpenID 2.0']['URI']) . '" /><br />';
        echo '<label for="openid_identifier">OpenID URI</label> <input type="text" name="openid_identifier" id="openid_identifier" value="' . htmlentities($services['OpenID 2.0']['LocalID']) . '" /><br />';
        echo '<label for="openid_sreg">Simple Registration?</label> <input type="checkbox" name="openid_sreg" id="openid_sreg" checked="checked" /><br />';
        echo '<input type="submit" value="Save &raquo;" />';
        echo '</div></form>';
        echo "\n</div>";
    }
    //end xrds_page
    function xrds_tab($s)
    {
        add_submenu_page('options-general.php', 'XRDS-Simple', 'XRDS-Simple', 1, __FILE__, 'xrds_page');
        return $s;
    }
    //end function
    add_action('admin_menu', 'xrds_tab');
}
//end if ! included
if (isset($_GET['xrds'])) {
    xrds_write();
} else {
    if (in_array('application/xrds+xml', explode(',', $_SERVER['HTTP_ACCEPT']))) {
        xrds_write();
    } else {
        header('X-XRDS-Location: ' . get_bloginfo('home') . '/?xrds');
        header('X-Yadis-Location: ' . get_bloginfo('home') . '/?xrds');
    }
    //end if header
}
//end if ! in wordpress
示例#2
0
/**
 * Parse the WordPress request.  If the request is for the XRDS document, handle it accordingly.
 *
 * @param object $wp WP instance for the current request
 */
function xrds_parse_request($wp) {
	$accept = explode(',', $_SERVER['HTTP_ACCEPT']);
	if(isset($_GET['xrds']) || in_array('application/xrds+xml', $accept)) {
		header('Content-type: application/xrds+xml');
		echo xrds_write();
		exit;
	} else {
		@header('X-XRDS-Location: '.get_bloginfo('home').'/?xrds');
		@header('X-Yadis-Location: '.get_bloginfo('home').'/?xrds');
	}
}
/**
 * Parse the WordPress request.  If the request is for the XRDS document, handle it accordingly.
 *
 * @param object $wp WP instance for the current request
 */
function xrds_parse_request($wp)
{
    $accept = array();
    if (isset($_SERVER['HTTP_ACCEPT'])) {
        $accept = explode(',', $_SERVER['HTTP_ACCEPT']);
    }
    if (isset($_GET['xrds']) || in_array('application/xrds+xml', $accept)) {
        if (isset($_REQUEST['format']) && $_REQUEST['format'] == 'text') {
            header('Content-type: text/plain');
        } else {
            header('Content-type: application/xrds+xml');
        }
        echo xrds_write();
        exit;
    } else {
        @header('X-XRDS-Location: ' . get_bloginfo('url') . '/?xrds');
        @header('X-Yadis-Location: ' . get_bloginfo('url') . '/?xrds');
    }
}