Commit dd8e17a3 authored by mmn's avatar mmn

Merge branch 'profile' into 'nightly'

Change Profile->getUser() to match the current user

See merge request !129
parents 93524c4b b0204023
......@@ -89,9 +89,14 @@ class Profile extends Managed_DataObject
public function getUser()
{
if (!isset($this->_user[$this->id])) {
$user = User::getKV('id', $this->id);
if (!$user instanceof User) {
throw new NoSuchUserException(array('id'=>$this->id));
$cur_user = common_current_user();
if (($cur_user instanceof User) && $cur_user->sameAs($this)) {
$user = $cur_user;
} else {
$user = User::getKV('id', $this->id);
if (!$user instanceof User) {
throw new NoSuchUserException(array('id'=>$this->id));
}
}
$this->_user[$this->id] = $user;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment