From 44db892ed07be7e85461cb598f8bdcf7f18c47ac Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 11 May 2010 08:09:48 +0000 Subject: [PATCH] Fixes... :( --- libs/lib_connect.php | 7 +++++-- libs/lib_detector.php | 33 ++++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/libs/lib_connect.php b/libs/lib_connect.php index 175fcbf..3747416 100644 --- a/libs/lib_connect.php +++ b/libs/lib_connect.php @@ -340,13 +340,16 @@ function addCrackerTrackerTicket (array $data) { if ((isset($GLOBALS['ctracker_last_insert_id'])) && ($GLOBALS['ctracker_last_insert_id'] > 0)) { // All fine, so prepare the link between ticket<->data $data = array( - 'ctracker_ticket' => $GLOBALS['ctracker_last_insert_id'], - 'ctracker_data_id' => $GLOBALS['ctracker_last_suspicious_entry']['id'] + 'ctracker_ticket_id' => $GLOBALS['ctracker_last_insert_id'], + 'ctracker_data_id' => $GLOBALS['ctracker_last_suspicious_entry']['id'] ); // And insert it as well crackerTrackerInsertArray('ctracker_ticket_data', $data); + // Add ticket id again + $GLOBALS['ctracker_ticket'] = $data['ctracker_ticket_id']; + // Merge all data for emails $GLOBALS['ctracker_last_ticket'] = array_merge($GLOBALS['ctracker_last_ticket'], $data); diff --git a/libs/lib_detector.php b/libs/lib_detector.php index be64007..187a28a 100644 --- a/libs/lib_detector.php +++ b/libs/lib_detector.php @@ -81,7 +81,7 @@ function initCrackerTrackerArrays () { ); // Load email header - $GLOBALS['ctracker_header'] = crackerTrackerLoadEmaiLTemplate('header'); + $GLOBALS['ctracker_header'] = crackerTrackerLoadEmailTemplate('header'); } // Checks for worms @@ -131,6 +131,21 @@ Referrer : ".crackerTrackerReferer()." crackerTrackerDie(); } +// Sends the ticket emails out +function sendCrackerTrackerTicketMails () { + // Load user template + $mail = crackerTrackerLoadEmailTemplate('user_add_ticket', $GLOBALS['ctracker_last_ticket']); + + // Send email to the user + crackerTrackerSendMail($mail, $GLOBALS['ctracker_last_ticket']['ctracker_ticket_email'], getCrackerTrackerLocalized('user_add_ticket_subject')); + + // Load webmaster template + $mail = crackerTrackerLoadEmailTemplate('webmaster_add_ticket', $GLOBALS['ctracker_last_ticket'], getCrackerTrackerConfig('ctracker_language')); + + // Send email to the user + crackerTrackerSendMail($mail, null, getCrackerTrackerLocalized('webmaster_add_ticket_subject')); +} + // Sends a mail out function crackerTrackerSendMail ($mail, $recipient = null, $subject = null) { // Construct dummy array @@ -199,10 +214,15 @@ function crackerTrackerDie () { if (!isCrackerTrackerDebug()) sleep(mt_rand(10,30)); // Bye, bye... - print '
';
-	debug_print_backtrace();
-	die('
'); - die(); + if (isCrackerTrackerDebug()) { + // With debug backtrace + print '
';
+		debug_print_backtrace();
+		die('
'); + } else { + // Simple die() + die(); + } } // Logs the attack attempt @@ -260,6 +280,9 @@ function crackerTrackerAlertCurrentUser () { } elseif (isset($_POST['ctracker_add_ticket'])) { // Add the ticket addCrackerTrackerTicket($_POST); + + // Send the email out + sendCrackerTrackerTicketMails(); } else { // Display the form for new ticket crackerTrackerLoadTemplate('add_ticket'); -- 2.39.5