aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/site
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin/site')
-rw-r--r--actions/admin/site/flush_cache.php2
-rw-r--r--actions/admin/site/update_advanced.php28
-rw-r--r--actions/admin/site/update_basic.php3
3 files changed, 24 insertions, 9 deletions
diff --git a/actions/admin/site/flush_cache.php b/actions/admin/site/flush_cache.php
index b81f5fc83..ebb8296c7 100644
--- a/actions/admin/site/flush_cache.php
+++ b/actions/admin/site/flush_cache.php
@@ -4,7 +4,7 @@
*/
elgg_invalidate_simplecache();
-elgg_filepath_cache_reset();
+elgg_reset_system_cache();
system_message(elgg_echo('admin:cache:flushed'));
forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php
index 7d57f78ea..897a2f983 100644
--- a/actions/admin/site/update_advanced.php
+++ b/actions/admin/site/update_advanced.php
@@ -9,8 +9,7 @@
* @subpackage Administration.Site
*/
-if (datalist_get('default_site')) {
- $site = get_entity(datalist_get('default_site'));
+if ($site = elgg_get_site_entity()) {
if (!($site instanceof ElggSite)) {
throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
}
@@ -18,7 +17,24 @@ if (datalist_get('default_site')) {
$site->url = get_input('wwwroot');
datalist_set('path', sanitise_filepath(get_input('path')));
- datalist_set('dataroot', sanitise_filepath(get_input('dataroot')));
+ $dataroot = sanitise_filepath(get_input('dataroot'));
+
+ // check for relative paths
+ if (stripos(PHP_OS, 'win') === 0) {
+ if (strpos($dataroot, ':') !== 1) {
+ $msg = elgg_echo('admin:configuration:dataroot:relative_path', array($dataroot));
+ register_error($msg);
+ forward(REFERER);
+ }
+ } else {
+ if (strpos($dataroot, '/') !== 0) {
+ $msg = elgg_echo('admin:configuration:dataroot:relative_path', array($dataroot));
+ register_error($msg);
+ forward(REFERER);
+ }
+ }
+
+ datalist_set('dataroot', $dataroot);
if (get_input('simplecache_enabled')) {
elgg_enable_simplecache();
@@ -26,10 +42,10 @@ if (datalist_get('default_site')) {
elgg_disable_simplecache();
}
- if (get_input('viewpath_cache_enabled')) {
- elgg_enable_filepath_cache();
+ if (get_input('system_cache_enabled')) {
+ elgg_enable_system_cache();
} else {
- elgg_disable_filepath_cache();
+ elgg_disable_system_cache();
}
set_config('default_access', get_input('default_access', ACCESS_PRIVATE), $site->getGUID());
diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php
index 45f00a20d..97d258b65 100644
--- a/actions/admin/site/update_basic.php
+++ b/actions/admin/site/update_basic.php
@@ -10,8 +10,7 @@
* @subpackage Administration.Site
*/
-if (datalist_get('default_site')) {
- $site = get_entity(datalist_get('default_site'));
+if ($site = elgg_get_site_entity()) {
if (!($site instanceof ElggSite)) {
throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
}