]> git.mxchange.org Git - ctracker.git/commitdiff
Fixes... :(
authorRoland Haeder <roland@mxchange.org>
Tue, 11 May 2010 08:09:48 +0000 (08:09 +0000)
committerRoland Haeder <roland@mxchange.org>
Tue, 11 May 2010 08:09:48 +0000 (08:09 +0000)
libs/lib_connect.php
libs/lib_detector.php

index 175fcbf97bf6566d8a265ac5f603af2edc3cab7e..37474162e5dce1a20fe2a1e117746af2c3a6f309 100644 (file)
@@ -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);
 
index be64007b4907a2c87a229c3e0e2cf4856cf02f92..187a28a97b4e98b0baa50701b3d11888cee46a22 100644 (file)
@@ -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 '<pre>';
-       debug_print_backtrace();
-       die('</pre>');
-       die();
+       if (isCrackerTrackerDebug()) {
+               // With debug backtrace
+               print '<pre>';
+               debug_print_backtrace();
+               die('</pre>');
+       } 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');