Merge branch 'profile' into 'nightly'
Change Profile->getUser() to match the current user See merge request !129
This commit is contained in:
commit
dd8e17a387
@ -89,10 +89,15 @@ class Profile extends Managed_DataObject
|
||||
public function getUser()
|
||||
{
|
||||
if (!isset($this->_user[$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;
|
||||
}
|
||||
return $this->_user[$this->id];
|
||||
|
Loading…
Reference in New Issue
Block a user