diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-07 00:33:54 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-07 00:33:54 +0200 |
commit | e071bfc14476877b9731bfe84904858444eb1dbd (patch) | |
tree | 9390d2e60965aa8b71bb0f31448aeb6541efbc1d /lib/public | |
parent | 3829a746a154863dc264bc83aa8bde4970d59949 (diff) | |
download | nextcloud-server-e071bfc14476877b9731bfe84904858444eb1dbd.tar.gz nextcloud-server-e071bfc14476877b9731bfe84904858444eb1dbd.zip |
fixing SecurityMiddleware to use OC6 API
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/appframework/http/templateresponse.php | 18 | ||||
-rw-r--r-- | lib/public/appframework/iappcontainer.php | 22 | ||||
-rw-r--r-- | lib/public/appframework/middleware.php | 1 |
3 files changed, 24 insertions, 17 deletions
diff --git a/lib/public/appframework/http/templateresponse.php b/lib/public/appframework/http/templateresponse.php index 97678c96cba..594530651aa 100644 --- a/lib/public/appframework/http/templateresponse.php +++ b/lib/public/appframework/http/templateresponse.php @@ -24,8 +24,6 @@ namespace OCP\AppFramework\Http; -use OC\AppFramework\Core\API; - /** * Response for a normal template @@ -34,20 +32,16 @@ class TemplateResponse extends Response { protected $templateName; protected $params; - protected $api; protected $renderAs; protected $appName; /** - * @param API $api an API instance * @param string $templateName the name of the template - * @param string $appName optional if you want to include a template from - * a different app + * @param string $appName the name of the app to load the template from */ - public function __construct(API $api, $templateName, $appName=null) { + public function __construct($appName, $templateName) { $this->templateName = $templateName; $this->appName = $appName; - $this->api = $api; $this->params = array(); $this->renderAs = 'user'; } @@ -108,13 +102,7 @@ class TemplateResponse extends Response { */ public function render(){ - if($this->appName !== null){ - $appName = $this->appName; - } else { - $appName = $this->api->getAppName(); - } - - $template = $this->api->getTemplate($this->templateName, $this->renderAs, $appName); + $template = new \OCP\Template($this->appName, $this->templateName, $this->renderAs); foreach($this->params as $key => $value){ $template->assign($key, $value); diff --git a/lib/public/appframework/iappcontainer.php b/lib/public/appframework/iappcontainer.php index 7d3b4b3bac7..7e6ec6016b7 100644 --- a/lib/public/appframework/iappcontainer.php +++ b/lib/public/appframework/iappcontainer.php @@ -50,8 +50,26 @@ interface IAppContainer extends IContainer{ function getServer(); /** - * @param IMiddleWare $middleWare + * @param Middleware $middleWare * @return boolean */ - function registerMiddleWare(IMiddleWare $middleWare); + function registerMiddleWare(Middleware $middleWare); + + /** + * @return boolean + */ + function isLoggedIn(); + + /** + * @return boolean + */ + function isAdminUser(); + + /** + * @param $message + * @param $level + * @return mixed + */ + function log($message, $level); + } diff --git a/lib/public/appframework/middleware.php b/lib/public/appframework/middleware.php index 12776c119c0..13b4b8cab99 100644 --- a/lib/public/appframework/middleware.php +++ b/lib/public/appframework/middleware.php @@ -24,6 +24,7 @@ namespace OCP\AppFramework; +use OCP\AppFramework\Controller\Controller; use OCP\AppFramework\Http\Response; |