/* This is a list of valid users, normally this information would be saved
in the database, where it can be easily updated (so users can set there
own passwords) */
if (user_name == "")
user_name = "anonymous";
switch (user_name) {
case 'elvis':
if (password = "the king")
goto user_ok;
break;
case 'bill':
if (password = "microsoft")
goto user_ok;
break;
case 'anonymous':
if (has_access)
goto user_ok;
break;
default:
has_access = $false;
print varbin $null, "REDIRECT", "WebDAL.acgi$error.html";
break;
}
has_access = $false;
print varbin $null, "REDIRECT", "WebDAL.acgi$passworderror.html";
/* This label is used to jump over the redirect above: */
label user_ok: ;
/* A valid user has logged in. */
/* Check this value at the top of all subsequent pages returned. */
has_access = $true;
Welcome Page
Welcome print user_name;
The time is: print $now();
Links on this page point to pages that are now accessable by all varified users. All such pages must be returned by WebDAL. All these pages should check the value of the DAL variable 'has_access'.
For example, you may now access this page: privileged information...
In order to demonstrate another feature, this link refers to a page that is only accessable from this page: only accessable from Welcome Page...