]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/oauthstore.php
Merge branch 'admin-sections/4' into 0.9.x
[quix0rs-gnu-social.git] / lib / oauthstore.php
index e69a00f55f2ab61e588a763e882e926d2c962c06..b04bcbb8b29896a922ceb651587fccdb7f9d0f1d 100644 (file)
@@ -156,7 +156,6 @@ class StatusNetOAuthDataStore extends OAuthDataStore
         return $this->new_access_token($consumer);
     }
 
-
     /**
      * Revoke specified OAuth token
      *
@@ -352,7 +351,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
             $author = User::staticGet('uri', $author_uri);
         }
         if (!$author) {
-            throw new Exception('No such user');
+            throw new Exception('No such user.');
         }
 
         common_log(LOG_DEBUG, print_r($author, true), __FILE__);
@@ -363,9 +362,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
                                   false,
                                   null,
                                   $omb_notice->getIdentifierURI());
-        if (is_string($notice)) {
-            throw new Exception($notice);
-        }
+
         common_broadcast_notice($notice, true);
     }
 
@@ -410,7 +407,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
             $user = User::staticGet('uri', $uri);
         }
         if (!$user) {
-            throw new Exception('No such user');
+            throw new Exception('No such user.');
         }
         return $user;
     }
@@ -465,6 +462,10 @@ class StatusNetOAuthDataStore extends OAuthDataStore
         $subscribed = $this->_getAnyProfile($subscribed_user_uri);
         $subscriber = $this->_getAnyProfile($subscriber_uri);
 
+        if (!$subscriber->hasRight(Right::SUBSCRIBE)) {
+            return _('You have been banned from subscribing.');
+        }
+
         $sub->subscribed = $subscribed->id;
         $sub->subscriber = $subscriber->id;