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:
Roeland Jago Douma 2018-06-11 14:15:03 +02:00
parent 366981fba6
commit 31392c2443
No known key found for this signature in database
GPG Key ID: F941078878347C0C
5 changed files with 8 additions and 22 deletions

View File

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

View File

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

View File

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