$content = $lang->get_mail('admin_confirmed'); xmail(array('0' => array('mail' => $row['mail'])), array(), $content['title'], $content['comment']); ok('admin.php?action=members&job=activate', $lang->phrase('admin_member_member_confirmed')); } elseif ($job == 'confirm2') { echo head(); $id = $gpc->get('id', int); $result = $db->query('SELECT id, name, mail FROM '.$db->pre.'user WHERE id = "'.$id.'" LIMIT 1'); $row = $db->fetch_assoc($result); $db->query("UPDATE {$db->pre}user SET confirm = '11' WHERE id = '{$id}' LIMIT 1"); $content = $lang->get_mail('admin_confirmed'); xmail(array('0' => array('mail' => $row['mail'])), array(), $content['title'], $content['comment']); ok('admin.php?action=members&job=activate', $lang->phrase('admin_member_member_activated_completely')); } elseif ($job == 'ips') { $username = $gpc->get('username', str); $ipaddress = $gpc->get('ipaddress', str); $userid = $gpc->get('id', int); echo head(); if (!empty($username)) { $result = $db->query("SELECT id, name FROM {$db->pre}user WHERE name = '{$username}' LIMIT 1"); $userinfo = $db->fetch_assoc($result); $userid = $userinfo['id']; if (!is_id($userid)) { error('admin.php?action=members&job=ip', $lang->phrase('admin_member_invalid_user'));
$anz += $db->affected_rows(); if ($_POST['temp'] == 1) { $db->query("INSERT INTO {$db->pre}topics SET status = '2', topic = '" . $gpc->save_str($old['topic']) . "', board='{$info['board']}', name = '" . $gpc->save_str($old['name']) . "', date = '{$old['date']}', last_name = '" . $gpc->save_str($info['last_name']) . "', prefix = '{$info['prefix']}', last = '{$old['date']}', vquestion = ''", __LINE__, __FILE__); $tid = $db->insert_id(); $db->query("INSERT INTO {$db->pre}replies SET tstart = '1', topic_id = '{$tid}', comment = '{$info['id']}', topic = '" . $gpc->save_str($old['topic']) . "', board='{$info['board']}', name = '" . $gpc->save_str($old['name']) . "', email = '{$old['email']}', date = '{$old['date']}', guest = '{$old['guest']}', edit = '', report = ''", __LINE__, __FILE__); } if ($_POST['temp2'] == 1) { $old = $gpc->plain_str($old); if ($old['guest'] == 0) { $old['email'] = $old['uemail']; $old['name'] = $old['uname']; } $data = $lang->get_mail('topic_moved'); $to = array('0' => array('name' => $old['name'], 'mail' => $old['email'])); $from = array(); xmail($to, $from, $data['title'], $data['comment']); } UpdateBoardStats($info['board']); UpdateBoardStats($board); ok($lang->phrase('x_entries_moved'), 'showtopic.php?id=' . $info['id']); } elseif ($action == "reports") { echo $tpl->parse("menu"); $result = $db->query("SELECT id, report, topic_id, tstart, topic FROM {$db->pre}replies WHERE id = '{$_GET['topic_id']}' LIMIT 1", __LINE__, __FILE__); $data = $gpc->prepare($db->fetch_assoc($result)); if ($db->num_rows($result) == 0) { error($lang->phrase('query_string_error'), 'showtopic.php?id=' . $info['id'] . SID2URL_x); } if (empty($data['report'])) { error($lang->phrase('admin_report_not_found'), "showtopic.php?action=jumpto&id={$data['topic_id']}&topic_id={$data['id']}" . SID2URL_x); } echo $tpl->parse("admin/topic/reports");
write_backup($dump_buffer, $backup_file_name); } $transfer_backup = new transfer_backup(); $errors .= $transfer_backup->transfer_data($ftp_username, $ftp_password, $ftp_server, $ftp_path, $backup_file_name); if (!$save_backup_zip_file_to_server) { unlink(LOCATION . "../backups/" . $backup_file_name); } } if (!session_id()) { session_start(); } if (isset($_SESSION['pmab_mysql_errors'])) { $errors .= $_SESSION['pmab_mysql_errors']; } if ($send_email_backup) { xmail($to_emailaddress, $from_emailaddress, "phpMySQLAutoBackup: {$backup_file_name}", $dump_buffer, $backup_file_name, $backup_type, $phpMySQLAutoBackup_version); } if ($send_email_report) { $msg_email_backup = ""; $msg_ftp_backup = ""; $msg_local_backup = ""; if ($send_email_backup) { $msg_email_backup = "\nthe email with the backup attached has been sent to: {$to_emailaddress} \n"; } if (isset($ftp_username)) { $msg_ftp_backup = "\nthe backup zip file has been transferred via ftp to: {$ftp_server} (user: {$ftp_username}) - folder: {$ftp_path} \n"; } if ($save_backup_zip_file_to_server) { $msg_local_backup = "\nthe backup zip file has been saved to the same server: " . dirname(__FILE__) . "/backups/ \n"; } if ($errors == "") {
function boxes_go() { global $list, $options, $fromaddr, $L; require_once CLASS_DIR . "mail.php"; $_POST["partSize"] = isset($_POST["partSize"]) & $_POST["split"] == "on" ? $_POST["partSize"] * 1024 * 1024 : FALSE; $v_mails = explode("\n", $_POST['emails']); $v_min = count(count($_POST["files"]) < count($v_mails) ? $_POST["files"] : $v_mails); for ($i = 0; $i < $v_min; $i++) { $file = $list[$_POST["files"][$i]]; $v_mail = trim($v_mails[$i]); if (!checkmail($v_mail)) { echo $L->sprintf($L->say['invalid_email_addr'], $v_mail) . "<br /><br />"; } elseif (file_exists($file["name"])) { if (xmail("{$fromaddr}", $v_mail, "File " . basename($file["name"]), "File: " . basename($file["name"]) . "\r\n" . "Link: " . $file["link"] . ($file["comment"] ? "\r\nComments: " . str_replace("\\r\\n", "\r\n", $file["comment"]) : ""), $file["name"], $_POST["partSize"], $_POST["method"])) { if ($_POST["del_ok"] && !$options['disable_to']['act_del']) { if (@unlink($file["name"])) { $v_ads = " " . $L->says['_and_del']; unset($list[$_POST["files"][$i]]); } else { $v_ads = ", " . $L->say['_but'] . " <b>" . $L->say['_not_del'] . "</b>"; } } else { $v_ads = " !"; } echo '<script type="text/javascript">' . "mail('File <b>" . basename($file["name"]) . "</b> it is sent for the address <b>" . $v_mail . "</b>" . $v_ads . "', '" . md5(basename($file["name"])) . "');</script>\r\n<br />"; } else { echo "<b class=\"r\">" . $L->say['error_send'] . "</b><br />"; } } else { echo $L->sprintf($L->say['not_found'], $file['name']) . "<br /><br />"; } } if (count($_POST["files"]) < count($v_mails)) { for ($i = count($_POST["files"]); $i < count($v_mails); $i++) { $v_mail = trim($v_mails[$i]); echo "{$v_mail}.</b><br /><br />"; } echo "</b><br />"; } elseif (count($_POST["files"]) > count($v_mails)) { for ($i = count($v_mails); $i < count($_POST["files"]); $i++) { $file = $list[$_POST["files"][$i]]; if (file_exists($file["name"])) { echo $file["name"] . "<br /><br />"; } else { echo $L->sprintf($L->say['not_found'], $file['name']) . "<br /><br />"; } } echo "<br />"; } if ($_POST["del_ok"]) { if (!updateListInFile($list)) { echo $L->say['error_upd_list'] . "<br /><br />"; } } }
function boxes_go() { global $list, $options, $fromaddr; require_once CLASS_DIR . "mail.php"; $_POST["partSize"] = isset($_POST["partSize"]) & $_POST["split"] == "on" ? $_POST["partSize"] * 1024 * 1024 : FALSE; $v_mails = explode("\n", $_POST['emails']); $v_min = count(count($_POST["files"]) < count($v_mails) ? $_POST["files"] : $v_mails); for ($i = 0; $i < $v_min; $i++) { $file = $list[$_POST["files"][$i]]; $v_mail = trim($v_mails[$i]); if (!checkmail($v_mail)) { printf(lang(144), $v_mail); echo "<br /><br />"; } elseif (file_exists($file["name"])) { if (xmail("{$fromaddr}", $v_mail, "File " . basename($file["name"]), "File: " . basename($file["name"]) . "\r\n" . "Link: " . $file["link"] . ($file["comment"] ? "\r\nComments: " . str_replace("\\r\\n", "\r\n", $file["comment"]) : ""), $file["name"], $_POST["partSize"], $_POST["method"])) { if ($_POST["del_ok"] && !$options['disable_deleting']) { if (@unlink($file["name"])) { $v_ads = " and deleted!"; unset($list[$_POST["files"][$i]]); } else { $v_ads = ", but <b>not</b> deleted!</b>"; } } else { $v_ads = " !"; } echo '<script type="text/javascript">' . "mail('File <b>" . basename($file["name"]) . "</b> it is sent for the address <b>" . $v_mail . "</b>" . $v_ads . "', '" . md5(basename($file["name"])) . "');</script>\r\n<br />"; } else { echo lang(12) . "<br />"; } } else { printf(lang(145), $file['name']); echo "<br /><br />"; } } if (count($_POST["files"]) < count($v_mails)) { for ($i = count($_POST["files"]); $i < count($v_mails); $i++) { $v_mail = trim($v_mails[$i]); echo "{$v_mail}.</b><br /><br />"; } echo "</b><br />"; } elseif (count($_POST["files"]) > count($v_mails)) { for ($i = count($v_mails); $i < count($_POST["files"]); $i++) { $file = $list[$_POST["files"][$i]]; if (file_exists($file["name"])) { echo $file["name"] . "<br /><br />"; } else { printf(lang(145), $file['name']); echo "<br /><br />"; } } echo "<br />"; } if ($_POST["del_ok"]) { if (!updateListInFile($list)) { echo lang(146) . "<br /><br />"; } } }
$cache[$row['id']] = $row; } // Get moderators $result = $db->query("SELECT u.id, u.name, u.mail, u.language FROM {$db->pre}moderators AS m LEFT JOIN {$db->pre}user AS u ON u.id = m.mid WHERE m.bid = '{$info['board']}'", __LINE__, __FILE__); while ($row = $db->fetch_assoc($result)) { // If ID exists already in array then overwrite it $cache[$row['id']] = $row; } // E-mail them all $lang_dir = $lang->getdir(true); foreach ($cache as $row) { $lang->setdir($row['language']); $row = $gpc->plain_str($row); $data = $lang->get_mail('report_post'); $to = array(array('name' => $row['name'], 'mail' => $row['mail'])); xmail($to, array(), $data['title'], $data['comment']); } $lang->setdir($lang_dir); ok($lang->phrase('report_post_success'), "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x); } } else { echo $tpl->parse("header"); echo $tpl->parse("menu"); echo $tpl->parse("misc/report_post"); } } elseif ($_GET['action'] == "wwo") { $my->p = $slog->Permissions(); if ($my->p['wwo'] == 0) { errorLogin(); } if ($_GET['type'] == 1) {
} ($code = $plugins->load('profile_mail_errorhandling')) ? eval($code) : null; if (count($error) > 0) { $data = array( 'topic' => $_POST['topic'], 'comment' => $_POST['comment'] ); ($code = $plugins->load('profile_mail_errordata')) ? eval($code) : null; $fid = save_error_data($data); error($error,"profile.php?action=mail&id={$_GET['id']}&fid=".$fid.SID2URL_x); } else { set_flood(); $to = array('0' => array('name' => $row->name, 'mail' => $row->mail)); $from = array('name' => $my->name, 'mail' => $my->mail); xmail($to, $from, $gpc->get('topic', html_enc), $gpc->get('comment', html_enc)); ok($lang->phrase('email_sent'),"profile.php?id=".$_GET['id'].SID2URL_x); } } else { $fid = $gpc->get('fid', str); if (is_hash($fid)) { $data = $gpc->unescape(import_error_data($fid)); } else { $data = array( 'comment' => '', 'topic' => '' ); }
unset($ref, $purl); } } while ($redirectto && !$lastError); if ($lastError) { html_error(htmlspecialchars($lastError)); } elseif ($file['bytesReceived'] == $file['bytesTotal'] || $file['size'] == 'Unknown') { echo '<script type="text/javascript">' . "pr(100, '" . $file['size'] . "', '" . $file['speed'] . "')</script>\r\n"; echo sprintf(lang(10), link_for_file(dirname($pathWithName) . '/' . basename($file['file'])), $file['size'], $file['time'], $file['speed']); $file['date'] = time(); if (!write_file(CONFIG_DIR . 'files.lst', serialize(array('name' => $file['file'], 'size' => $file['size'], 'date' => $file['date'], 'link' => $_GET['link'], 'comment' => !empty($_GET['comment']) ? str_replace(array("\r", "\n"), array('\\r', '\\n'), $_GET['comment']) : '')) . "\r\n", 0)) { echo lang(9) . '<br />'; } if (!empty($_GET['email']) && !$options['disable_email']) { require_once CLASS_DIR . 'mail.php'; $_GET['partSize'] = isset($_GET['partSize']) && is_numeric($_GET['partSize']) ? $_GET['partSize'] * 1024 * 1024 : false; if (xmail($fromaddr, $_GET['email'], 'File ' . basename($file['file']), 'File: ' . basename($file['file']) . "\r\n" . 'Link: ' . $_GET['link'] . (!empty($_GET['comment']) ? "\r\n" . 'Comments: ' . str_replace(array('\\r', '\\n'), array("\r", "\n"), $_GET['comment']) : ''), $pathWithName, $_GET['partSize'], $_GET['partSize'] && !empty($_GET['method']) ? $_GET['method'] : '')) { printf(lang(11), $_GET['email'], basename($file['file'])); } else { echo lang(12) . '<br />'; } } echo "\n<form method='POST' name='flist' action='{$_SERVER['SCRIPT_NAME']}'>\n"; echo "\t<input type='hidden' name='files[]' value='{$file['date']}' /><br />\n"; echo "\t<div style='text-align:center;'>\n"; echo renderActions(); echo "\t</div>\n"; echo "</form>\n"; if ($options['new_window']) { echo '<br /><a href="javascript:window.close();">' . lang(378) . '</a>'; } else { echo "<br /><a href='{$_SERVER['SCRIPT_NAME']}'>" . lang(13) . "</a>";
if (!$result || !$result2) { echo $L->say['error_upd_list'] . "<br />"; } if ($options["limitbytraffic"]) { if ($options["max_trafic"] > 0) { if (!is_numeric($traffic->total)) { $traffic->total = 0; } $traffic->total += $file["bytesReceived"]; $traffic->updTraffic(); } } if (!empty($_GET["email"])) { require_once CLASS_DIR . "mail.php"; $_GET["partSize"] = isset($_GET["partSize"]) && is_numeric($_GET["partSize"]) ? $_GET["partSize"] * 1024 * 1024 : false; if (xmail($fromaddr, $_GET["email"], "File " . basename($file["file"]), "File: " . basename($file["file"]) . "\r\n" . "Link: " . $_GET["link"] . (!empty($_GET["comment"]) ? "\r\n" . "Comments: " . str_replace("\\r\\n", "\r\n", $_GET["comment"]) : ""), $pathWithName, $_GET["partSize"], $_GET["partSize"] && !empty($_GET["method"]) ? $_GET["method"] : '')) { print $L->sprintf($L->say['mail_file_sent'], $_GET['email'], basename($file['file'])); } else { print "<div class='acthistory_result'>" . $L->say['mail_error_send'] . "</div>"; } } if ($options['new_window']) { print '<br /><a href="javascript:window.close();">' . $L->say['closewin'] . '</a>'; } else { $rnd = rand(11, 99); // generate delete link echo $L->sprintf($L->say['_del_link'], 'del.php?d=' . str_replace("=", "", rotN(base64_encode($file["date"] . ':' . '4puZ'), $rnd)) . "-" . $rnd, date("M-d, Y - H:i:s", $file["date"])); print "<br /><a id='tdone' href=\"" . $PHP_SELF . "\">[ <b><span id='txtdone'>" . $L->say['back_main'] . " ]</b></span></a><br />"; } } else { @unlink($pathWithName);
function mail_go() { global $list, $options, $fromaddr; require_once CLASS_DIR . "mail.php"; if (!checkmail($_POST["email"])) { echo lang(166) . "<br /><br />"; } else { $_POST["partSize"] = isset($_POST["partSize"]) & $_POST["split"] == "on" ? $_POST["partSize"] * 1024 * 1024 : FALSE; for ($i = 0; $i < count($_POST["files"]); $i++) { $file = $list[$_POST["files"][$i]]; if (file_exists($file["name"])) { if (xmail("{$fromaddr}", $_POST['email'], "File " . basename($file["name"]), "File: " . basename($file["name"]) . "\r\n" . "Link: " . $file["link"] . ($file["comment"] ? "\r\nComments: " . str_replace("\\r\\n", "\r\n", $file["comment"]) : ""), $file["name"], $_POST["partSize"], $_POST["method"])) { if ($_POST["del_ok"] && !$options['disable_deleting']) { if (@unlink($file["name"])) { $v_ads = " and deleted."; unset($list[$_POST["files"][$i]]); } else { $v_ads = ", but <b>not deleted!</b>"; } } else { $v_ads = " !"; } echo '<script type="text/javascript">' . "<!--\r\nmail('File <b>" . basename($file["name"]) . "</b> it is sent for the address <b>" . $_POST["email"] . "</b>" . $v_ads . "', '" . md5(basename($file["name"])) . "');//-->\r\n</script>\r\n<br />"; } else { echo lang(12) . "<br />"; } } else { printf(lang(145), $file['name']); echo "<br /><br />"; } } } }
function mail_go() { global $list, $options, $L; require_once CLASS_DIR . "mail.php"; if (!checkmail($_POST["email"])) { echo $L->say['invalid_email'] . "<br /><br />"; } else { $_POST["partSize"] = isset($_POST["partSize"]) & $_POST["split"] == "on" ? $_POST["partSize"] * 1024 * 1024 : FALSE; for ($i = 0; $i < count($_POST["files"]); $i++) { $file = $list[$_POST["files"][$i]]; if (file_exists($file["name"])) { if (xmail("{$fromaddr}", $_POST['email'], "File " . basename($file["name"]), "File: " . basename($file["name"]) . "\r\n" . "Link: " . $file["link"] . ($file["comment"] ? "\r\nComments: " . str_replace("\\r\\n", "\r\n", $file["comment"]) : ""), $file["name"], $_POST["partSize"], $_POST["method"])) { if ($_POST["del_ok"] && !$options['disable_to']['act_del']) { if (@unlink($file["name"])) { $v_ads = " " . $L->say['_and_del'] . ""; unset($list[$_POST["files"][$i]]); } else { $v_ads = ", " . $L->say['_but'] . " <b>" . $L->say['_not_del'] . "</b>"; } } else { $v_ads = " !"; } echo '<script type="text/javascript">' . "<!--\r\nmail('File <b>" . basename($file["name"]) . "</b> " . $L->say['send_for_addr'] . " <b>" . $_POST["email"] . "</b>" . $v_ads . "', '" . md5(basename($file["name"])) . "');//-->\r\n</script>\r\n<br />"; } else { echo $L->say['error_send'] . "<br />"; } } else { echo $L->sprintf($L->say['not_found'], $file['name']) . "<br /><br />"; } } } }
$error[] = $lang->phrase('title_too_long'); } if (strxlen($_POST['topic']) < $config['mintitlelength']) { $error[] = $lang->phrase('title_too_short'); } ($code = $plugins->load('profile_mail_errorhandling')) ? eval($code) : null; if (count($error) > 0) { $data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment']); ($code = $plugins->load('profile_mail_errordata')) ? eval($code) : null; $fid = save_error_data($data); error($error, "profile.php?action=mail&id={$_GET['id']}&fid=" . $fid . SID2URL_x); } else { set_flood(); $to = array('0' => array('name' => $row->name, 'mail' => $row->mail)); $from = array('name' => $my->name, 'mail' => $my->mail); xmail($to, $from, $_POST['topic'], $gpc->unescape($_POST['comment'])); ok($lang->phrase('email_sent'), "profile.php?id=" . $_GET['id'] . SID2URL_x); } } else { if ($row->opt_hidemail == 0) { $chars = array('@', '.'); $entities = array('@', '.'); $row->mail = str_replace($chars, $entities, $row->mail); } if (strlen($_GET['fid']) == 32) { $data = $gpc->prepare(import_error_data($_GET['fid'])); } else { $data = array('comment' => '', 'topic' => ''); } echo $tpl->parse("header"); ($code = $plugins->load('profile_mail_prepared')) ? eval($code) : null;
<?php /* * Spit out a timesheet for a given client */ require_once 'lib/siteconfig.php'; $debug = g($_GET, 'debug') == 'on'; $from = date('Y-m-01', time()); $to = date('Y-m-d', time()); $month = date('F Y', time()); $target = g($_GET, 'client'); foreach (all_customers() as $c) { if ($target && $target != $c['name']) { continue; } $client = fb_client_by_email($c['client_email']); $entries = fb_time_entries_by_client($client, array('filter' => array('date_from' => $from, 'date_to' => $to))); if (!$entries) { continue; } $html = snippet('emails/digest', array('customer' => $c, 'entries' => $entries, 'client' => $client, 'from' => $from, 'to' => $to)); $subject = "[Ideas2Executables] Hours Summary for {$month} as of " . fmt_date($to); if ($debug) { var_dump(array('to' => $c['to'], 'subject' => $subject, 'body' => $html)); } else { xmail($c['to'], $subject, $html); } }
$error[] = $lang->phrase('title_too_long'); } if (strxlen($_POST['topic']) < $config['mintitlelength']) { $error[] = $lang->phrase('title_too_short'); } ($code = $plugins->load('profile_mail_errorhandling')) ? eval($code) : null; if (count($error) > 0) { $data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment']); ($code = $plugins->load('profile_mail_errordata')) ? eval($code) : null; $fid = save_error_data($data); error($error, "profile.php?action=mail&id={$_GET['id']}&fid=" . $fid . SID2URL_x); } else { set_flood(); $to = array('0' => array('name' => $row->name, 'mail' => $row->mail)); $from = array('name' => $my->name, 'mail' => $my->mail); xmail($to, $from, $gpc->get('topic', none), $gpc->get('comment', none)); ok($lang->phrase('email_sent'), "profile.php?id=" . $_GET['id'] . SID2URL_x); } } else { if ($row->opt_hidemail == 0) { $chars = array('@', '.'); $entities = array('@', '.'); $row->mail = str_replace($chars, $entities, $row->mail); } $fid = $gpc->get('fid', str); if (is_hash($fid)) { $data = $gpc->unescape(import_error_data($fid)); } else { $data = array('comment' => '', 'topic' => ''); } echo $tpl->parse("header");
/** * Log the command was run into cron log table and email to DEV_EMAILS cron log result * * @param string $action * @param array $params * @param int $exitCode * * @return int|void */ public function afterAction($action, $params, $exitCode = 0) { parent::afterAction($action, $params, $exitCode = 0); $commandName = $_SERVER['argv'][1]; $params = json_encode($params); $serverName = gethostname(); $model = new CronLog(); $model->command_name = $commandName; $model->params = $params; $model->server_name = $serverName; $logFile = $this->getLogFile(); $model->run_log = @file_get_contents($logFile); if ($this->emailLog) { $logs = "{$commandName} is run at " . date('m/d/Y h:i:s') . "\n"; $logs .= 'Parameters: ' . print_r($_SERVER['argv'], 1) . "\n"; $logs .= $this->getLogs(); $logs .= print_r($_SERVER, 1); xmail($commandName . ' run log', nl2br($logs), SETTINGS_DEV_EMAILS); } @unlink($logFile); $model->save(); }