00001 <?php
00002
00016 global $CONFIG;
00017
00018
00019 admin_gatekeeper();
00020 action_gatekeeper();
00021
00022 if (get_input('settings') == 'go') {
00023
00024 if (datalist_get('default_site')) {
00025
00026 $site = get_entity(datalist_get('default_site'));
00027 if (!($site instanceof ElggSite))
00028 throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
00029
00030 $site->description = get_input('sitedescription');
00031 $site->name = get_input('sitename');
00032 $site->email = get_input('siteemail');
00033 $site->url = get_input('wwwroot');
00034
00035 datalist_set('path',sanitise_filepath(get_input('path')));
00036 datalist_set('dataroot',sanitise_filepath(get_input('dataroot')));
00037 if (get_input('simplecache_enabled')) {
00038 elgg_view_enable_simplecache();
00039 } else {
00040 elgg_view_disable_simplecache();
00041 }
00042
00043 set_config('language', get_input('language'), $site->getGUID());
00044
00045 set_config('default_access', get_input('default_access'), $site->getGUID());
00046
00047 if (get_input('allow_user_default_access')) {
00048 set_config('allow_user_default_access', 1, $site->getGUID());
00049 } else {
00050 set_config('allow_user_default_access', 0, $site->getGUID());
00051 }
00052
00053 set_config('view', get_input('view'), $site->getGUID());
00054
00055 $debug = get_input('debug');
00056 if ($debug)
00057 set_config('debug', 1, $site->getGUID());
00058 else
00059 unset_config('debug', $site->getGUID());
00060
00061 $https_login = get_input('https_login');
00062 if ($https_login)
00063 set_config('https_login', 1, $site->getGUID());
00064 else
00065 unset_config('https_login', $site->getGUID());
00066
00067 $usage = get_input('usage');
00068 if ($usage)
00069 unset_config('ping_home', $site->getGUID());
00070 else
00071 set_config('ping_home', 'disabled', $site->getGUID());
00072
00073 $api = get_input('api');
00074 if ($api)
00075 unset_config('disable_api', $site->getGUID());
00076 else
00077 set_config('disable_api', 'disabled', $site->getGUID());
00078
00079
00080
00081
00082
00083
00084
00085 if ($site->save())
00086 system_message(elgg_echo("admin:configuration:success"));
00087 else
00088 register_error(elgg_echo("admin:configuration:fail"));
00089
00090
00091 forward($_SERVER['HTTP_REFERER']);
00092 exit;
00093
00094 }
00095
00096 }
00097
00098 ?>