aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/plugins/usersettings/save.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/actions/plugins/usersettings/save.php b/actions/plugins/usersettings/save.php
new file mode 100644
index 000000000..9dfda8a90
--- /dev/null
+++ b/actions/plugins/usersettings/save.php
@@ -0,0 +1,36 @@
+<?php
+ /**
+ * Elgg plugin user settings save action.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ $params = get_input('params');
+ $plugin = get_input('plugin');
+
+ $result = false;
+
+ foreach ($params as $k => $v)
+ {
+ // Save
+ $result = set_plugin_usersetting($k, $v, $_SESSION['user']->guid, $plugin);
+
+ // Error?
+ if (!$result)
+ {
+ system_message(sprintf(elgg_echo('plugins:usersettings:save:fail'), $plugin));
+
+ forward($_SERVER['HTTP_REFERER']);
+
+ exit;
+ }
+ }
+
+ system_message(sprintf(elgg_echo('plugins:usersettings:save:ok'), $plugin));
+ forward($_SERVER['HTTP_REFERER']);
+?> \ No newline at end of file