aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-02-04 08:54:56 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-02-06 11:26:18 +0100
commitb68567e9ba5b4b081378061bf938b5b505638fb3 (patch)
tree801af720fe93b968a225e852cdbc582bb352a632 /core/Controller
parentd88604015a0828e78a05bf7f1ee80bb78f980dae (diff)
downloadnextcloud-server-b68567e9ba5b4b081378061bf938b5b505638fb3.tar.gz
nextcloud-server-b68567e9ba5b4b081378061bf938b5b505638fb3.zip
Add StandaloneTemplateResponse
This can be used by pages that do not have the full Nextcloud UI. So notifications etc do not load there. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/ClientFlowLoginController.php16
-rw-r--r--core/Controller/TwoFactorChallengeController.php10
2 files changed, 13 insertions, 13 deletions
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index b58f56194c7..f73e3f260a7 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -36,7 +36,7 @@ use OCA\OAuth2\Db\ClientMapper;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Response;
-use OCP\AppFramework\Http\TemplateResponse;
+use OCP\AppFramework\Http\StandaloneTemplateResponse;
use OCP\Defaults;
use OCP\IL10N;
use OCP\IRequest;
@@ -131,10 +131,10 @@ class ClientFlowLoginController extends Controller {
}
/**
- * @return TemplateResponse
+ * @return StandaloneTemplateResponse
*/
private function stateTokenForbiddenResponse() {
- $response = new TemplateResponse(
+ $response = new StandaloneTemplateResponse(
$this->appName,
'403',
[
@@ -153,7 +153,7 @@ class ClientFlowLoginController extends Controller {
*
* @param string $clientIdentifier
*
- * @return TemplateResponse
+ * @return StandaloneTemplateResponse
*/
public function showAuthPickerPage($clientIdentifier = '') {
$clientName = $this->getClientName();
@@ -166,7 +166,7 @@ class ClientFlowLoginController extends Controller {
// No valid clientIdentifier given and no valid API Request (APIRequest header not set)
$clientRequest = $this->request->getHeader('OCS-APIREQUEST');
if ($clientRequest !== 'true' && $client === null) {
- return new TemplateResponse(
+ return new StandaloneTemplateResponse(
$this->appName,
'error',
[
@@ -188,7 +188,7 @@ class ClientFlowLoginController extends Controller {
);
$this->session->set(self::stateName, $stateToken);
- return new TemplateResponse(
+ return new StandaloneTemplateResponse(
$this->appName,
'loginflow/authpicker',
[
@@ -212,7 +212,7 @@ class ClientFlowLoginController extends Controller {
*
* @param string $stateToken
* @param string $clientIdentifier
- * @return TemplateResponse
+ * @return StandaloneTemplateResponse
*/
public function grantPage($stateToken = '',
$clientIdentifier = '') {
@@ -227,7 +227,7 @@ class ClientFlowLoginController extends Controller {
$clientName = $client->getName();
}
- return new TemplateResponse(
+ return new StandaloneTemplateResponse(
$this->appName,
'loginflow/grant',
[
diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php
index 3d14b157f77..7405e66cdfc 100644
--- a/core/Controller/TwoFactorChallengeController.php
+++ b/core/Controller/TwoFactorChallengeController.php
@@ -31,7 +31,7 @@ use OC_User;
use OC_Util;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\RedirectResponse;
-use OCP\AppFramework\Http\TemplateResponse;
+use OCP\AppFramework\Http\StandaloneTemplateResponse;
use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\Authentication\TwoFactorAuth\IProvidesCustomCSP;
use OCP\Authentication\TwoFactorAuth\TwoFactorException;
@@ -100,7 +100,7 @@ class TwoFactorChallengeController extends Controller {
* @NoCSRFRequired
*
* @param string $redirect_url
- * @return TemplateResponse
+ * @return StandaloneTemplateResponse
*/
public function selectChallenge($redirect_url) {
$user = $this->userSession->getUser();
@@ -115,7 +115,7 @@ class TwoFactorChallengeController extends Controller {
'redirect_url' => $redirect_url,
'logout_url' => $this->getLogoutUrl(),
];
- return new TemplateResponse($this->appName, 'twofactorselectchallenge', $data, 'guest');
+ return new StandaloneTemplateResponse($this->appName, 'twofactorselectchallenge', $data, 'guest');
}
/**
@@ -125,7 +125,7 @@ class TwoFactorChallengeController extends Controller {
*
* @param string $challengeProviderId
* @param string $redirect_url
- * @return TemplateResponse|RedirectResponse
+ * @return StandaloneTemplateResponse|RedirectResponse
*/
public function showChallenge($challengeProviderId, $redirect_url) {
$user = $this->userSession->getUser();
@@ -160,7 +160,7 @@ class TwoFactorChallengeController extends Controller {
'redirect_url' => $redirect_url,
'template' => $tmpl->fetchPage(),
];
- $response = new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
+ $response = new StandaloneTemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
if ($provider instanceof IProvidesCustomCSP) {
$response->setContentSecurityPolicy($provider->getCSP());
}