Translate "Permission denied" & use class-autoloader

remotes/origin/stable6
kondou 12 years ago
parent e6473e6d49
commit 1b45683168
  1. 5
      core/avatar/controller.php
  2. 11
      core/routes.php

@ -6,11 +6,12 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
class CoreAvatarController { class OC_Core_Avatar_Controller {
public static function getAvatar($args) { public static function getAvatar($args) {
if (!\OC_User::isLoggedIn()) { if (!\OC_User::isLoggedIn()) {
$l = new \OC_L10n('core');
header("HTTP/1.0 403 Forbidden"); header("HTTP/1.0 403 Forbidden");
\OC_Template::printErrorPage("Permission denied"); \OC_Template::printErrorPage($l->t("Permission denied"));
return; return;
} }

@ -58,24 +58,23 @@ $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{
->action('OC_Core_LostPassword_Controller', 'resetPassword'); ->action('OC_Core_LostPassword_Controller', 'resetPassword');
// Avatar routes // Avatar routes
OC::$CLASSPATH['CoreAvatarController'] = 'core/avatar/controller.php';
$this->create('core_avatar_get', '/avatar/{user}/{size}') $this->create('core_avatar_get', '/avatar/{user}/{size}')
->defaults(array('user' => '', 'size' => 64)) ->defaults(array('user' => '', 'size' => 64))
->get() ->get()
->action('CoreAvatarController', 'getAvatar'); ->action('OC_Core_Avatar_Controller', 'getAvatar');
$this->create('core_avatar_post', '/avatar/') $this->create('core_avatar_post', '/avatar/')
->post() ->post()
->action('CoreAvatarController', 'postAvatar'); ->action('OC_Core_Avatar_Controller', 'postAvatar');
$this->create('core_avatar_delete', '/avatar/') $this->create('core_avatar_delete', '/avatar/')
->delete() ->delete()
->action('CoreAvatarController', 'deleteAvatar'); ->action('OC_Core_Avatar_Controller', 'deleteAvatar');
$this->create('core_avatar_get_tmp', '/avatar/tmp/{size}') $this->create('core_avatar_get_tmp', '/avatar/tmp/{size}')
->defaults(array('size' => 64)) ->defaults(array('size' => 64))
->get() ->get()
->action('CoreAvatarController', 'getTmpAvatar'); ->action('OC_Core_Avatar_Controller', 'getTmpAvatar');
$this->create('core_avatar_post_cropped', '/avatar/cropped') $this->create('core_avatar_post_cropped', '/avatar/cropped')
->post() ->post()
->action('CoreAvatarController', 'postCroppedAvatar'); ->action('OC_Core_Avatar_Controller', 'postCroppedAvatar');
// Not specifically routed // Not specifically routed
$this->create('app_css', '/apps/{app}/{file}') $this->create('app_css', '/apps/{app}/{file}')

Loading…
Cancel
Save