Esempio n. 1
0
		<p class="mb20"><label class="block" for="i">16x16 icon (png) URL:</label><input id="i" name="i" type="text" size="60" value="<?php 
    echo $icon;
    ?>
" /></p>
		<p class="mb20"><label class="block" for="i32">32x32 icon (png) URL:</label><input id="i32" name="i32" type="text" size="60" value="<?php 
    echo $icon32;
    ?>
" /></p>
		<input name="cmd" type="hidden" value="gen" />
		<br/>
		<p><input class="btn" type="submit" value="Generate Resources" /></p>
    </form>
<?php 
} else {
    if ($cmd == "gen") {
        $gen = new OExchangeGenerator();
        $hostMeta = $gen->generateHostMeta($hostname, $url);
        $targetXrd = $gen->generateTargetXrd($url, $vendor, $title, $name, $prompt, $offer, $icon, $icon32);
        ?>
	<h2>Your Resources</h2>

	<h3>Your Target XRD File:</h3>
	<p>
		The Target XRD describes everything about a Target service, including its name and how it accepts URLs.  This file can be located anywhere, though usually it will live under the service's main path.   From what you told us, in your case that would be:
	</p>
	<p class="bigtext">
		<code><?php 
        echo $url;
        ?>
/oexchange.xrd</code>
	</p>
Esempio n. 2
0
include '../../lib-oexchange/OExchangeGenerator.php';
include '../../lib-oexchange/utils.php';
$hostname = getDfltArg("h", "www.example.com");
$url = getDfltArg("u", "http://www.example.com/coolservice");
$vendor = getDfltArg("v", "Examples Inc");
$title = getDfltArg("t", "A cool service that accepts URLs");
$name = getDfltArg("n", "CoolService");
$prompt = getDfltArg("p", "Share to CoolService");
$offer = getDfltArg("o", "http://www.example.com/coolservice/offer.php");
$icon = getDfltArg("i", "http://www.example.com/assets/icon.png");
$icon32 = getDfltArg("i32", "http://www.example.com/assets/icon32.png");
$file = getDfltArg("file", "unknown");
if ($file == "unknown") {
    header("HTTP/1.0 404 Not Found");
} else {
    if ($file == "txrd") {
        $gen = new OExchangeGenerator();
        $targetXrd = $gen->generateTargetXrd($url, $vendor, $title, $name, $prompt, $offer, $icon, $icon32);
        header("Content-type: application/xml+xrd");
        header("Content-Disposition: attachment; filename=oexchange.xrd");
        echo $targetXrd;
    } else {
        if ($file == "hm") {
            $gen = new OExchangeGenerator();
            $hostMeta = $gen->generateHostMeta($hostname, $url);
            header("Content-type: application/xml+xrd");
            header("Content-Disposition: attachment; filename=host-meta");
            echo $hostMeta;
        }
    }
}