");
define("SM_FONT", "");
define("TD", "
");
define("TD2", " | ");
define("TD3", " | ");
define("TABLE", "");
define("VISTABLE", "");
define("TABLE2", "");
define("BG_COLOR", " bgcolor=ffffff ");
define("TITLE_COLOR", " bgcolor=000000 ");
define("TITLE_FONT", " ");
define("BODY_COLOR", " bgcolor=ffffff ");
// Sends the authenticator to the given email address
//
function send_auth_email($email_addr, $auth) {
mail($email_addr, PROJECT." new account confirmation",
"This email confirms the creation of your ".PROJECT." account.
".PROJECT." URL: ".MASTER_URL."
Your account key: $auth\n
Please save this email.
You will need your account key to log in to the ".PROJECT." web site."
);
}
// Initializes the session and returns the authenticator
// for the session (if any)
//
function init_session() {
session_start();
if (!isset($_SESSION["authenticator"])) {
$_SESSION["authenticator"] = $authenticator;
}
return $_SESSION["authenticator"];
}
// if not logged in, put up login form and exit
//
function require_login($user) {
if (!$user) {
print_login_form();
exit();
}
}
function get_user_from_auth($auth) {
if ($auth) return lookup_user_auth($auth);
return NULL;
}
function show_login($user) {
if ($user) {
echo "Logged in as %s.\n", $user->name;
echo " Log in as someone else.\n";
} else {
echo "Not logged in";
}
}
function page_head($title, $user=null) {
echo "$title\n";
project_banner($user);
}
function page_tail() {
echo "
Return to ".PROJECT." main page \n";
// put your copyright notice etc. here
echo "
Copyright (c) 2003 ".PROJECT."\n";
}
function date_str($when) {
return date("g:i A, l M j", $when);
}
function time_str($x) {
if ($x == 0) return "---";
return strftime("%T %b %e, %Y", $x);
}
function start_table() {
echo "";
}
function row($x, $y) {
echo "$x | $y | \n";
}
function row2($x, $y) {
echo "$x | $y | \n";
}
function row2a($x, $y) {
echo "$x | $y | \n";
}
function row3($x, $y, $z) {
echo "$x | $y | $z | \n";
}
function random_string() {
return md5(uniqid(rand()));
}
function print_country_select($country) {
$x = posix_getcwd();
PassThru("$x/country_select '$country'");
}
function print_login_form_aux($next_url) {
echo " |