from functions.php (included in both _list and _body and get's called in _body):
function authbox(){
if(($_SERVER['PHP_AUTH_USER'] == "foo") && ($_SERVER['PHP_AUTH_PW'] == "bar")) {
$_SESSION['auth'] = 1;
} else {
$_SESSION['auth'] = 0;
}
if ($_SESSION['auth'] != 1) {
header( "WWW-Authenticate: Basic realm=\"Authorization Required!\"" );
header( "HTTP/1.0 401 Unauthorized" );
echo "Authorization Required!";
exit();
}
}
from _list: (obviously i have tried reloading this frame after the value has changed)
if ($_SESSION['auth'] == 0 ) {
print '
'; url_link('index_body.php?go=login','Login to Artax.','login'); print '
';
} else {
print '
'; url_link('index_body.php?go=logout','Logout of Artax.','logout'); print '
';
}
print 'auth:"' . $_SESSION['auth'] . '"';