/** * Called automatically by PHP before tests are run */ public function setUp() { Diesel::reset(); GlobalFunctions::reset(); }
public function testDefaultsNotAllowedWhileTesting() { $this->assertThrows('\\Bart\\GlobalFunctionsException', 'No method stub registered for sleep', function () { GlobalFunctions::sleep(); }); }
if ($user->surname == "Ghyselinck") { $_SESSION['accesslevel'] = "ct"; $_SESSION['country'] = "NL"; } unset($_SESSION['authenticating']); header('Location:' . "index.php"); exit(0); } } catch (Exception $e) { $error = new Error($e->getMessage(), "Login.php"); $_SESSION['error'] = $error; GlobalFunctions::Redirect("Show_error.php"); } $error = new Error("Invalid Username/Password combination", "Login.php"); $_SESSION['error'] = $error; GlobalFunctions::Redirect("Show_error.php"); /* $root = $_SERVER['DOCUMENT_ROOT']; require_once("$root/Data/SQL_Config.php"); $table = $_SESSION["table"]; $loginField = $_SESSION["loginf"]; $passwordField = $_SESSION["paswf"]; $MD5 = $_SESSION["MD5"]; $sql = mysql_query("select $passwordField from $table where $loginField='".$_POST["login"]."'") or die ( mysql_error( ) ); $passwd = ""; $i=0; while($record = mysql_fetch_object($sql)){ $passwd = $record->$passwordField;
function send_email($_to = '', $_subject = '', $_body = '', $_cc = array(), $_bcc = array(), $_from = '*****@*****.**', $_fromName = 'Terroni') { require_once 'class/PHPMailer/class.phpmailer.php'; $m_return = true; if (!GlobalFunctions::CompareStrings(WP_ENV, 'dev')) { try { $email = new PHPMailer(); $email->From = $_from; $email->FromName = $_fromName; $email->addAddress($_to); $email->Subject = $_subject; $email->Body = $_body; $email->isHTML(true); // add CC foreach ($_cc as $item) { $email->addCC($item); } // add BCC foreach ($_bcc as $item) { $email->addBCC($item); } if (!$email->send()) { error_log(sprintf('Email: Could not send email for %s to %s', $_subject, $_to)); $m_return = false; } // if } catch (Exception $e) { error_log(sprintf('Email: Error trying to send email for %s to %s. Msg: %s', $_subject, $_to, $e->getMessage())); $m_return = false; } // try/catch } else { // print the body echo $_body; } return $m_return; }
$finalAddress .= ' / ' . $address; } } else { if (strlen($address) > 0) { // final look $finalAddress = $address; } } echo $finalAddress; ?> </address> <?php if (strlen($telephone = get_field('location_info_telephone')) > 0) { ?> <?php echo sprintf(HTML_TEMPLATE_ANCHOR, 'tel:' . $telephone, 'Click here to call us at' . $telephone, ' class="location-reservation-telephone"', GlobalFunctions::FormatPhone($telephone)); ?> <?php } ?> <div class="clearfix"></div> <?php if (strlen($openTableId) > 0) { ?> <a href="javascript:void(0);" title="Make a Reservation at <?php echo $textTop . ' ' . $textBottom; ?> " class="btn-reservations">Reservations</a> <?php } ?>