aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-26 15:48:28 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-26 15:48:28 +0000
commit31c5b57b92b2b2442527cc601eab113e047b0e93 (patch)
tree7cae2e88ab91dde44dce8fbdaded4e1e977b0cf8 /actions
parent6bb9e16e357eb718e954255b59681d519cda57ae (diff)
downloadelgg-31c5b57b92b2b2442527cc601eab113e047b0e93.tar.gz
elgg-31c5b57b92b2b2442527cc601eab113e047b0e93.tar.bz2
Unified user settings form
git-svn-id: https://code.elgg.org/elgg/trunk@1149 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions')
-rw-r--r--actions/email/save.php22
-rw-r--r--actions/notifications/settings/usersettings/save.php6
-rw-r--r--actions/user/language.php4
-rw-r--r--actions/user/name.php4
-rw-r--r--actions/user/password.php6
-rw-r--r--actions/usersettings/save.php21
6 files changed, 42 insertions, 21 deletions
diff --git a/actions/email/save.php b/actions/email/save.php
index 08fcc7647..79cc40c6d 100644
--- a/actions/email/save.php
+++ b/actions/email/save.php
@@ -25,19 +25,21 @@
$user = get_entity($user_id);
if ($user)
- {
- $user->email = $email;
- if ($user->save())
- {
- request_email_validation($user->getGUID());
- system_message(elgg_echo('email:save:success'));
+ {
+ if ($user->email != $email) {
+ $user->email = $email;
+ if ($user->save())
+ {
+ request_email_validation($user->getGUID());
+ system_message(elgg_echo('email:save:success'));
+ }
+ else
+ system_message(elgg_echo('email:save:fail'));
}
- else
- system_message(elgg_echo('email:save:fail'));
}
else
system_message(elgg_echo('email:save:fail'));
- forward($_SERVER['HTTP_REFERER']);
- exit;
+ //forward($_SERVER['HTTP_REFERER']);
+ //exit;
?> \ No newline at end of file
diff --git a/actions/notifications/settings/usersettings/save.php b/actions/notifications/settings/usersettings/save.php
index 79970421a..2748a7150 100644
--- a/actions/notifications/settings/usersettings/save.php
+++ b/actions/notifications/settings/usersettings/save.php
@@ -22,9 +22,9 @@
if (!$result)
{
system_message(elgg_echo('notifications:usersettings:save:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ //forward($_SERVER['HTTP_REFERER']);
- exit;
+ //exit;
}
}
@@ -33,5 +33,5 @@
else
system_message(elgg_echo('notifications:usersettings:save:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ //forward($_SERVER['HTTP_REFERER']);
?> \ No newline at end of file
diff --git a/actions/user/language.php b/actions/user/language.php
index f6a815858..f0b91791e 100644
--- a/actions/user/language.php
+++ b/actions/user/language.php
@@ -35,6 +35,6 @@
else
system_message(elgg_echo('user:language:fail'));
- forward($_SERVER['HTTP_REFERER']);
- exit;
+ //forward($_SERVER['HTTP_REFERER']);
+ //exit;
?> \ No newline at end of file
diff --git a/actions/user/name.php b/actions/user/name.php
index bbeed85ec..b93c804b3 100644
--- a/actions/user/name.php
+++ b/actions/user/name.php
@@ -35,6 +35,6 @@
else
system_message(elgg_echo('user:name:fail'));
- forward($_SERVER['HTTP_REFERER']);
- exit;
+ //forward($_SERVER['HTTP_REFERER']);
+ //exit;
?> \ No newline at end of file
diff --git a/actions/user/password.php b/actions/user/password.php
index 4c7ceb65c..ec3252644 100644
--- a/actions/user/password.php
+++ b/actions/user/password.php
@@ -43,9 +43,7 @@
else
system_message(elgg_echo('user:password:fail:tooshort'));
}
- else
- system_message(elgg_echo('user:password:fail'));
- forward($_SERVER['HTTP_REFERER']);
- exit;
+ //forward($_SERVER['HTTP_REFERER']);
+ //exit;
?> \ No newline at end of file
diff --git a/actions/usersettings/save.php b/actions/usersettings/save.php
new file mode 100644
index 000000000..6322369bc
--- /dev/null
+++ b/actions/usersettings/save.php
@@ -0,0 +1,21 @@
+<?php
+ /**
+ * Aggregate action for saving settings
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ global $CONFIG;
+
+ gatekeeper();
+
+ trigger_plugin_hook('usersettings:save','user');
+
+ forward($_SERVER['HTTP_REFERER']);
+
+?>