<?php
######################################################################################
#
# Simple test Script for class: ooauth
#
# (c) Heiko at dillemuth . de, 2004-07-01, 2004-07-20
######################################################################################
include "class_ooauth.php";
#Which var will be tracked?
$ooauth_remote_addr=& $_SERVER['REMOTE_ADDR'];
#Init Session as Projekt: "test_session"
$s=& new ooauth("test_session");
print "<body><pre>";
#Print Debugs
#$s->set_debug(true);
#Store Var within Session, test
$s->set_uvar("money", "200,--");
#Simple Password/User Test :-)
if($_REQUEST[loginname]=="admin" and $_REQUEST[password]=="password") {
#Create new session, Timeout 5 Sek.,
#and take a look at Server Var $HTTP_HOST
print "<br>:new session:".$s->new_session(5, "ooauth_remote_addr");
}
#Wait 2 Sek., increase to test the timeout
sleep(2);
#Got Timeout or Error?
if($ooauth->test_session(5)) {
header("Location: http://www.phpclasses.org\n\n"); #Redirect if not valid session
exit();
}
print "<hr>no timeout<p>";
print_r( $s->get_uvar("money"));
exit(0);
?>
|