]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/router.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / lib / router.php
index 0ced86f34ef94bccb75385fb9e97e2a80f57df5e..b9698294925a94a337be3ef95ff76d6b5e814639 100644 (file)
@@ -160,7 +160,16 @@ class Router
     
     static function cacheKey()
     {
-        return Cache::codeKey('router');
+        $parts = array('router');
+
+        // Many router paths depend on this setting.
+        if (common_config('singleuser', 'enabled')) {
+            $parts[] = '1user';
+        } else {
+            $parts[] = 'multi';
+        }
+
+        return Cache::codeKey(implode(':', $parts));
     }
     
     function initialize()
@@ -199,6 +208,9 @@ class Router
                           'deleteuser',
                           'geocode',
                           'version',
+                          'backupaccount',
+                          'deleteaccount',
+                          'restoreaccount',
             );
 
             foreach ($main as $a) {
@@ -243,7 +255,7 @@ class Router
             // settings
 
             foreach (array('profile', 'avatar', 'password', 'im', 'oauthconnections',
-                           'oauthapps', 'email', 'sms', 'userdesign', 'other') as $s) {
+                           'oauthapps', 'email', 'sms', 'userdesign', 'url') as $s) {
                 $m->connect('settings/'.$s, array('action' => $s.'settings'));
             }
 
@@ -393,6 +405,11 @@ class Router
 
             // statuses API
 
+            $m->connect('api',
+                        array('action' => 'Redirect',
+                              'nextAction' => 'doc',
+                              'args' => array('title' => 'api')));
+
             $m->connect('api/statuses/public_timeline.:format',
                         array('action' => 'ApiTimelinePublic',
                               'format' => '(xml|json|rss|atom)'));
@@ -515,6 +532,11 @@ class Router
                               'id' => Nickname::INPUT_FMT,
                               'format' => '(xml|json)'));
 
+            $m->connect('api/users/profile_image/:screen_name.:format',
+                        array('action' => 'ApiUserProfileImage',
+                              'screen_name' => Nickname::DISPLAY_FMT,
+                              'format' => '(xml|json)'));
+
             // direct messages
 
             $m->connect('api/direct_messages.:format',
@@ -736,6 +758,12 @@ class Router
             $m->connect('api/statusnet/groups/create.:format',
                         array('action' => 'ApiGroupCreate',
                               'format' => '(xml|json)'));
+
+            $m->connect('api/statusnet/groups/update/:id.:format',
+                        array('action' => 'ApiGroupProfileUpdate',
+                              'id' => '[a-zA-Z0-9]+',
+                              'format' => '(xml|json)'));
+
             // Tags
             $m->connect('api/statusnet/tags/timeline/:tag.:format',
                         array('action' => 'ApiTimelineTag',
@@ -773,6 +801,14 @@ class Router
             $m->connect('admin/snapshot', array('action' => 'snapshotadminpanel'));
             $m->connect('admin/license', array('action' => 'licenseadminpanel'));
 
+            $m->connect('admin/plugins', array('action' => 'pluginsadminpanel'));
+            $m->connect('admin/plugins/enable/:plugin',
+                        array('action' => 'pluginenable'),
+                        array('plugin' => '[A-Za-z0-9_]+'));
+            $m->connect('admin/plugins/disable/:plugin',
+                        array('action' => 'plugindisable'),
+                        array('plugin' => '[A-Za-z0-9_]+'));
+
             $m->connect('getfile/:filename',
                         array('action' => 'getfile'),
                         array('filename' => '[A-Za-z0-9._-]+'));
@@ -905,8 +941,8 @@ class Router
             // AtomPub API
 
             $m->connect('api/statusnet/app/service/:id.xml',
-                        array('action' => 'ApiAtomService',
-                              'id' => Nickname::DISPLAY_FMT));
+                        array('action' => 'ApiAtomService'),
+                        array('id' => Nickname::DISPLAY_FMT));
 
             $m->connect('api/statusnet/app/service.xml',
                         array('action' => 'ApiAtomService'));
@@ -929,6 +965,15 @@ class Router
                         array('action' => 'AtomPubFavoriteFeed'),
                         array('profile' => '[0-9]+'));
 
+            $m->connect('api/statusnet/app/memberships/:profile/:group.atom',
+                        array('action' => 'AtomPubShowMembership'),
+                        array('profile' => '[0-9]+',
+                              'group' => '[0-9]+'));
+
+            $m->connect('api/statusnet/app/memberships/:profile.atom',
+                        array('action' => 'AtomPubMembershipFeed'),
+                        array('profile' => '[0-9]+'));
+
             // user stuff
 
             Event::handle('RouterInitialized', array($m));