Location: PHPKode > projects > Mummi (Multi-user MOD_MP3 Interface) > mummi.0.6/htroot/common.php
<?

//  This get the document root specified in the virtual host of apache
$GLOBALS[int_path] = getenv(DOCUMENT_ROOT);

// This will be changed to look at a file that the user can set the prefrence of.
$GLOBALS[lib_path] = "$GLOBALS[int_path]/../lib";

include "$GLOBALS[lib_path]/config.inc";
include "$GLOBALS[lib_path]/mysql.inc";
include "$GLOBALS[lib_path]/overseer.inc";

$os = new OVERSEER;
$os->connect("$GLOBALS[dbhost]","$GLOBALS[dbusername]","$GLOBALS[dbuserpassword]","$GLOBALS[dbname]");


//echo "starting cookie chk<br>\n";
if($HTTP_COOKIE_VARS[login_active]){
	if(!$session_array = $os->decipher($HTTP_COOKIE_VARS[login_active], $GLOBALS[secret_key])) header("Location: $GLOBALS[url_path]/login.php");
	elseif(!$os->num_rows("SELECT user_name FROM users WHERE user_name='$session_array[user_name]'")) header("Location: $GLOBALS[url_path]/login.php");
	elseif(!$cipher_text = $os->encipher(array(user_name=>"$session_array[user_name]",time=>$GLOBALS[current_utime]), $GLOBALS[secret_key])) header("Location: $GLOBALS[url_path]/login.php");
	elseif(!setcookie("login_active",$cipher_text)) header("Location: $GLOBALS[url_path]/login.php");
	$os->db_log($session_array[user_name]);
}else header("Location: $GLOBALS[url_path]/login.php?redirect_url=$GLOBALS[url_path]$PHP_SELF");

?>
Return current item: Mummi (Multi-user MOD_MP3 Interface)