diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-03-03 12:52:27 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-03-11 16:37:42 +0100 |
commit | 1a0f9c375be12502d9b016c6bdb4c898ec765bbd (patch) | |
tree | 6b287f2d71e94740b364d17a5f23424d5f6668aa /core/routes.php | |
parent | cfaee93552b519b8e017e63fd5a82b1e5c9f951b (diff) | |
download | nextcloud-server-1a0f9c375be12502d9b016c6bdb4c898ec765bbd.tar.gz nextcloud-server-1a0f9c375be12502d9b016c6bdb4c898ec765bbd.zip |
Avatar controller moved to AppFrameWork
* Original avatarcontroller migrated to the appframework
* Added DataDisplayResponse that show data inline in the browser (used
to retrun the image)
* Removed some unneeded code
* Added unit tests for the avatarcontroller
Diffstat (limited to 'core/routes.php')
-rw-r--r-- | core/routes.php | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/core/routes.php b/core/routes.php index defbb695a71..afa2768e607 100644 --- a/core/routes.php +++ b/core/routes.php @@ -9,13 +9,19 @@ use OC\Core\Application; $application = new Application(); -$application->registerRoutes($this, array('routes' => array( - array('name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'), - array('name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'), - array('name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'), - array('name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'), - ) -)); +$application->registerRoutes($this, [ + 'routes' => [ + ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], + ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], + ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], + ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], + ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], + ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], + ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'], + ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'], + ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'], + ] +]); // Post installation check @@ -77,22 +83,6 @@ $this->create('core_ajax_preview', '/core/preview.png') ->actionInclude('core/ajax/preview.php'); $this->create('core_ajax_update', '/core/ajax/update.php') ->actionInclude('core/ajax/update.php'); -// Avatar routes -$this->create('core_avatar_get_tmp', '/avatar/tmp') - ->get() - ->action('OC\Core\Avatar\Controller', 'getTmpAvatar'); -$this->create('core_avatar_get', '/avatar/{user}/{size}') - ->get() - ->action('OC\Core\Avatar\Controller', 'getAvatar'); -$this->create('core_avatar_post', '/avatar/') - ->post() - ->action('OC\Core\Avatar\Controller', 'postAvatar'); -$this->create('core_avatar_delete', '/avatar/') - ->delete() - ->action('OC\Core\Avatar\Controller', 'deleteAvatar'); -$this->create('core_avatar_post_cropped', '/avatar/cropped') - ->post() - ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar'); // Sharing routes $this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(function($urlParams) { |