aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/site/update_basic.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin/site/update_basic.php')
-rw-r--r--actions/admin/site/update_basic.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php
new file mode 100644
index 000000000..97d258b65
--- /dev/null
+++ b/actions/admin/site/update_basic.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Updates the basic settings for the primary site object.
+ *
+ * Basic site settings are saved as metadata on the site object,
+ * with the exception of the default language, which is saved in
+ * the config table.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
+ */
+
+if ($site = elgg_get_site_entity()) {
+ if (!($site instanceof ElggSite)) {
+ throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
+ }
+
+ $site->description = get_input('sitedescription');
+ $site->name = get_input('sitename');
+ $site->email = get_input('siteemail');
+ $site->save();
+
+ set_config('language', get_input('language'), $site->getGUID());
+}
+
+system_message(elgg_echo('admin:configuration:success'));
+forward(REFERER); \ No newline at end of file