Check if we're the current user before retrieving
This commit is contained in:
parent
a62755182c
commit
c9afdae01c
|
@ -89,13 +89,14 @@ 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));
|
||||
}
|
||||
$cur_user = common_current_user();
|
||||
if (($cur_user instanceof User) && $cur_user->sameAS($this)) {
|
||||
$user = $cur_user;
|
||||
}
|
||||
$this->_user[$this->id] = $user;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user