if (isCrackerTrackerDatabaseLinkUp()) {
// Did it work?
if (!mysql_close($GLOBALS['ctracker_link'])) {
- // Remove the link from global array
- unset($GLOBALS['ctracker_link']);
+ // Remove all data from global space
+ unsetCtrackerData();
// Attempt has failed
crackerTrackerDatabaseError(__FUNCTION__, __LINE__);
} // END - if
} // END - if
- // Remove the link from global array
- unset($GLOBALS['ctracker_link']);
+ // Remove all data from global space
+ unsetCtrackerData();
}
// Inserts given array, if IP/check_worm combination was not found
* @access private
*/
function crackerTrackerSendRawRedirect ($url) {
+ // Better remove any data by ctracker
+ unsetCtrackerData();
+
// always close the session
session_write_close();
exit();
}
+// Removes all ctracker-related data from global space
+function unsetCtrackerData () {
+ // Unset all
+ foreach (array(
+ 'ctracker_host',
+ 'ctracker_dbname',
+ 'ctracker_user',
+ 'ctracker_password',
+ 'ctracker_debug_enabled',
+ 'ctracker_email',
+ 'ctracker_whitelist',
+ 'ctracker_get_blacklist',
+ 'ctracker_post_blacklist',
+ 'ctracker_header',
+ 'ctracker_post_track',
+ 'ctracker_checkworm',
+ 'ctracker_check_post',
+ 'ctracker_last_sql',
+ 'ctracker_last_result',
+ 'ctracker_config',
+ 'ctracker_updates',
+ ) as $key) {
+ // Unset it
+ unset($GLOBALS[$key]);
+ } // END - foreach
+}
+
// [EOF]
?>