]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/atompubshowsubscription.php
delete groups from groups directory, for admins
[quix0rs-gnu-social.git] / actions / atompubshowsubscription.php
index 6274f8f9221fdc66116134b81e2e7f680bcde4e3..04681f3445133a5a8a5f11470a95a5fbabb77c9d 100644 (file)
@@ -34,8 +34,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Show a single subscription
  *
@@ -64,23 +62,23 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
         parent::prepare($argarray);
         $subscriberId = $this->trimmed('subscriber');
 
-        $this->_subscriber = Profile::staticGet('id', $subscriberId);
+        $this->_subscriber = Profile::getKV('id', $subscriberId);
 
         if (empty($this->_subscriber)) {
             // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
             // TRANS: %d is the non-existing profile ID number.
-            throw new ClientException(sprintf(_('No such profile id: %d'),
+            throw new ClientException(sprintf(_('No such profile id: %d.'),
                                               $subscriberId), 404);
         }
 
         $subscribedId = $this->trimmed('subscribed');
 
-        $this->_subscribed = Profile::staticGet('id', $subscribedId);
+        $this->_subscribed = Profile::getKV('id', $subscribedId);
 
         if (empty($this->_subscribed)) {
             // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
             // TRANS: %d is the non-existing profile ID number.
-            throw new ClientException(sprintf(_('No such profile id: %d'),
+            throw new ClientException(sprintf(_('No such profile id: %d.'),
                                               $subscribedId), 404);
         }
 
@@ -91,7 +89,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
         if (empty($this->_subscription)) {
             // TRANS: Client exception thrown when trying to display a subscription for a non-subscribed profile ID.
             // TRANS: %1$d is the non-existing subscriber ID number, $2$d is the ID of the profile that was not subscribed to.
-            $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d'),
+            $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d.'),
                            $subscriberId, $subscribedId);
             throw new ClientException($msg, 404);
         }
@@ -120,7 +118,6 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
         default:
             // TRANS: Client error shown when using a non-supported HTTP method.
             $this->clientError(_('HTTP method not supported.'), 405);
-            return;
         }
 
         return;
@@ -155,7 +152,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
             $this->auth_user->id != $this->_subscriber->id) {
             // TRANS: Client exception thrown when trying to delete a subscription of another user.
             throw new ClientException(_("Cannot delete someone else's ".
-                                        "subscription"), 403);
+                                        "subscription."), 403);
         }
 
         Subscription::cancel($this->_subscriber,