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>
This commit is contained in:
parent
366981fba6
commit
31392c2443
|
@ -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…
Reference in New Issue