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,9 +89,14 @@ class Profile extends Managed_DataObject
|
||||||
public function getUser()
|
public function getUser()
|
||||||
{
|
{
|
||||||
if (!isset($this->_user[$this->id])) {
|
if (!isset($this->_user[$this->id])) {
|
||||||
$user = User::getKV('id', $this->id);
|
$cur_user = common_current_user();
|
||||||
if (!$user instanceof User) {
|
if (($cur_user instanceof User) && $cur_user->sameAs($this)) {
|
||||||
throw new NoSuchUserException(array('id'=>$this->id));
|
$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;
|
$this->_user[$this->id] = $user;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user