summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2016-06-09 17:41:57 +0200
committerblizzz <blizzz@arthur-schiwon.de>2016-06-09 17:41:57 +0200
commit51fd2602a77d8d885c53d24ebb8f72be62dc52ce (patch)
tree2c38e740669ab2fa6ab50615187d01b9d6dc00d1 /core
parentb688aac402cf9d7ee08252077d37ea1c43b22f4a (diff)
downloadnextcloud-server-51fd2602a77d8d885c53d24ebb8f72be62dc52ce.tar.gz
nextcloud-server-51fd2602a77d8d885c53d24ebb8f72be62dc52ce.zip
Revert "Downstream 2016-06-08"
Diffstat (limited to 'core')
-rw-r--r--core/Application.php3
-rw-r--r--core/Command/Encryption/DecryptAll.php14
-rw-r--r--core/Controller/TokenController.php36
-rw-r--r--core/Controller/TwoFactorChallengeController.php9
-rw-r--r--core/Middleware/TwoFactorMiddleware.php5
-rw-r--r--core/css/styles.css4
-rw-r--r--core/templates/twofactorselectchallenge.php3
-rw-r--r--core/templates/twofactorshowchallenge.php1
8 files changed, 15 insertions, 60 deletions
diff --git a/core/Application.php b/core/Application.php
index a87917b626a..25e2fa76273 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -120,8 +120,7 @@ class Application extends App {
$c->query('AppName'),
$c->query('Request'),
$c->query('UserManager'),
- $c->query('ServerContainer')->query('OC\Authentication\Token\IProvider'),
- $c->query('TwoFactorAuthManager'),
+ $c->query('OC\Authentication\Token\DefaultTokenProvider'),
$c->query('SecureRandom')
);
});
diff --git a/core/Command/Encryption/DecryptAll.php b/core/Command/Encryption/DecryptAll.php
index d060918a506..8d7d26f3d23 100644
--- a/core/Command/Encryption/DecryptAll.php
+++ b/core/Command/Encryption/DecryptAll.php
@@ -111,8 +111,7 @@ class DecryptAll extends Command {
$this->addArgument(
'user',
InputArgument::OPTIONAL,
- 'user for which you want to decrypt all files (optional)',
- ''
+ 'user for which you want to decrypt all files (optional)'
);
}
@@ -128,16 +127,8 @@ class DecryptAll extends Command {
return;
}
- $uid = $input->getArgument('user');
- //FIXME WHEN https://github.com/owncloud/core/issues/24994 is fixed
- if ($uid === null) {
- $message = 'your ownCloud';
- } else {
- $message = "$uid's account";
- }
-
$output->writeln("\n");
- $output->writeln("You are about to start to decrypt all files stored in $message.");
+ $output->writeln('You are about to start to decrypt all files stored in your ownCloud.');
$output->writeln('It will depend on the encryption module and your setup if this is possible.');
$output->writeln('Depending on the number and size of your files this can take some time');
$output->writeln('Please make sure that no user access his files during this process!');
@@ -149,7 +140,6 @@ class DecryptAll extends Command {
$result = $this->decryptAll->decryptAll($input, $output, $user);
if ($result === false) {
$output->writeln(' aborted.');
- $output->writeln('Server side encryption remains enabled');
$this->config->setAppValue('core', 'encryption_enabled', 'yes');
}
$this->resetSingleUserAndTrashbin();
diff --git a/core/Controller/TokenController.php b/core/Controller/TokenController.php
index 13b1db9044a..42cc29bad10 100644
--- a/core/Controller/TokenController.php
+++ b/core/Controller/TokenController.php
@@ -1,5 +1,4 @@
<?php
-
/**
* @author Christoph Wurst <christoph@owncloud.com>
*
@@ -24,27 +23,22 @@ namespace OC\Core\Controller;
use OC\AppFramework\Http;
use OC\Authentication\Token\DefaultTokenProvider;
-use OC\Authentication\Token\IProvider;
use OC\Authentication\Token\IToken;
-use OC\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager;
-use OC\User\Manager as UserManager;
-use OCA\User_LDAP\User\Manager;
+use OC\User\Manager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
+use OCP\AppFramework\Http\Response;
use OCP\IRequest;
use OCP\Security\ISecureRandom;
class TokenController extends Controller {
- /** @var UserManager */
+ /** @var Manager */
private $userManager;
- /** @var IProvider */
+ /** @var DefaultTokenProvider */
private $tokenProvider;
- /** @var TwoFactorAuthManager */
- private $twoFactorAuthManager;
-
/** @var ISecureRandom */
private $secureRandom;
@@ -55,12 +49,12 @@ class TokenController extends Controller {
* @param DefaultTokenProvider $tokenProvider
* @param ISecureRandom $secureRandom
*/
- public function __construct($appName, IRequest $request, UserManager $userManager, IProvider $tokenProvider, TwoFactorAuthManager $twoFactorAuthManager, ISecureRandom $secureRandom) {
+ public function __construct($appName, IRequest $request, Manager $userManager, DefaultTokenProvider $tokenProvider,
+ ISecureRandom $secureRandom) {
parent::__construct($appName, $request);
$this->userManager = $userManager;
$this->tokenProvider = $tokenProvider;
$this->secureRandom = $secureRandom;
- $this->twoFactorAuthManager = $twoFactorAuthManager;
}
/**
@@ -76,26 +70,18 @@ class TokenController extends Controller {
*/
public function generateToken($user, $password, $name = 'unknown client') {
if (is_null($user) || is_null($password)) {
- $response = new JSONResponse();
+ $response = new Response();
$response->setStatus(Http::STATUS_UNPROCESSABLE_ENTITY);
return $response;
}
- $loginName = $user;
- $user = $this->userManager->checkPassword($loginName, $password);
- if ($user === false) {
- $response = new JSONResponse();
+ $loginResult = $this->userManager->checkPassword($user, $password);
+ if ($loginResult === false) {
+ $response = new Response();
$response->setStatus(Http::STATUS_UNAUTHORIZED);
return $response;
}
-
- if ($this->twoFactorAuthManager->isTwoFactorAuthenticated($user)) {
- $resp = new JSONResponse();
- $resp->setStatus(Http::STATUS_UNAUTHORIZED);
- return $resp;
- }
-
$token = $this->secureRandom->generate(128);
- $this->tokenProvider->generateToken($token, $user->getUID(), $loginName, $password, $name, IToken::PERMANENT_TOKEN);
+ $this->tokenProvider->generateToken($token, $loginResult->getUID(), $user, $password, $name, IToken::PERMANENT_TOKEN);
return [
'token' => $token,
];
diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php
index edaf3378cd8..499898de3bc 100644
--- a/core/Controller/TwoFactorChallengeController.php
+++ b/core/Controller/TwoFactorChallengeController.php
@@ -62,13 +62,6 @@ class TwoFactorChallengeController extends Controller {
}
/**
- * @return string
- */
- protected function getLogoutAttribute() {
- return \OC_User::getLogoutAttribute();
- }
-
- /**
* @NoAdminRequired
* @NoCSRFRequired
*
@@ -82,7 +75,6 @@ class TwoFactorChallengeController extends Controller {
$data = [
'providers' => $providers,
'redirect_url' => $redirect_url,
- 'logout_attribute' => $this->getLogoutAttribute(),
];
return new TemplateResponse($this->appName, 'twofactorselectchallenge', $data, 'guest');
}
@@ -114,7 +106,6 @@ class TwoFactorChallengeController extends Controller {
$data = [
'error' => $error,
'provider' => $provider,
- 'logout_attribute' => $this->getLogoutAttribute(),
'template' => $tmpl->fetchPage(),
];
return new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest');
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php
index 0bad8a2c40f..aa82897ad46 100644
--- a/core/Middleware/TwoFactorMiddleware.php
+++ b/core/Middleware/TwoFactorMiddleware.php
@@ -82,11 +82,6 @@ class TwoFactorMiddleware extends Middleware {
return;
}
- if ($controller instanceof \OC\Core\Controller\LoginController && $methodName === 'logout') {
- // Don't block the logout page, to allow canceling the 2FA
- return;
- }
-
if ($this->userSession->isLoggedIn()) {
$user = $this->userSession->getUser();
diff --git a/core/css/styles.css b/core/css/styles.css
index 475c4fa3fb3..df9509baa19 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -38,10 +38,6 @@ body {
display: inline-block;
}
-a.two-factor-cancel {
- color: #fff;
-}
-
.float-spinner {
height: 32px;
display: none;
diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php
index 4209beac4e6..14d599aab3e 100644
--- a/core/templates/twofactorselectchallenge.php
+++ b/core/templates/twofactorselectchallenge.php
@@ -18,5 +18,4 @@
</li>
<?php endforeach; ?>
</ul>
-</fieldset>
-<a class="two-factor-cancel" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel login')) ?></a>
+</fieldset> \ No newline at end of file
diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php
index c5ee9aca4b4..66f5ed312ec 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -17,4 +17,3 @@ $template = $_['template'];
<span class="warning"><?php p($l->t('An error occured while verifying the token')); ?></span>
<?php endif; ?>
<?php print_unescaped($template); ?>
-<a class="two-factor-cancel" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel login')) ?></a>