aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-06-11 14:15:03 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-06-20 08:53:37 +0200
commit31392c24434c8dfbe770cec93ccb3c209392334e (patch)
treeb489fe7d181223b06c8c358be6922a47433ce1d8
parent366981fba6d01167c1ac38f559bd611062d8e534 (diff)
downloadnextcloud-server-31392c24434c8dfbe770cec93ccb3c209392334e.tar.gz
nextcloud-server-31392c24434c8dfbe770cec93ccb3c209392334e.zip
Move public auth page over
Now this is in core so the basics (that 99% of the app will want to use) looks always the same. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php17
-rw-r--r--core/css/publicshareauth.css (renamed from apps/files_sharing/css/authenticate.css)0
-rw-r--r--core/js/publicshareauth.js (renamed from apps/files_sharing/js/authenticate.js)0
-rw-r--r--core/templates/publicshareauth.php (renamed from apps/files_sharing/templates/authenticate.php)4
-rw-r--r--lib/public/AppFramework/AuthPublicShareController.php9
5 files changed, 8 insertions, 22 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 5c72bbd8c7b..cb54c0b28f1 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -172,23 +172,6 @@ class ShareController extends AuthPublicShareController {
}
/**
- * @PublicPage
- * @NoCSRFRequired
- *
- * @return TemplateResponse
- */
- public function showAuthenticate(): TemplateResponse {
- return new TemplateResponse($this->appName, 'authenticate', array(), 'guest');
- }
-
- /**
- * @return TemplateResponse
- */
- public function showAuthFailed(): TemplateResponse {
- return new TemplateResponse($this->appName, 'authenticate', array('wrongpw' => true), 'guest');
- }
-
- /**
* Authenticate a link item with the given password.
* Or use the session if no password is provided.
*
diff --git a/apps/files_sharing/css/authenticate.css b/core/css/publicshareauth.css
index 7f83e0b41e7..7f83e0b41e7 100644
--- a/apps/files_sharing/css/authenticate.css
+++ b/core/css/publicshareauth.css
diff --git a/apps/files_sharing/js/authenticate.js b/core/js/publicshareauth.js
index 7f3f0d0a7d4..7f3f0d0a7d4 100644
--- a/apps/files_sharing/js/authenticate.js
+++ b/core/js/publicshareauth.js
diff --git a/apps/files_sharing/templates/authenticate.php b/core/templates/publicshareauth.php
index 6f270c2851a..adcc2853f87 100644
--- a/apps/files_sharing/templates/authenticate.php
+++ b/core/templates/publicshareauth.php
@@ -2,8 +2,8 @@
/** @var $_ array */
/** @var $l \OCP\IL10N */
style('core', 'guest');
- style('files_sharing', 'authenticate');
- script('files_sharing', 'authenticate');
+ style('core', 'publicshareauth');
+ script('core', 'publicshareauth');
?>
<form method="post">
<fieldset class="warning">
diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php
index 7740faa5855..a22d381e1e3 100644
--- a/lib/public/AppFramework/AuthPublicShareController.php
+++ b/lib/public/AppFramework/AuthPublicShareController.php
@@ -26,7 +26,6 @@ namespace OCP\AppFramework;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
-use OCP\Files\NotFoundException;
use OCP\IRequest;
use OCP\ISession;
use OCP\IURLGenerator;
@@ -68,14 +67,18 @@ abstract class AuthPublicShareController extends PublicShareController {
*
* @since 14.0.0
*/
- abstract public function showAuthenticate(): TemplateResponse;
+ public function showAuthenticate(): TemplateResponse {
+ return new TemplateResponse('core', 'publicshareauth', [], 'guest');
+ }
/**
* The template to show when authentication failed
*
* @since 14.0.0
*/
- abstract protected function showAuthFailed(): TemplateResponse;
+ protected function showAuthFailed(): TemplateResponse {
+ return new TemplateResponse('core', 'publicshareauth', ['wrongpw' => true], 'guest');
+ }
/**
* Verify the password