Exemplo n.º 1
0
 */
/**
 * check if user is authorized to load script
 */
include './scripts/check_auth.php';
$LIB_SETTINGS = array();
$DOCTRINE_CACHE_TYPES = array('query_cache' => array('name' => 'Query Cache'), 'metadata_cache' => array('name' => 'Metadata Cache'));
$DOCTRINE_CACHE_EXTENSIONS = array('apc', 'memcache', 'memcached', 'file');
$applicationSetup =& $_SESSION['setup_ini']['application'];
if (isset($_SESSION['application'])) {
    $LIB_SETTINGS = $_SESSION['application'];
} else {
    $getMyKeys = array('htmlpurifier.preload_all' => array(), 'htmlpurifier.use_cache' => array(), 'htmlpurifier.cache_dir' => array(), 'doctrine.cache.enabled' => array(), 'doctrine.cache.query_cache.enabled' => array(), 'doctrine.cache.query_cache.type' => array('allowEmpty' => false), 'doctrine.cache.query_cache.dir' => array(), 'doctrine.cache.metadata_cache.enabled' => array(), 'doctrine.cache.metadata_cache.type' => array('allowEmpty' => false), 'doctrine.cache.metadata_cache.dir' => array());
    foreach ($getMyKeys as $heresYourKey => $heresYourValue) {
        // gather default value!
        $LIB_SETTINGS[$heresYourKey] = conjoon_cacheSetup_getConfigurationDefaultValue($heresYourKey, 'application', $getMyKeys[$heresYourKey]);
        // adjust the value if necessary
        if (strpos($heresYourKey, 'cache_dir') !== false || strpos($heresYourKey, '.dir') !== false) {
            $LIB_SETTINGS[$heresYourKey] = conjoon_cacheSetup_assembleDir($heresYourKey, 'application', $LIB_SETTINGS[$heresYourKey]);
        }
    }
}
if (isset($_POST['lib_settings_post']) && $_POST['lib_settings_post'] == "1") {
    $_SESSION['lib_settings_failed'] = false;
    $_SESSION['application'] = $applicationSetup;
    // +-----------------------+
    // | htmlpurifier section  |
    // +-----------------------+
    $_SESSION['application']['htmlpurifier.preload_all'] = $_POST['htmlpurifier_preload_all'];
    if (!$_POST['htmlpurifier_use_cache']) {
        $_SESSION['application']['htmlpurifier.use_cache'] = false;
Exemplo n.º 2
0
 *
 * @author Thorsten Suckow-Homberg <*****@*****.**>
 */
/**
 * check if user is authorized to load script
 */
include './scripts/check_auth.php';
$CN_SETTINGS = array();
$fileSetup =& $_SESSION['setup_ini']['files'];
if (isset($_SESSION['files'])) {
    $CN_SETTINGS = $_SESSION['files'];
} else {
    $getMyKeys = array('upload.max_size' => array(), 'storage.filesystem.dir' => array(), 'storage.filesystem.enabled' => array());
    foreach ($getMyKeys as $heresYourKey => $heresYourValue) {
        // gather default value!
        $CN_SETTINGS[$heresYourKey] = conjoon_cacheSetup_getConfigurationDefaultValue($heresYourKey, 'files', $getMyKeys[$heresYourKey]);
        // adjust the value if necessary
        if (strpos($heresYourKey, '.dir') !== false) {
            $CN_SETTINGS[$heresYourKey] = conjoon_cacheSetup_assembleDir($heresYourKey, 'files', $CN_SETTINGS[$heresYourKey]);
        }
    }
    // fetch max upload default values in bytes
    $sizeComp = array(conjoon_megaByteToByte($_SESSION['max_allowed_packet']), conjoon_megaByteToByte(ini_get('upload_max_filesize')), conjoon_megaByteToByte(ini_get('post_max_size')));
    if (!empty($CN_SETTINGS['upload.max_size']) && $CN_SETTINGS['upload.max_size'] !== '{FILES.UPLOAD.MAX_SIZE}') {
        $sizeComp[] = $CN_SETTINGS['upload.max_size'];
    }
    $CN_SETTINGS['upload.max_size'] = min($sizeComp);
}
if (isset($_POST['cn_settings_post']) && $_POST['cn_settings_post'] == "1") {
    $_SESSION['cn_settings_failed'] = false;
    $_SESSION['files'] = $fileSetup;