Exemplo n.º 1
0
$GLOBALS['current_config']['account_max_id'] = 65535;
$GLOBALS['current_config']['group_min_id'] = 500;
$GLOBALS['current_config']['group_max_id'] = 999;
$GLOBALS['current_config']['ldap_account_home'] = '/noexistant';
$GLOBALS['current_config']['ldap_account_shell'] = '/bin/false';
$GLOBALS['current_config']['ldap_host'] = 'localhost';
$GLOBALS['current_config']['encryptkey'] = md5(time() . $_SERVER['HTTP_HOST']);
// random enough
$setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions();
$newsettings = phpgw::get_var('newsettings', 'string', 'POST');
$files_in_docroot = isset($newsettings['files_dir']) ? in_docroot($newsettings['files_dir']) : false;
if (phpgw::get_var('submit', 'string', 'POST') && is_array($newsettings) && !$files_in_docroot) {
    phpgw::import_class('phpgwapi.datetime');
    switch (intval($newsettings['daytime_port'])) {
        case 13:
            $newsettings['tz_offset'] = phpgwapi_datetime::getntpoffset();
            break;
        case 80:
            $newsettings['tz_offset'] = phpgwapi_datetime::gethttpoffset();
            break;
        default:
            $newsettings['tz_offset'] = phpgwapi_datetime::getbestguess();
            break;
    }
    $GLOBALS['phpgw_setup']->db->transaction_begin();
    foreach ($newsettings as $setting => $value) {
        //	echo '<br />Updating: ' . $setting . '=' . $value;
        $setting = $GLOBALS['phpgw_setup']->db->db_addslashes($setting);
        /* Don't erase passwords, since we also do not print them below */
        if ($value || !preg_match('/passwd/', $setting) && !preg_match('/password/', $setting) && !preg_match('/root_pw/', $setting)) {
            $GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_config WHERE config_name='{$setting}'", __LINE__, __FILE__);