Fix regression in remote subscription; added hasRole() shadow method on Remote_profile.
DB_DataObject hides errors by silently returning null for any non-existent method call, making it harder to tell what the heck's going on... the rights check for blocked remote users returned null for the check for subscribe rights, thus eval'ing to false. We now log a note in this circumstance, which would have cut about 3 hours off of the debug time.
This commit is contained in:
parent
1ea5ccc5c1
commit
4d71dbe98c
|
@ -43,4 +43,14 @@ class Remote_profile extends Memcached_DataObject
|
||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
|
function hasRight($right)
|
||||||
|
{
|
||||||
|
$profile = Profile::staticGet($this->id);
|
||||||
|
if ($profile) {
|
||||||
|
return $profile->hasright($right);
|
||||||
|
} else {
|
||||||
|
throw new Exception("Missing profile");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,6 +463,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
|
||||||
$subscriber = $this->_getAnyProfile($subscriber_uri);
|
$subscriber = $this->_getAnyProfile($subscriber_uri);
|
||||||
|
|
||||||
if (!$subscriber->hasRight(Right::SUBSCRIBE)) {
|
if (!$subscriber->hasRight(Right::SUBSCRIBE)) {
|
||||||
|
common_log(LOG_INFO, __METHOD__ . ": remote subscriber banned ($subscriber_uri subbing to $subscribed_user_uri)");
|
||||||
return _('You have been banned from subscribing.');
|
return _('You have been banned from subscribing.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user