) <a href="zxid.php?s=<?php echo $sid; ?> ">Reload</a> </form><hr> <a href="http://zxid.org/">zxid.org</a> <? return 1; } $sid = zxid_cgi_sid_get($cgi) and $ses = zxid_fetch_ses($cf, $sid) and mgmt_screen($cf, $cgi, $ses, $op) and exit; $ses = zxid_fetch_ses($cf, ""); # Just allocate an empty one error_log("Not logged-in case: op($op) ses($ses)", 0); switch ($op) { case 'M': # Invoke LECP or redirect to CDC reader. #if (zxid_lecp_check($cf, $cgi)) exit; header("Location: $cdc_url?o=C"); exit; case 'C': # CDC Read: Common Domain Cookie Reader zxid_cdc_read($cf, $cgi); exit; case 'E': # Return from CDC read, or start here to by-pass CDC read. #if (zxid_lecp_check($cf, $cgi)) exit; if (zxid_cdc_check($cf, $cgi)) exit; break;
# Parse the LDIF in $res into a hash of attributes $attr foreach (split("\n", $res) as $line) { $a = split(": ", $line); $attr[$a[0]] = $a[1]; } ?> <title>ZXID PHP Demo PDS 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