aboutsummaryrefslogtreecommitdiff
path: root/mod/profile
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile')
-rw-r--r--mod/profile/actions/edit.php8
-rw-r--r--mod/profile/edit.php5
-rw-r--r--mod/profile/views/default/profile/edit.php1
3 files changed, 12 insertions, 2 deletions
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
index 7ace0a22b..7a74535cd 100644
--- a/mod/profile/actions/edit.php
+++ b/mod/profile/actions/edit.php
@@ -22,7 +22,13 @@
}
// Save stuff if we can, and forward to the user's profile
- $user = $_SESSION['user'];
+
+ if ($user = page_owner()) {
+ $user = page_owner_entity();
+ } else {
+ $user = $_SESSION['user'];
+ set_page_owner($user->getGUID());
+ }
if ($user->canEdit()) {
// Save stuff
diff --git a/mod/profile/edit.php b/mod/profile/edit.php
index 50f4b0955..a1afc26cc 100644
--- a/mod/profile/edit.php
+++ b/mod/profile/edit.php
@@ -17,8 +17,11 @@
if (!isloggedin()) forward();
// Get current user for now
- if (!$user = page_owner_entity()) {
+ if ($user = page_owner()) {
+ $user = page_owner_entity();
+ } else {
$user = $_SESSION['user'];
+ set_page_owner($user->getGUID());
}
// Get form, if we're allowed to edit
diff --git a/mod/profile/views/default/profile/edit.php b/mod/profile/views/default/profile/edit.php
index 5945e4d76..8822988d6 100644
--- a/mod/profile/views/default/profile/edit.php
+++ b/mod/profile/views/default/profile/edit.php
@@ -42,6 +42,7 @@
?>
<p>
+ <input type="hidden" name="username" value="<?php echo page_owner_entity()->username; ?>" />
<input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" />
</p>