'_TABLE_TYPE' => '_TABLE_TYPE',
'_DB_TYPE' => '_DB_TYPE',
'SMTP_HOSTNAME' => 'SMTP_HOSTNAME',
- 'SMTP_USER' => 'SMTP_USER',
+ 'SMTP_USER' => 'SMTP_USER',
'SMTP_PASSWORD' => 'SMTP_PASSWORD',
'ENABLE_BACKLINK' => 'ENABLE_BACKLINK',
'MAIN_TITLE' => 'MAIN_TITLE',
$line = trim($line);
// Is the $MySQL found?
- if (substr($line, 0, 6) == "\$MySQL") {
+ if (substr($line, 0, 6) == '$MySQL') {
// Okay found!
$found = true;
} elseif ($found === true) {
function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '') {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'toEmail=' . $toEmail . ',subject=' . $subject . ',isHtml=' . $isHtml);
- // Compile subject line (for POINTS constant etc.)
- eval('$subject = decodeEntities("' . compileRawCode(escapeQuotes($subject)) . '");');
-
// Set from header
if ((!isInStringIgnoreCase('@', $toEmail)) && ($toEmail > 0)) {
// Value detected, is the message extension installed?
}
// Send out a raw email with PHPMailer class or legacy mail() command
-function sendRawEmail ($toEmail, $subject, $message, $from) {
- // Just compile all again, to put out all configs, etc.
- eval('$toEmail = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($toEmail)), false) . '");');
- eval('$subject = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($subject)), false) . '");');
- eval('$message = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($message)), false) . '");');
- eval('$from = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($from)) , false) . '");');
+function sendRawEmail ($toEmail, $subject, $message, $headers) {
+ // Just compile all to put out all configs, etc.
+ $eval = '$toEmail = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($toEmail)), false) . '"); ';
+ $eval .= '$subject = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($subject)), false) . '"); ';
+ $eval .= '$headers = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($headers)), false) . '"); ';
+
+ // Do not decode entities in the message because we also send HTML mails through this function
+ $eval .= '$message = "' . doFinalCompilation(compileRawCode(escapeQuotes($message)), false) . '";';
+
+ // Run the final eval() command
+ eval($eval);
// Shall we use PHPMailer class or legacy mode?
if (checkPhpMailerUsage()) {
$mail->Port = 25;
$mail->Username = getConfig('SMTP_USER');
$mail->Password = getConfig('SMTP_PASSWORD');
- if (empty($from)) {
+ if (empty($headers)) {
$mail->From = getConfig('WEBMASTER');
} else {
- $mail->From = $from;
+ $mail->From = $headers;
}
$mail->FromName = getMainTitle();
$mail->Subject = $subject;
} else {
$mail->Body = decodeEntities($message);
}
+
$mail->AddAddress($toEmail, '');
$mail->AddReplyTo(getConfig('WEBMASTER'), getMainTitle());
$mail->AddCustomHeader('Errors-To:' . getConfig('WEBMASTER'));
$mail->AddCustomHeader('X-Loop:' . getConfig('WEBMASTER'));
+ $mail->AddCustomHeader('Bounces-To:' . getConfig('WEBMASTER'));
$mail->Send();
// Has an error occured?
}
} else {
// Use legacy mail() command
- return mail($toEmail, $subject, decodeEntities($message), $from);
+ return mail($toEmail, $subject, decodeEntities($message), $headers);
}
}
} // END - if
// Three different ways to debug...
- //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
+ //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'URL=' . $URL);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'URL=' . $URL);
//* DEBUG: */ die($URL);
foreach($data as $k => $v) {
if ($v > 0) {
// Value is greater than 0 "eval" data to return string
- eval('$ret .= ", ".$v." {--_' . strtoupper($k) . '--}";');
+ $ret .= ', ' . $v . ' {--_' . strtoupper($k) . '--}';
break;
} // END - if
} // END - foreach
$api = new PrimeraApi($primusNick, $userMd5);
// Prepare purpose
- eval('$purpose = "' . preCompileCode(getMaskedMessage('PRIMERA_API_PURPOSE_WITHDRAW', getSession('sponsorid'))) . '";');
+ eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_WITHDRAW', getSession('sponsorid')), true) . '";');
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);
$api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5'));
// Prepare purpose
- eval('$purpose = "' . preCompileCode(getMaskedMessage('PRIMERA_API_PURPOSE_PAYOUT', getMemberId())) . '";');
+ eval('$purpose = "' . doFinalCompilation(getMaskedMessage('PRIMERA_API_PURPOSE_PAYOUT', getMemberId()), true) . '";');
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);
$requestData['api_id'] = getConfig('wernis_api_id');
$requestData['api_key'] = getConfig('wernis_api_md5');
+ // Is a purpose there?
+ if (isset($requestData['purpose'])) {
+ // Eval the purpose
+ eval('$purpose = "' . doFinalCompilation($requestData['purpose'], false) . '";');
+
+ // Prepare the purpose, it needs encoding
+ $requestData['purpose'] = encodeString($purpose);
+ } // END - if
+
// Construct the request string
$requestString = getConfig('wernis_api_url') . $scriptName;
// Return the result from the lower functions
$return = WERNIS_SEND_REQUEST('balance.php');
+ // Did it went smoothly?
if ($return['status'] == 'OK') {
// All fine!
$result = true;
// Default is failed attempt
$result = false;
- // Prepare the purpose
- eval('$purpose = "' . preCompileCode(getMaskedMessage('WERNIS_API_PURPOSE_WITHDRAW', getMemberId())) . '";');
-
// Prepare the request data
$requestData = array(
'sub_request' => 'receive',
't_md5' => $userMd5,
'r_uid' => getConfig('wernis_refid'),
'amount' => bigintval($amount),
- 'purpose' => encodeString($purpose, false)
+ 'purpose' => getMaskedMessage('WERNIS_API_PURPOSE_WITHDRAW', getMemberId())
);
// Return the result from the lower functions
// Default is failed attempt
$result = false;
- // Prepare the purpose
- eval('$purpose = "' . preCompileCode(getMaskedMessage('WERNIS_API_PURPOSE_PAYOUT', getMemberId())) . '";');
-
// Prepare the request data
$requestData = array(
'sub_request' => 'send',
't_md5' => getConfig('wernis_pass_md5'),
'r_uid' => bigintval($wdsId),
'amount' => bigintval($amount),
- 'purpose' => encodeString($purpose, false)
+ 'purpose' => getMaskedMessage('WERNIS_API_PURPOSE_PAYOUT', getMemberId())
);
// Return the result from the lower functions
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
// Base directory (should be moved to database)
$usage = getConfig('usage_base') . '/';
+// Init FQFN
+$FQFN = sprintf("%s%s/index.html",
+ getPath(),
+ getConfig('usage_base')
+);
+
if (isGetRequestParameterSet('image')) {
if (getRequestParameter('type') == 'usage') {
$FQFN = sprintf("%s%s/usage.png",
imagedestroy($image);
}
shutdown();
-} elseif (!isGetRequestParameterSet('usage')) {
- $FQFN = sprintf("%s%s/index.html",
- getPath(),
- getConfig('usage_base')
- );
-} else {
+} elseif (isGetRequestParameterSet('usage')) {
$FQFN = sprintf("%s%s/usage_%s.html",
getPath(),
getConfig('usage_base'),
$content = str_replace('daily_usage_' , '{?URL?}/modules.php?module=admin&what=' . getWhat() . '&type=daily&image=' , $content);
$content = str_replace('hourly_usage_', '{?URL?}/modules.php?module=admin&what=' . getWhat() . '&type=hourly&image=' , $content);
$content = str_replace('ctry_usage_' , '{?URL?}/modules.php?module=admin&what=' . getWhat() . '&type=ctry&image=' , $content);
- $content = str_replace('usage_' , '{?URL?}/modules.php?module=admin&what=' . getWhat() . '&usage=' , str_replace('.html', '', $content));
+ $content = str_replace('usage_' , '{?URL?}/modules.php?module=admin&what=' . getWhat() . '&usage=' , str_replace('.html', '', $content));
$test = strtolower($content);
// Do we need to strip out above and including <body> plus trailing </html> tag?
// check if running on IIS < 6 with CGI-PHP
if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
- (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+ (strpos($_SERVER['GATEWAY_INTERFACE'], 'CGI') !== false) &&
(preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
($matches[1] < 6)) {
// Send the IIS header