foreach (split("\n", $res) as $line) { $a = split(": ", $line); $attr[$a[0]] = $a[1]; } ?> <title>ZXID PHP Demo Protected content, logged in</title> <body bgcolor="#330033" text="#ffaaff" link="#ffddff" vlink="#aa44aa" alink="#ffffff"><font face=sans> <? # Optional: Perform additional authorization step # (n.b. zxid_simple() can be configured to make az automatically) $ses = zxid_fetch_ses($cf, $attr['sesid']); if (zxid_az_cf_ses($cf, "Action=Show", $ses)) { echo "Permit.\n"; } else { echo "<b>Deny.</b> Normally page would not be shown, but we show session attributes for debugging purposes.\n"; } ?> <h1>ZXID PHP Demo Protected content, logged in as <?php echo $attr['cn']; ?> , session(<?php echo $attr['sesid']; ?> )</h1> <?php echo zxid_fed_mgmt_cf($cf, null, -1, $attr['sesid'], 0x1900); ?>
switch (substr($res, 0, 1)) { case 'L': header($res); zxid_set_opt_cstr($cf, 4, "wsp: "); exit; # Redirect (Location header) case '<': header('Content-type: text/xml'); echo $res; zxid_set_opt_cstr($cf, 4, "wsp: "); exit; # Metadata or SOAP default: zxid_set_opt_cstr($cf, 4, "wsp: "); die("Unhandled zxid_simple() res($res)"); } } error_log("zxidphp: processing SOAP request "); $ses = zxid_fetch_ses($cf, $attr['sesid']); $nid = zxid_wsp_validate($cf, $ses, null, $qs); error_log("working for nid($nid)"); if (zxid_az_cf_ses($cf, "Action=Call", $ses)) { echo zxid_wsp_decorate($cf, $ses, null, "<barfoo>" + "<lu:Status code=\"OK\" comment=\"Permit\"></lu:Status>" + "<data>nid="+nid+"</data>" + "</barfoo>"); } else { echo zxid_wsp_decorate($cf, $ses, null, "<barfoo>" + "<lu:Status code=\"Fail\" comment=\"Deny\"></lu:Status>" + "<data>Deny: nid="+nid+"</data>" + "</barfoo>"); } zxid_set_opt_cstr($cf, 4, "wsp: ");