\$PMF_LANG['metaCharset'] = '%s';
\$PMF_LANG['metaLanguage'] = '%s';
\$PMF_LANG['language'] = '%s';
\$PMF_LANG['dir'] = '%s';
\$PMF_LANG['nplurals'] = '%s';
FILE;
        $authorTpl = '';
        foreach ($author as $authorData) {
            $authorTpl .= " * @author    {$authorData}\n";
        }
        $fileTpl = sprintf($fileTpl, $langDesc, $authorTpl, date('Y-m-d'), $langCode, date('Y'), $langCharset, strtolower($langCode), $langName, $langDir, $langNPlurals);
        $retval = @file_put_contents(PMF_ROOT_DIR . '/lang/language_' . strtolower($langCode) . '.php', $fileTpl);
        $response->setData(intval($retval));
        break;
    case 'send_translated_file':
        $lang = PMF_Filter::filterInput(INPUT_GET, 'translang', FILTER_SANITIZE_STRING);
        $filename = PMF_ROOT_DIR . "/lang/language_" . $lang . ".php";
        if (!file_exists($filename)) {
            $response->setData(0);
            break;
        }
        $letterTpl = '';
        $mail = new PMF_Mail($faqConfig);
        $mail->subject = 'New phpMyFAQ language file submitted';
        $mail->message = sprintf('The file below was sent by %s, which is using phpMyFAQ %s on %s', $user->userdata->get('email'), $faqConfig->get('main.currentVersion'), $_SERVER['HTTP_HOST']);
        $mail->addTo('*****@*****.**');
        $mail->addAttachment($filename, null, 'text/plain');
        $response->setData((int) $mail->send());
        break;
}
$response->send();
Exemple #2
0
    $pdfFile = $faq->buildPDFFile($cat);
    foreach ($mailto['mailto'] as $recipient) {
        $recipient = trim(strip_tags($recipient));
        if (!empty($recipient)) {
            $mail = new PMF_Mail();
            $mail->unsetFrom();
            $mail->setFrom($mailfrom, $name);
            $mail->addTo($recipient);
            $mail->subject = $PMF_LANG["msgS2FMailSubject"] . $name;
            $mail->message = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
            if ($html !== false) {
                $mail->messageAlt = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
                $mail->setHTMLMessage($html);
            }
            if (!empty($pdfFile) && file_exists($pdfFile)) {
                $mail->addAttachment($pdfFile, basename($pdfFile), 'application/pdf');
            }
            // Send the email
            $result = $mail->send();
            unset($mail);
            usleep(250);
        }
    }
    $tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'Message' => $PMF_LANG['msgS2FThx']));
} else {
    if (false === IPCheck($_SERVER["REMOTE_ADDR"])) {
        $tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'Message' => $PMF_LANG["err_bannedIP"]));
    } else {
        $tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'Message' => $PMF_LANG["err_sendMail"]));
    }
}