]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/router.php
Add config option for RequireValidatedEmail plugin to skip the check for folks with...
[quix0rs-gnu-social.git] / lib / router.php
index abbce041dbfe5ac5ac504491fa1c4e5b128708b0..a9d07276f3cab33284dc97547a52f375da143827 100644 (file)
@@ -33,6 +33,33 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 
 require_once 'Net/URL/Mapper.php';
 
+class StatusNet_URL_Mapper extends Net_URL_Mapper {
+
+    private static $_singleton = null;
+
+    private function __construct()
+    {
+    }
+
+    public static function getInstance($id = '__default__')
+    {
+        if (empty(self::$_singleton)) {
+            self::$_singleton = new StatusNet_URL_Mapper();
+        }
+        return self::$_singleton;
+    }
+
+    public function connect($path, $defaults = array(), $rules = array())
+    {
+        $result = null;
+        if (Event::handle('StartConnectPath', array(&$path, &$defaults, &$rules, &$result))) {
+            $result = parent::connect($path, $defaults, $rules);
+            Event::handle('EndConnectPath', array($path, $defaults, $rules, $result));
+        }
+        return $result;
+    }
+}
+
 /**
  * URL Router
  *
@@ -69,7 +96,7 @@ class Router
 
     function initialize()
     {
-        $m = Net_URL_Mapper::getInstance();
+        $m = StatusNet_URL_Mapper::getInstance();
 
         if (Event::handle('StartInitializeRouter', array(&$m))) {
 
@@ -98,6 +125,7 @@ class Router
                           'groupblock', 'groupunblock',
                           'sandbox', 'unsandbox',
                           'silence', 'unsilence',
+                          'grantrole', 'revokerole',
                           'repeat',
                           'deleteuser',
                           'geocode',
@@ -627,6 +655,12 @@ class Router
                         array('action' => 'ApiTimelineTag',
                               'format' => '(xmljson|rss|atom)'));
 
+            // media related
+            $m->connect(
+                'api/statusnet/media/upload',
+                array('action' => 'ApiMediaUpload')
+            );
+
             // search
             $m->connect('api/search.atom', array('action' => 'twitapisearchatom'));
             $m->connect('api/search.json', array('action' => 'twitapisearchjson'));
@@ -649,6 +683,8 @@ class Router
                $m->connect('admin/access', array('action' => 'accessadminpanel'));
             $m->connect('admin/paths', array('action' => 'pathsadminpanel'));
             $m->connect('admin/sessions', array('action' => 'sessionsadminpanel'));
+            $m->connect('admin/sitenotice', array('action' => 'sitenoticeadminpanel'));
+            $m->connect('admin/snapshot', array('action' => 'snapshotadminpanel'));
 
             $m->connect('getfile/:filename',
                         array('action' => 'getfile'),