aboutsummaryrefslogtreecommitdiff
path: root/mod/notifications/views/default/forms
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-06-24 00:09:17 -0400
committerSteve Clay <steve@mrclay.org>2012-06-24 00:09:17 -0400
commit4a3c49240140449ef4c91c4b999a91b11380db3c (patch)
tree3d1e92342473e2fd90059d9abcfe88e79def9a25 /mod/notifications/views/default/forms
parentd71309056037adc869319566f9ec53313eb192d8 (diff)
downloadelgg-4a3c49240140449ef4c91c4b999a91b11380db3c.tar.gz
elgg-4a3c49240140449ef4c91c4b999a91b11380db3c.tar.bz2
Fixes #4138: Admin can edit any users' notifications
Diffstat (limited to 'mod/notifications/views/default/forms')
-rw-r--r--mod/notifications/views/default/forms/notificationsettings/groupsave.php8
-rw-r--r--mod/notifications/views/default/forms/notificationsettings/save.php16
2 files changed, 19 insertions, 5 deletions
diff --git a/mod/notifications/views/default/forms/notificationsettings/groupsave.php b/mod/notifications/views/default/forms/notificationsettings/groupsave.php
index 61b94ff8b..168639ab2 100644
--- a/mod/notifications/views/default/forms/notificationsettings/groupsave.php
+++ b/mod/notifications/views/default/forms/notificationsettings/groupsave.php
@@ -3,13 +3,18 @@
* Elgg notifications groups subscription form
*
* @package ElggNotifications
+ *
+ * @uses $vars['user'] ElggUser
*/
+/* @var ElggUser $user */
+$user = $vars['user'];
+
global $NOTIFICATION_HANDLERS;
foreach ($NOTIFICATION_HANDLERS as $method => $foo) {
$subsbig[$method] = elgg_get_entities_from_relationship(array(
'relationship' => 'notify' . $method,
- 'relationship_guid' => elgg_get_logged_in_user_guid(),
+ 'relationship_guid' => $user->guid,
'types' => 'group',
'limit' => 99999,
));
@@ -97,6 +102,7 @@ END;
<?php
}
echo '<div class="elgg-foot mtm">';
+ echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid));
echo elgg_view('input/submit', array('value' => elgg_echo('save')));
echo '</div>';
diff --git a/mod/notifications/views/default/forms/notificationsettings/save.php b/mod/notifications/views/default/forms/notificationsettings/save.php
index ff32d8558..9470256ca 100644
--- a/mod/notifications/views/default/forms/notificationsettings/save.php
+++ b/mod/notifications/views/default/forms/notificationsettings/save.php
@@ -1,13 +1,21 @@
<?php
/**
* Personal notifications form body
+ *
+ * @uses $vars['user'] ElggUser
*/
-echo elgg_view('notifications/subscriptions/personal');
-echo elgg_view('notifications/subscriptions/collections');
-echo elgg_view('notifications/subscriptions/forminternals');
+/* @var ElggUser $user */
+$user = $vars['user'];
+
+echo elgg_view('notifications/subscriptions/personal', $vars);
+echo elgg_view('notifications/subscriptions/collections', $vars);
+echo elgg_view('notifications/subscriptions/forminternals', $vars);
?>
<div class="elgg-foot">
-<?php echo elgg_view('input/submit', array('value' => elgg_echo('save'))); ?>
+<?php
+echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid));
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+?>
</div>