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>
pull/9518/head
Roeland Jago Douma 7 years ago
parent 366981fba6
commit 31392c2443
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 17
      apps/files_sharing/lib/Controller/ShareController.php
  2. 0
      core/css/publicshareauth.css
  3. 0
      core/js/publicshareauth.js
  4. 4
      core/templates/publicshareauth.php
  5. 9
      lib/public/AppFramework/AuthPublicShareController.php

@ -171,23 +171,6 @@ class ShareController extends AuthPublicShareController {
$this->session->set('public_link_authenticated', (string)$this->share->getId());
}
/**
* @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.

@ -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">

@ -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

Loading…
Cancel
Save