function finish ($flag,$message) { if ($flag == "error") { $subject = "Bounce processing error"; } elseif ($flag == "info") { $subject = "Bounce Processing info"; } if (!TEST && $message) sendReport($subject,$message); }
function finishBounceProcessing($flag, $message) { if ($flag == "error") { $subject = $GLOBALS['I18N']->get("Bounce processing error"); } elseif ($flag == "info") { $subject = $GLOBALS['I18N']->get("Bounce Processing info"); } if (!TEST && $message) { sendReport($subject, $message); } }
function finish($flag, $message) { if ($flag == "error") { $subject = $GLOBALS['I18N']->get("test processing error"); } elseif ($flag == "info") { $subject = $GLOBALS['I18N']->get("test Processing info"); } if (!TEST && $message) { sendReport($subject, $message); } # try..catch global $link; imap_close($link); }
function finish ($flag = "info",$message = "finished") { global $nothingtodo,$failreport,$mailreport,$process_id; if ($flag == "error") { $subject = "Rss Errors"; } else { $subject = "Rss Results"; } releaseLock($process_id); if (!TEST && !$nothingtodo) { if ($mailreport) sendReport($subject,$mailreport); if ($failreport) sendReport("Rss Failure report",$failreport); } }
function finish($flag = "info", $message = 'finished') { global $nothingtodo, $failreport, $mailreport, $process_id; if ($flag == 'error') { $subject = $GLOBALS['I18N']->get('Rss Errors'); } else { $subject = $GLOBALS['I18N']->get('Rss Results'); } releaseLock($process_id); if (!TEST && !$nothingtodo) { if ($mailreport) { sendReport($subject, $mailreport); } if ($failreport) { sendReport($GLOBALS['I18N']->get('Rss Failure report'), $failreport); } } }
function finish($flag, $message, $script_stage) { global $nothingtodo, $counters, $messageid; if ($flag == 'error') { $subject = s('Maillist errors'); } elseif ($flag == 'info') { $subject = s('Maillist Processing info'); } if (!$nothingtodo && !$GLOBALS['inRemoteCall']) { processQueueOutput(s('Finished this run'), 1, 'progress'); print '<script type="text/javascript"> var parentJQuery = window.parent.jQuery; parentJQuery("#progressmeter").updateSendProgress("' . $counters['sent'] . ',' . $counters['total_users_for_message ' . $messageid] . '"); </script>'; } if (!$GLOBALS['inRemoteCall'] && !TEST && !$nothingtodo && SEND_QUEUE_PROCESSING_REPORT) { $reportSent = false; ## @@TODO work out a way to deal with the order of processing the plugins ## as that can make a difference here. foreach ($GLOBALS['plugins'] as $pluginname => $plugin) { if (!$reportSent) { $reportSent = $plugin->sendReport($subject, $message); } } if (!$reportSent) { ## fall back to the central one $message .= "\n\n" . s('To stop receiving these reports read:') . ' https://resources.phplist.com/system/config/send_queue_processing_report' . "\n\n"; sendReport($subject, $message); } } }
} hofTracker($players, $port); // Take off the 3 turns for attacking $player->take_turns(3); $player->update(); // fire shots if (DEBUG) { print "Pre Shots<br>"; } portFires($fleet, $port, $players); fleetFires($fleet, $port, $players, $weapons); //get results in a way we want them $results = processResults($players, $port, $fleet, $weapons); //post on alliances MB or send to player portDowngrade($results, $port); sendReport($results, $port); //log player doLog($results); //insert into combat logs $finalResults = $results[0] . '<br /><img src="images/portAttack.jpg" width="480px" height="330px" alt="Port Attack" title="Port Attack"><br />' . $results[1]; $db->query('INSERT INTO combat_logs VALUES("",' . SmrSession::$game_id . ',"PORT",' . $player->sector_id . ',' . time() . ',' . SmrSession::$old_account_id . ',' . $player->alliance_id . ',0,0,"' . mysql_real_escape_string(gzcompress($finalResults)) . '", "FALSE")'); if (DEBUG) { print "Pre Forward/Display<br>"; } $container = array(); $container["url"] = "skeleton.php"; $container["body"] = "port_attack_new.php"; $container["results"] = $results; if ($players[$player->account_id][KILLER]) { $container['override_death'] = TRUE; }
function finish ($flag,$message) { global $nothingtodo; if (!$GLOBALS["commandline"]) { print '<script language="Javascript" type="text/javascript"> finish(); </script>'; } if ($flag == "error") { $subject = "Maillist Errors"; } elseif ($flag == "info") { $subject = "Maillist Processing info"; } output("Finished"); if (!TEST && !$nothingtodo) sendReport($subject,$message); }
$subject = 'There is no subject'; } return mail($to, $subject, $message, $headers); } // START // I'm ignoring the $_GET data, instead I post a custom key called 'application' from the app if ($_SERVER['REQUEST_METHOD'] == 'POST' && isSupportedAgent($_SERVER['HTTP_USER_AGENT']) && isSupportedApp($_POST['application'])) { $title = createTitle($_POST['application'], $_POST['type'], $_POST['email']); $report = beginningOfReportWithTitle($title) . bodyOfReport($_POST) . endOfReport(); if (!sendReport($title, $report)) { // don't send detailed error reports on the production server //echo 'error with sendReport'; sendReport('Failed sending crash report', 'sendReport() failed'); } // this is to cause the app to not close the feedback report window (good for testing, make sure to comment this out when copying to the production server) //echo 'Testing'; } else { // not a proper feedback request // always send a message of some sort so you can see what a bot is up to if (count($_REQUEST)) { foreach ($_REQUEST as $key => $value) { $keyValues[] = "{$key} = {$value}"; } $message = implode(' | ', $keyValues); sendReport('Failed crash report attempt', cleanerString($message)); } else { sendReport('Failed crash report attempt', 'Someone just visiting or a bot fishing'); } // send them somewhere usefull header('Location: http://your.domain'); }
<?php if (!isset($_SESSION['id'])) { session_start(); } checkIfLogged(); include_once './funcs.php'; include_once './API/georeferencingAccess.php'; include_once './API/calendarAccess.php'; parse_str($_SERVER['QUERY_STRING']); $json = getProfiles(); $profiles = json_decode($json); //file_put_contents("testPost","clean\n"); //$profileID = //atribuido no index //get them tokens //check if post if ($_SERVER['REQUEST_METHOD'] != "POST") { header("HTTP/1.0 404 Not Found"); die("Only Posts\n"); } if ($mail == "_") { $mail = $_SESSION['mail']; } sendReport($_SESSION['token'], $profileID, $mail, $subject, $message, $initDate, $endDate); file_put_contents("11testPost", "token : " . $_SESSION['token'] . "\n" . "profileID : " . $profileID . "\n" . "mail : " . $mail . "\n" . "subject : " . $subject . "\n" . "message : " . $message . "\n" . "initDate : " . $initDate . "\n" . "endDate : " . $endDate . "\n");
define('QUERIES_FILE', realpath(dirname(__FILE__) . '/queries.ini')); define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../../')); require_once ROOT_DIR . '/infra/kConf.php'; if (!kConf::get('usage_tracking_optin')) { echo "Usage tracking is not enabled" . PHP_EOL; die(0); } $post_parameters = queryUsageReport(QUERIES_FILE); $post_parameters['install_id'] = kConf::get('installation_id'); $post_parameters['report_admin_email'] = kConf::get('report_admin_email'); $post_parameters['package_version'] = kConf::get('kaltura_version'); foreach (array_keys($post_parameters) as $key) { echo "{$key} = {$post_parameters[$key]}" . PHP_EOL; } sendReport(kConf::get('usage_tracking_url'), $post_parameters); die(0); // runs all the queries in the $queries_file and return an array with all the post parameters function queryUsageReport($queries_file) { $post_parameters = array(); try { $dbs = kConf::getDB(); $dsn = $dbs['datasources']['dwh']['connection']['dsn']; $queries = parse_ini_file($queries_file, true); $dbh = new PDO($dsn); // perform all the queries for ($i = 0; $i < count($queries['query']); $i++) { $statement = $dbh->query($queries['query'][$i]); if ($statement === false) { echo "Failed to execute query: " . $queries['query'][$i] . PHP_EOL;
$db = Database::getDatabase(); foreach ($_POST as $key => $val) { $_POST[$key] = mysql_real_escape_string($val, $db->db); } $dt = date('Y-m-d H:i:s'); $query = "INSERT INTO feedback (appname, appversion, systemversion, email, reply, `type`, message, importance, critical, dt, ip, `new`, reguser, regmail) VALUES\n ('{$_POST['appname']}',\n '{$_POST['appversion']}',\n '{$_POST['systemversion']}',\n '{$_POST['email']}',\n '{$_POST['reply']}',\n '{$_POST['type']}',\n '{$_POST['message']}',\n '{$_POST['importance']}',\n '{$_POST['critical']}',\n '{$dt}',\n '{$_SERVER['REMOTE_ADDR']}',\n '1',\n '{$_POST['reguser']}',\n\t\t\t\t '{$_POST['regmail']}')"; mysql_query($query, $db->db) or die('error'); $feedback_id = $db->insertId(); $app_id = DBObject::glob('Application', "SELECT id FROM applications WHERE name = '{$_POST['appname']}' "); $app = new Application($app_id); // if (!is_null($app->of_email_notify)) { // Format email to external system $full_url = full_url_for_page('feedback-view.php'); $message = "{$_POST['type']} case: " . "{$full_url}?id={$feedback_id} \r\n"; $message .= "Message: {$_POST['message']}\r\n"; $message .= "Importance: {$_POST['importance']}\r\n"; $message .= "Application Name: {$_POST['appname']}\r\n"; $message .= "Version:{$_POST['appversion']}\r\n"; $message .= "System Version:{$_POST['systemversion']}\r\n"; $message .= "Type:{$_POST['type']}\r\n"; $message .= "Message:{$_POST['message']}\r\n"; $message .= "Importance:{$_POST['importance']}\r\n"; $message .= "Criticality:{$_POST['critical']}\r\n"; if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\\.[a-zA-Z.]{2,5}$', $_POST['email'])) { $email = $_POST['email']; } else { $email = '*****@*****.**'; } sendReport($email, "Feedback from {$app->name}", $message); // } echo "ok";
$matches = array(); if (preg_match('#^album_([0-9])$#', $target, $matches)) { $album = new Album($matches[1]); } } if (!$album) { // Find album (and create if not exists) $album = Album::findByTitle('Mobile uploads', true); } $pictures = $album->addPictures($subject, $body, $pictureAttachments); $requestType = "album update"; if (!$target) { // Automatically post social updates for album Mobile Uploads // @todo: make configurable whether publication is desired or not (maybe album property?) // @todo: each blog should have it's own album, or socialupdate can/should include album/picture $connections = $user->connections(); foreach ($connections as $connection) { $rs = $connection->postAlbum($album, $pictures); $notices[] = print_r($rs, true); } } $notices[] = "Album URL:" . PHP_EOL . $album->url() . PHP_EOL; $notices[] = print_r($pictures, true); } else { if (!isset($target)) { $requestType = "status update"; SocialUpdate::postStatus($user, $body); } } sendReport($sender, $errors, $notices);
processNews($fleet, $planet); hofTracker($players, $planet); // Take off the 3 turns for attacking $player->take_turns(3); $player->update(); // fire shots if (DEBUG) { print "Pre Shots<br>"; } planetFires($fleet, $planet, $players); fleetFires($fleet, $planet, $players, $weapons); //get results in a way we want them $results = processResults($players, $planet, $fleet, $weapons); //post on alliances MB or send to player planetDowngrade($results, $planet); sendReport($results, $planet); //log player doLog($results); //insert into combat logs $db->query("SELECT alliance_id FROM player WHERE account_id = " . $planet[OWNER] . " AND game_id = {$player->game_id} LIMIT 1"); $db->next_record(); $ownerAlliance = $db->f("alliance_id"); $finalResults = $results[0] . '<br /><img src="images/planetAttack.jpg" alt="Planet Attack" title="Planet Attack"><br />' . $results[1]; $db->query('INSERT INTO combat_logs VALUES("",' . SmrSession::$game_id . ',"PLANET",' . $player->sector_id . ',' . time() . ',' . SmrSession::$old_account_id . ',' . $player->alliance_id . ',' . $planet[OWNER] . ',' . $ownerAlliance . ',"' . mysql_real_escape_string(gzcompress($finalResults)) . '", "FALSE")'); if (DEBUG) { print "Pre Forward/Display<br>"; } $container = array(); $container["url"] = "skeleton.php"; $container["body"] = "planet_attack.php"; $container["results"] = $results;
function finish($flag, $message) { global $nothingtodo; if (!$GLOBALS["commandline"]) { print '<script language="Javascript" type="text/javascript"> finish(); </script>'; } if ($flag == "error") { $subject = "Maillist Errors"; } elseif ($flag == "info") { $subject = "Maillist Processing info"; } if (!$nothingtodo) { output($GLOBALS['I18N']->get('Finished this run')); } if (!TEST && !$nothingtodo && SEND_QUEUE_PROCESSING_REPORT) { sendReport($subject, $message); } }
$_POST[$key] = mysql_real_escape_string($val, $db->db); } $dt = date('Y-m-d H:i:s'); $query = "INSERT INTO feedback (appname, appversion, systemversion, email, reply, `type`, message, importance, critical, dt, ip, `new`, reguser, regmail) VALUES\n ('{$_POST['appname']}',\n '{$_POST['appversion']}',\n '{$_POST['systemversion']}',\n '{$_POST['email']}',\n '{$_POST['reply']}',\n '{$_POST['type']}',\n '{$_POST['message']}',\n '{$_POST['importance']}',\n '{$_POST['critical']}',\n '{$dt}',\n '{$_SERVER['REMOTE_ADDR']}',\n '1',\n '{$_POST['reguser']}',\n '{$_POST['regmail']}')"; mysql_query($query, $db->db) or die('error'); $feedback_id = $db->insertId(); $app_id = DBObject::glob('Application', "SELECT id FROM applications WHERE name = '{$_POST['appname']}' "); $app = new Application($app_id); // if (!is_null($app->of_email_notify)) { // Format email to external system $full_url = full_url_for_page('feedback-view.php'); $message = "{$_POST['type']} case: " . "{$full_url}?id={$feedback_id} \n"; $message .= "Importance: {$_POST['importance']}\n"; $message .= "Application Name: {$_POST['appname']}\n"; $message .= "Version:{$_POST['appversion']}\n"; $message .= "System Version:{$_POST['systemversion']}\n"; $message .= "Type:{$_POST['type']}\n"; $msg = str_replace("\\n", "\n", $_POST['message']); $message .= "Message:" . $msg . "\n"; $message .= "Importance:{$_POST['importance']}\n"; $message .= "Criticality:{$_POST['critical']}\n"; // error_log(str_hex($_POST['message'])); // error_log($msg); if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\\.[a-zA-Z.]{2,5}$', $_POST['email'])) { $email = $_POST['email']; } else { $email = '*****@*****.**'; } sendReport($email, "Feedback from {$_POST['appname']}", $message); // } echo "ok";
<?php include 'includes/header.php'; require_once DIR_APP . 'projects.php'; require_once DIR_APP . 'users.php'; if (empty($_SESSION['logged_in'])) { redirect('index.php'); } if (isset($_POST['send_report'])) { sendReport($_POST); } ?> <div class="inner-page-wrapper"> <div class="connection inner-page content"> <?php include DIR_INCLUDE . 'left_nav.php'; ?> <div class="main-content"> <ul class="router-top-nav"> <li><a href="account.php">Account</a></li> <li><a href="privacy.php">Privacy</a></li> <li><a href="payment.php">Payment</a></li> <li class="active"><a href="report.php">Report</a></li> <li class="logout"><a href="logout.php">Logout</a></li> </ul>