]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apistatusnetversion.php
Merge branch '1.0.x' into schema-x
[quix0rs-gnu-social.git] / actions / apistatusnetversion.php
index fb632fd93bd208b46cfc401f4e2187f73c26b77d..d0948075978210c76a8816fa7b68af9b45090e1a 100644 (file)
@@ -21,6 +21,7 @@
  *
  * @category  API
  * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@@ -31,7 +32,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/api.php';
+require_once INSTALLDIR . '/lib/apiprivateauth.php';
 
 /**
  * Returns a version number for this version of StatusNet, which
@@ -41,12 +42,13 @@ require_once INSTALLDIR . '/lib/api.php';
  *
  * @category API
  * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
  * @author   Zach Copley <zach@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
 
-class ApiStatusnetVersionAction extends ApiAction
+class ApiStatusnetVersionAction extends ApiPrivateAuthAction
 {
     /**
      * Take arguments for running
@@ -77,24 +79,39 @@ class ApiStatusnetVersionAction extends ApiAction
 
         switch ($this->format) {
         case 'xml':
-            $this->init_document('xml');
+            $this->initDocument('xml');
             $this->element('version', null, STATUSNET_VERSION);
-            $this->end_document('xml');
+            $this->endDocument('xml');
             break;
         case 'json':
-            $this->init_document('json');
+            $this->initDocument('json');
             print '"'.STATUSNET_VERSION.'"';
-            $this->end_document('json');
+            $this->endDocument('json');
             break;
         default:
             $this->clientError(
-                _('API method not found!'), 
-                404, 
+                _('API method not found.'),
+                404,
                 $this->format
             );
             break;
         }
     }
 
+    /**
+     * Return true if read only.
+     *
+     * MAY override
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean is read only action?
+     */
+
+    function isReadOnly($args)
+    {
+        return true;
+    }
+
 }