Esempio n. 1
0
function addUploadLocation($name, $protocol, $host, $port, $username, $password, $baseDirectory)
{
    $name = sanitiseStringToAlphaNumeric($name);
    //todo sanitise $name
    $configDirectory = getConfigDirectory();
    $uploadLocationPath = $configDirectory . 'upload-' . $name . '.conf';
    while (file_exists($uploadLocationPath)) {
        $uploadLocationPath = $configDirectory . 'upload-' . $name . '-' . rand(1, 1000) . '.conf';
    }
    initializeIniFile($uploadLocationPath);
    setConfigItem($uploadLocationPath, 'name', $name);
    setConfigItem($uploadLocationPath, 'protocol', $protocol);
    setConfigItem($uploadLocationPath, 'host', $host);
    setConfigItem($uploadLocationPath, 'port', $port);
    setConfigItem($uploadLocationPath, 'username', $username);
    setConfigItem($uploadLocationPath, 'password', $password);
    setConfigItem($uploadLocationPath, 'baseDirectory', $baseDirectory);
}
Esempio n. 2
0
function setGlobalConfigItem($key, $value)
{
    return setConfigItem(getGlobalConfigPath(), $key, $value);
}
setConfigItem(CONFIG_reg_type_userfield3, readPostVar('type_userfield3'));
setConfigItem(CONFIG_reg_values_userfield3, readPostVar('values_userfield3'));
setConfigItem(CONFIG_reg_userfield4, (int) readPostVar('userfield4'));
setConfigItem(CONFIG_reg_caption_userfield4, readPostVar('caption_userfield4'));
setConfigItem(CONFIG_reg_type_userfield4, readPostVar('type_userfield4'));
setConfigItem(CONFIG_reg_values_userfield4, readPostVar('values_userfield4'));
setConfigItem(CONFIG_reg_userfield5, (int) readPostVar('userfield5'));
setConfigItem(CONFIG_reg_caption_userfield5, readPostVar('caption_userfield5'));
setConfigItem(CONFIG_reg_type_userfield5, readPostVar('type_userfield5'));
setConfigItem(CONFIG_reg_values_userfield5, readPostVar('values_userfield5'));
setConfigItem(CONFIG_reg_userfield6, (int) readPostVar('userfield6'));
setConfigItem(CONFIG_reg_caption_userfield6, readPostVar('caption_userfield6'));
setConfigItem(CONFIG_reg_type_userfield6, readPostVar('type_userfield6'));
setConfigItem(CONFIG_reg_values_userfield6, readPostVar('values_userfield6'));
setConfigItem(CONFIG_reg_userfield7, (int) readPostVar('userfield7'));
setConfigItem(CONFIG_reg_caption_userfield7, readPostVar('caption_userfield7'));
setConfigItem(CONFIG_reg_type_userfield7, readPostVar('type_userfield7'));
setConfigItem(CONFIG_reg_values_userfield7, readPostVar('values_userfield7'));
setConfigItem(CONFIG_reg_userfield8, (int) readPostVar('userfield8'));
setConfigItem(CONFIG_reg_caption_userfield8, readPostVar('caption_userfield8'));
setConfigItem(CONFIG_reg_type_userfield8, readPostVar('type_userfield8'));
setConfigItem(CONFIG_reg_values_userfield8, readPostVar('values_userfield8'));
setConfigItem(CONFIG_reg_userfield9, (int) readPostVar('userfield9'));
setConfigItem(CONFIG_reg_caption_userfield9, readPostVar('caption_userfield9'));
setConfigItem(CONFIG_reg_type_userfield9, readPostVar('type_userfield9'));
setConfigItem(CONFIG_reg_values_userfield9, readPostVar('values_userfield9'));
setConfigItem(CONFIG_reg_userfield10, (int) readPostVar('userfield10'));
setConfigItem(CONFIG_reg_caption_userfield10, readPostVar('caption_userfield10'));
setConfigItem(CONFIG_reg_type_userfield10, readPostVar('type_userfield10'));
setConfigItem(CONFIG_reg_values_userfield10, readPostVar('values_userfield10'));
gotoLocation('config.php' . getURLAddon('', array('action')));