<?php

/**
 * This file handles submissions from the config form
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php";
if (isset($_POST["action"])) {
    switch ($_POST["action"]) {
        case "reset":
            ResetPostieConfig();
            $message = 1;
            break;
        case "cronless":
            check_postie();
            $message = 1;
            break;
        case "test":
            $location = get_option('siteurl') . '/wp-admin/options-general.php?page=postie/postie_test.php';
            header("Location: {$location}\n\n");
            exit;
            break;
        case "config":
            if (UpdatePostieConfig($_POST)) {
                $message = 1;
            } else {
                $message = 2;
            }
            break;
        default:
            $message = 2;
            break;
Ejemplo n.º 2
0
        case "runpostie":
            echo "Checking for mail manually\n";
            include 'get_mail.php';
            exit;
            break;
        default:
            $message = 2;
            break;
    }
}
global $wpdb, $wp_roles;
$title = __('Postie Options', 'postie');
$parent_file = 'options-general.php';
$config = get_option('postie-settings');
if (empty($config)) {
    $config = ResetPostieConfig();
}
if (defined('POSTIE_DEBUG')) {
    var_dump($config);
}
$arrays = get_arrayed_settings();
// some fields are stored as arrays, because that makes back-end processing much easier
// and we need to convert those fields to strings here, for the options form
foreach ($arrays as $sep => $fields) {
    foreach ($fields as $field) {
        $config[$field] = implode($sep, $config[$field]);
    }
}
extract($config);
if ($interval == 'manual') {
    wp_clear_scheduled_hook('check_postie_hook');