Пример #1
0
function selectList($list, $param)
{
    $V = array();
    $url = sprintf("%s/lookup.list?key=%s", apiURL(), myUrlencode($list));
    if ($param != "") {
        $url = $url . sprintf("&param=%s", myUrlencode($param));
    }
    $result = getRequest($url);
    if ($result != "") {
        $xml = new SimpleXMLElement($result);
        $items = $xml->xpath("/items/item");
        $N = 1;
        foreach ($items as $S) {
            if ($S != "0") {
                $V[$N] = $S;
            }
            $N++;
        }
    }
    return $V;
}
Пример #2
0
    <br/>
    <div>
      <form method="get">
	      <input type="checkbox" value="true" name="expiration" id="expiration" />  <label for="expiration">Check Certificate Expiration</label><br />
        <input type="submit" name="go" value="Check"/>
      </form>
    </div>
    <?php 
if ($_webid != '' || $_error != '') {
    ?>
      <div>
      	The return values are:
  	    <ul>
          <?php 
    if ($_webid != '') {
        $_proxyIri = getRequest(sprintf("%s/iri2proxy?iri=%s", apiURL(), urlencode($_webid)));
        ?>
  	      <li>WebID -  <?php 
        print sprintf('<a href="%s">%s</a>', $_proxyIri, $_proxyIri);
        ?>
</li>
  	      <li>Timestamp in ISO 8601 format - <?php 
        print $_REQUEST['ts'];
        ?>
</li>
          <?php 
    } else {
        if ($_error != '') {
            ?>
  	      <li>Error - <?php 
            print $_error;
Пример #3
0
function apiURL()
{
    $pageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
    $pageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] : $_SERVER['SERVER_NAME'];
    return $pageURL . '/tutorial/webid/webid_demo.php';
}
$_webid = isset($_REQUEST['webid']) ? $_REQUEST['webid'] : '';
$_error = isset($_REQUEST['error']) ? $_REQUEST['error'] : '';
$_action = isset($_REQUEST['go']) ? $_REQUEST['go'] : '';
if ($_webid == '' && $_error == '') {
    if ($_action != '') {
        if ($_SERVER['HTTPS'] != 'on') {
            $_error = 'No certificate';
        } else {
            $_callback = apiURL();
            $_url = sprintf('https://id.myopenlink.net/ods/webid_verify.vsp?callback=%s', urlencode($_callback));
            header(sprintf('Location: %s', $_url));
            return;
        }
    }
}
?>
<html>
  <head>
    <title>WebID Verification Demo - PHP</title>
    <style type="text/css">
      body {
      	background-color: white;
      	color: black;
      	font-size: 10pt;