require_once("print_functions.php");
require_once("html_functions.php");
require_once("emailhide.php");
/*function isLoggedIn() {
return $_COOKIE['loggedIn'] == $GLOBALS['sLoginUser'];
}*/
function setID($rand=false) {
global $numJokes;
$id = $_REQUEST['id'];
if (!$id)
$id = $_REQUEST['ID'];
if (!is_numeric($id)) {
if ($id != "") {
logFakeID($id);
exit();
}
if ($rand)
$id = rand(1,$numJokes);
}
return $id;
}
function logFakeID($id) {
global $website_testing, $obj_mailer, $site_name;
$info['fakeID'] = $id;
echo $id;
$info['date'] = date('Y-m-d H:i:s');
$request_string = "
REQUEST VARS";
$request_string .= print_ar_to_string($_REQUEST);
foreach($_REQUEST as $key=>$r)
$request_string .= "$key = $r
";
$server_string = "
SERVER VARS";
$server_string .= print_ar_to_string($_SERVER);
foreach($_SERVER as $key=>$s)
$server_string .= "$key = $s
";
$env_string = "
ENV VARS";
$env_string .= print_ar_to_string($_ENV);
foreach($_ENV as $key=>$s)
$env_string .= "$key = $s
";
$message = "A non-existent ID was enetered in the Glatt Kosher Humor joke page: $_SERVER[PHP_SELF].
\n" .
"The date was: {$info['date']}.
\n" .
"The ID was: {$info['fakeID']}.
\n" .
$request_string .
$server_string .
$env_string;
if ($website_testing)
echo $message;
else {
$GLOBALS['obj_mailer']->quick_send($GLOBALS['error_to_address'],"Fake ID in {$GLOBALS['site_name']}",$message);
//db_insert("fakeIDs",$info);
}
}
function LoadLib_PHPMailer()
{
global $sPHPMAILER_PATH;
// Check if the Config.php given path is absolute
if ($sPHPMAILER_PATH{0} == "/" || substr($sPHPMAILER_PATH,1,2) == ":\\")
$sPHPMAILERpath = $sPHPMAILER_PATH . "/";
else
$sPHPMAILERpath = "./" . $sPHPMAILER_PATH . "/";
if (!is_readable($sPHPMAILERpath . "class.phpmailer.php"))
{
$sPHPMAILERpath = "../" . $sPHPMAILER_PATH . "/";
}
// If PHPMailer is not found at user specified path, fall back to PHP include_path, or else exit with error.
if (!is_readable($sPHPMAILERpath . "class.phpmailer.php"))
{
if (is_readable('class.phpmailer.php'))
$sPHPMAILERpath= "";
else {
echo "