Пример #1
0
/**
 * Updates the (one and only) setting on the Settings page.
 *
 * @param array $info
 * @return array [0] true/false
 *               [1] message
 */
function pg_update_settings($info)
{
    global $L;
    $settings = array("num_pages_per_page" => $info["num_pages_per_page"]);
    ft_set_module_settings($settings);
    return array(true, $L["notify_settings_updated"]);
}
Пример #2
0
/**
 * Called on the Settings page. Updates the generated file folder information.
 *
 * @param array $info
 * @return array [0] T/F [1] Error / notification message
 */
function exp_update_settings($info)
{
    global $g_table_prefix, $L;
    $old_settings = ft_get_module_settings();
    $info = ft_sanitize($info);
    $settings = array();
    $settings["file_upload_dir"] = $info["file_upload_dir"];
    $settings["file_upload_url"] = $info["file_upload_url"];
    //$settings["cache_multi_select_fields"] = (isset($info["cache_multi_select_fields"]) && !empty($info["cache_multi_select_fields"])) ?
    //  $info["cache_multi_select_fields"] : "no";
    ft_set_module_settings($settings);
    //  $_SESSION["ft"]["export_manager"]["cache_multi_select_fields"] = $settings["cache_multi_select_fields"];
    return array(true, $L["notify_settings_updated"]);
}
Пример #3
0
/**
 * Updates the Swift Mailer settings.
 *
 * @param array $info
 * @return array [0] T/F<br />
 *               [1] Success / error message
 */
function swift_update_settings($info)
{
    global $L;
    $settings = array("swiftmailer_enabled" => isset($info["swiftmailer_enabled"]) ? "yes" : "no", "requires_authentication" => isset($info["requires_authentication"]) ? "yes" : "no", "use_encryption" => isset($info["use_encryption"]) ? "yes" : "no");
    // Enable module
    if (isset($info["swiftmailer_enabled"])) {
        $settings["smtp_server"] = $info["smtp_server"];
        if (isset($info["port"])) {
            $settings["port"] = $info["port"];
        }
    }
    // Use authentication
    if (isset($info["requires_authentication"])) {
        if (isset($info["username"])) {
            $settings["username"] = $info["username"];
        }
        if (isset($info["password"])) {
            $settings["password"] = $info["password"];
        }
        if (isset($info["authentication_procedure"])) {
            $settings["authentication_procedure"] = $info["authentication_procedure"];
        }
    }
    // Use encryption
    if (isset($info["use_encryption"])) {
        if (isset($info["encryption_type"])) {
            $settings["encryption_type"] = $info["encryption_type"];
        }
    }
    // Advanced
    if (isset($_SESSION["ft"]["swift_mailer"]["remember_advanced_settings"]) && $_SESSION["ft"]["swift_mailer"]["remember_advanced_settings"]) {
        if (isset($info["server_connection_timeout"])) {
            $settings["server_connection_timeout"] = $info["server_connection_timeout"];
        }
        if (isset($info["charset"])) {
            $settings["charset"] = $info["charset"];
        }
        // Anti-flooding
        $settings["use_anti_flooding"] = isset($info["use_anti_flooding"]) ? "yes" : "no";
        if (isset($info["anti_flooding_email_batch_size"])) {
            $settings["anti_flooding_email_batch_size"] = $info["anti_flooding_email_batch_size"];
        }
        if (isset($info["anti_flooding_email_batch_wait_time"])) {
            $settings["anti_flooding_email_batch_wait_time"] = $info["anti_flooding_email_batch_wait_time"];
        }
    }
    ft_set_module_settings($settings);
    return array(true, $L["notify_settings_updated"]);
}