From 4d71dbe98c0aa6347415d72b49378ae9b6f73f3f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 25 Nov 2009 22:10:55 +0000 Subject: 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. --- classes/Remote_profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'classes') diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php index 9f7bfeadc..0a1676a6a 100644 --- a/classes/Remote_profile.php +++ b/classes/Remote_profile.php @@ -43,4 +43,14 @@ class Remote_profile extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function hasRight($right) + { + $profile = Profile::staticGet($this->id); + if ($profile) { + return $profile->hasright($right); + } else { + throw new Exception("Missing profile"); + } + } } -- cgit v1.2.3-54-g00ecf