]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Return HTTP 403 instead of 400 when silenced users try to post via API
authorZach Copley <zach@status.net>
Thu, 29 Jul 2010 18:47:28 +0000 (18:47 +0000)
committerZach Copley <zach@status.net>
Thu, 29 Jul 2010 18:47:28 +0000 (18:47 +0000)
actions/apistatusesupdate.php
classes/Notice.php

index d65a068f50734250bef6d1167b5765fab5e7333f..9be16b2c56c98a36491cda8c1362e3dfe7463df3 100644 (file)
@@ -332,7 +332,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
                     $options
                 );
             } catch (Exception $e) {
-                $this->clientError($e->getMessage());
+                $this->clientError($e->getMessage(), $e->getCode());
                 return;
             }
 
index 8552248bad2c4cc3dfea6290803a4b653733f1f9..36943be84b044f7a57c2e0626cf42dabc2af9035 100644 (file)
@@ -275,7 +275,7 @@ class Notice extends Memcached_DataObject
 
         if (!$profile->hasRight(Right::NEWNOTICE)) {
             common_log(LOG_WARNING, "Attempted post from user disallowed to post: " . $profile->nickname);
-            throw new ClientException(_('You are banned from posting notices on this site.'));
+            throw new ClientException(_('You are banned from posting notices on this site.'), 403);
         }
 
         $notice = new Notice();