diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 10:53:50 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 10:53:50 +0000 |
commit | 1d067acf070549c4edcb662252edd03907b1d9a3 (patch) | |
tree | 77c584fa73a45c792679d2f0a2ad10514ede9b92 /actions/plugins/usersettings | |
parent | f84af9231b1038f56c98a6f0bf7fb7a5fa2f042e (diff) | |
download | elgg-1d067acf070549c4edcb662252edd03907b1d9a3.tar.gz elgg-1d067acf070549c4edcb662252edd03907b1d9a3.tar.bz2 |
Refs #76: User settings page (to Elgg Classic standard)
git-svn-id: https://code.elgg.org/elgg/trunk@1092 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/plugins/usersettings')
-rw-r--r-- | actions/plugins/usersettings/save.php | 36 |
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 |