 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Nunners
Joined: 29 Jan 2007 Posts: 1
|
Posted: Mon Jan 29, 2007 2:47 pm Post subject: Auth->setExpire |
|
|
Cannot someone advise me why this isn't working?
| Code: | <?php
require_once("db.php");
require_once("Auth.php");
function login_form() {
?>
<form method="post" action="/index.php" onSubmit="return true;">
<table border="0" cellpadding="2" cellspacing="0" summary="login form" align="center" height="100%" width="100%">
<tr>
<td align="center">
<table align="center" cellpadding="2" cellspacing="0" border="1" bgcolor="#eeeeee">
<tr>
<td>Username:</td>
<td><input type="text" id="username" name="username" value="" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="password" name="password" /></td>
</tr>
<tr>
<td colspan="2" align="right"><input value="Login" id="doLogin" name="doLogin" type="submit" /></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" id="authsecret" name="authsecret" value="" /></form>
<?php
}
$params = array(
"dsn" => $dsn,
"table" => "staff",
"usernamecol" => "username",
"passwordcol" => "password"
);
// A database is used as storage container in this example
$login = new Auth("MDB2", $params, "login_form");
// Detection, if user is logged in. Otherwise the login form
// is being displayed.
$login->start();
$login->setExpire(time()+36000);
if ($disable_auth || $login->getAuth()) {
if(isset($_GET["action"]) && $_GET["action"] == "logout") {
// Log user out
$login->logout();
header("Location: index.php");
exit;
}
$user_defaults = login_user_defaults();
} else {
exit;
}
?>
That's my login include, and once logged in, I've got a test script that print_r's getAuthData() and getStatus(), and it returns nothing...
Any thoughts?
Cheers
Nunners |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|