// Is there a link up?
if (!isCrackerTrackerDatabaseLinkUp()) {
// Abort silently here
- return false;
+ return FALSE;
} // END - if
// Is it found?
$SQL = 'INSERT INTO `' . $table . '` (`' . implode('`,`', array_keys($rowData)) . '`) VALUES(' . implode_secure($rowData) . ')';
// Reset insert id
- $GLOBALS['ctracker_last_insert_id'] = false;
+ $GLOBALS['ctracker_last_insert_id'] = FALSE;
// Run it
runCrackerTrackerSql($SQL, __FUNCTION__, __LINE__);
// Checks wether a table was found
function isCrackerTrackerTableCreated ($table) {
// Default is not found
- $found = false;
+ $found = FALSE;
// Run the query
$result = runCrackerTrackerSql('SHOW TABLES', __FUNCTION__, __LINE__);
// Is the table there?
if ($tab == $table) {
// Okay, found. So abort
- $found = true;
+ $found = TRUE;
break;
} // END - if
} // END - if
// Skip this silently if we have not config
if (!isCrackerTrackerDatabaseLinkUp()) {
// Skip this step silently, all is not suspicious
- return false;
+ return FALSE;
} // END - if
// We only need the very last attempt to get!
$found = (mysql_num_rows($result) == 1);
// And again?
- if ($found === true) {
+ if ($found === TRUE) {
// Cache the entry
$GLOBALS['ctracker_last_suspicious_entry'] = mysql_fetch_array($result);
} // END - if
$found = (mysql_num_rows($result) == 1);
// And again?
- if ($found === true) {
+ if ($found === TRUE) {
// Cache the ticket data
$GLOBALS['ctracker_last_ticket'] = mysql_fetch_array($result);
} // END - if
}
// Sends a mail out
-function crackerTrackerSendMail ($mail, $recipient = null, $subject = null) {
+function crackerTrackerSendMail ($mail, $recipient = NULL, $subject = NULL) {
// Construct dummy array
$rowData = array(
'remote_addr' => determineCrackerTrackerRealRemoteAddress(),
print 'Recipient=' . $recipient . '<br />Subject=' . $subject . '<br />Text=<pre>' . $mail . '</pre>';
// All fine
- return true;
+ return TRUE;
} elseif (!is_null($recipient)) {
// Recipient specified
return mail($recipient, $subject, $mail, $GLOBALS['ctracker_header']);
print 'Recipient=' . $recipient . '<br />Subject=' . $subject . '<br />Text=<pre>' . $mail . '</pre>';
// All fine
- return true;
+ return TRUE;
}
}
// Getter for ctracker_debug_enabled
function isCrackerTrackerDebug () {
// Is it set?
- return ((isset($GLOBALS['ctracker_debug_enabled'])) && ($GLOBALS['ctracker_debug_enabled'] === true));
+ return ((isset($GLOBALS['ctracker_debug_enabled'])) && ($GLOBALS['ctracker_debug_enabled'] === TRUE));
}
// Determines the real remote address
} // END - if
// Construct FQFN
- $FQFN = sprintf("%s/language/%s.php",
+ $FQFN = sprintf('%s/language/%s.php',
dirname(__FILE__),
getCrackerTrackerLanguage()
);
$GLOBALS['ctracker_language'] = 'en';
// Construct FQFN again
- $FQFN = sprintf("%s/language/en.php",
- dirname(__FILE__)
- );
+ $FQFN = sprintf('%s/language/en.php', dirname(__FILE__));
} // END - if
// Load the language file
}
// Loads a given email template and passes through $content
-function crackerTrackerLoadEmailTemplate ($template, array $content = array(), $language = null) {
+function crackerTrackerLoadEmailTemplate ($template, array $content = array(), $language = NULL) {
// Init language
crackerTrackerLanguage();
// Generate the FQFN
- $FQFN = sprintf("%s/mails/%s/%s.tpl",
+ $FQFN = sprintf('%s/mails/%s/%s.tpl',
dirname(__FILE__),
getCrackerTrackerLanguage($language),
$template
}
// "Getter" for language
-function getCrackerTrackerLanguage ($lang = null) {
+function getCrackerTrackerLanguage ($lang = NULL) {
// Default is from browser
$language = $GLOBALS['ctracker_language'];
function sendCrackerTrackerCookie () {
// Set the cookie
// @TODO Why can't domain be set to value from crackerTrackerServerName() ?
- setcookie('ctracker_ticket', getCrackerTrackerTicketId(), (time() + 60*60*24), '/', '', crackerTrackerSecured(), true);
+ setcookie('ctracker_ticket', getCrackerTrackerTicketId(), (time() + 60*60*24), '/', '', crackerTrackerSecured(), TRUE);
$_COOKIE['ctracker_ticket'] = getCrackerTrackerTicketId();
}
// check if running on IIS < 6 with CGI-PHP
if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
- (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+ (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== FALSE) &&
(preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
($matches[1] < 6)) {
// Send the IIS header