Exemplo n.º 1
0
$res = $trackback->load($dbh);
$error = false;
if (!$res) {
    $msg = 'No trackback.';
    $error = true;
} elseif (PEAR::isError($res)) {
    $msg = $res->getMessage();
    $error = true;
}
if ($error) {
    response_header('Trackback admin', null, null);
    report_error('Error: ' . $msg);
    response_footer();
    exit;
}
$mailData = array('id' => $trackback->get('id'), 'blog_name' => $trackback->get('blog_name'), 'title' => $trackback->get('title'), 'url' => $trackback->get('url'), 'excerpt' => $trackback->get('excerpt'), 'date' => format_date($trackback->get('timestamp')), 'timestamp' => $trackback->get('timestamp'), 'user' => $auth_user->handle);
$relocator = '<meta http-equiv="refresh" content="5; URL=http://' . PEAR_CHANNELNAME . '/package/' . $track_id . '/trackbacks">';
switch ($action) {
    case 'approve':
        $trackback->approve($dbh);
        $mailer = Damblan_Mailer::create('Trackback_Approve', $mailData);
        $additionalHeaders['To'] = $trackback->getMaintainers();
        $mailer->send($additionalHeaders);
        $msg = '<div class="success">Trackback successfully approved.</div>';
        break;
    case 'delete':
        $msg = '<div class="warnings">Really
<a href="/trackback/trackback-admin.php?action=delete_verified&id=' . $trackback->get('id') . '&timestamp=' . $trackback->get('timestamp') . '">delete</a>
or
<a href="/trackback/trackback-admin.php?action=delete_spam&id=' . $trackback->get('id') . '&timestamp=' . $trackback->get('timestamp') . '">delete as spam</a>
trackback ' . $timestamp . ' for ' . $track_id . '?</div>';
Exemplo n.º 2
0
    echo Services_Trackback::getResponseError('The data you submited was invalid, please recheck.', 1);
    exit;
}
if ($trackback->checkRepost($dbh, TRACKBACK_REPOST_COUNT, TRACKBACK_REPOST_TIMESPAN) !== false) {
    echo Services_Trackback::getResponseError('Only ' . TRACKBACK_REPOST_COUNT . ' trackbacks from 1 IP address within ' . TRACKBACK_REPOST_TIMESPAN . ' secs are allowed on this site. Please try again later.', 1);
    exit;
}
$trackback->createSpamCheck('Akismet', $trackback->akismetOptions);
if ($trackback->checkSpam() === true) {
    echo Services_Trackback::getResponseError('Your trackback seems to be spam. If it is not, please contact the webmaster of this site.', 1);
    exit;
}
$res = $trackback->save($dbh);
if (PEAR::isError($res)) {
    echo Services_Trackback::getResponseError('Your trackback could not be saved, please try again or inform the administrator.', 1);
    exit;
}
$mailData = array('id' => $trackback->get('id'), 'blog_name' => $trackback->get('blog_name'), 'title' => $trackback->get('title'), 'url' => $trackback->get('url'), 'excerpt' => $trackback->get('excerpt'), 'date' => format_date($trackback->get('timestamp')), 'timestamp' => $trackback->get('timestamp'));
$mailer = Damblan_Mailer::create('Trackback_New', $mailData);
// Get active maintainers only
$additionalHeaders['To'] = $trackback->getMaintainers(true);
if (!DEVBOX) {
    $res = $mailer->send($additionalHeaders);
} else {
    $res = true;
}
if (PEAR::isError($res)) {
    echo Services_Trackback::getResponseError('The notification email for your trackback could not be send. Please inform ' . PEAR_WEBMASTER_EMAIL . '.', 1);
    exit;
}
echo Services_Trackback::getResponseSuccess();