Ejemplo n.º 1
0
/**
 * This function used to handle updating the configuration.
 * @return boolean
 */
function config_Update($data)
{
    UpdatePostiePermissions($data["role_access"]);
    // We also update the cron settings
    postie_cron($data['interval']);
}
Ejemplo n.º 2
0
/**
 * This function used to handle updating the configuration.
 *@return boolean
 */
function UpdatePostieConfig($data)
{
    UpdatePostiePermissions($data["role_access"]);
    // We also update the cron settings
    if ($data['interval'] != '') {
        postie_decron();
        if ($data['interval'] != 'manual') {
            postie_cron($interval = $data['interval']);
        }
    }
    return 1;
}
Ejemplo n.º 3
0
/**
 * This function handles updating the configuration 
 *@return boolean
 */
function UpdatePostieConfig($data)
{
    SetupConfiguration();
    $key_arrays = GetListOfArrayConfig();
    $config = GetDBConfig();
    foreach ($config as $key => $value) {
        if (isset($data[$key])) {
            if (in_array($key, $key_arrays)) {
                //This is stored as an array
                $data[$key] = trim($data[$key]);
                if (strstr($data[$key], "\n")) {
                    $delim = "\n";
                } else {
                    $delim = ',';
                }
                $config[$key] = array();
                $values = explode($delim, $data[$key]);
                foreach ($values as $item) {
                    if (trim($item)) {
                        $config[$key][] = trim($item);
                    }
                }
            } else {
                $config[$key] = FilterNewLines($data[$key]);
            }
        }
    }
    WriteConfig($config);
    UpdatePostiePermissions($data["ROLE_ACCESS"]);
    // If we are using cronless, we also update the cronless events
    if ($config['CRONLESS'] != '') {
        postie_decron();
        postie_cron();
    }
    return 1;
}
Ejemplo n.º 4
0
/**
 * This function handles updating the configuration 
 *@return boolean
 */
function UpdatePostieConfig($data)
{
    SetupConfiguration();
    $key_arrays = GetListOfArrayConfig();
    $config = GetDBConfig();
    foreach ($config as $key => $value) {
        if (isset($data[$key])) {
            if (in_array($key, $key_arrays)) {
                //This is stored as an array
                $config[$key] = array();
                $values = explode("\n", $data[$key]);
                foreach ($values as $item) {
                    if (trim($item)) {
                        $config[$key][] = trim($item);
                    }
                }
            } else {
                $config[$key] = $data[$key];
            }
        }
    }
    WriteConfig($config);
    UpdatePostiePermissions($data["ROLE_ACCESS"]);
    return 1;
}