]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apichecknickname.php
Merge branch 'inbound-linkback' into 'master'
[quix0rs-gnu-social.git] / actions / apichecknickname.php
index 1d9c6842f3934f43b64ac5c3a87cf622767e05a1..a950dee135dfc72f039edb505af6e8fcbd455f07 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Check nickname
  *
- * Returns 1 if nickname is ok, 0 if not
+ * Returns 1 if nickname is available on this instance, 0 if not. Error if site is private.
  *
  * PHP version 5
  *
@@ -34,10 +34,14 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 class ApiCheckNicknameAction extends ApiAction
 {
 
-    protected function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
+        if (common_config('site', 'private')) {
+            $this->clientError(_('This site is private.'), 403);
+        }
+
         if ($this->format !== 'json') {
             $this->clientError('This method currently only serves JSON.', 415);
         }