@@ -28,23 +28,23 @@ |
||
| 28 | 28 | use OCP\IConfig; |
| 29 | 29 | |
| 30 | 30 | class ClearLostPasswordTokensCommand extends ALoginCommand { |
| 31 | - /** @var IConfig */ |
|
| 32 | - private $config; |
|
| 31 | + /** @var IConfig */ |
|
| 32 | + private $config; |
|
| 33 | 33 | |
| 34 | - public function __construct(IConfig $config) { |
|
| 35 | - $this->config = $config; |
|
| 36 | - } |
|
| 34 | + public function __construct(IConfig $config) { |
|
| 35 | + $this->config = $config; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * User has successfully logged in, now remove the password reset link, when it is available |
|
| 40 | - */ |
|
| 41 | - public function process(LoginData $loginData): LoginResult { |
|
| 42 | - $this->config->deleteUserValue( |
|
| 43 | - $loginData->getUser()->getUID(), |
|
| 44 | - 'core', |
|
| 45 | - 'lostpassword' |
|
| 46 | - ); |
|
| 38 | + /** |
|
| 39 | + * User has successfully logged in, now remove the password reset link, when it is available |
|
| 40 | + */ |
|
| 41 | + public function process(LoginData $loginData): LoginResult { |
|
| 42 | + $this->config->deleteUserValue( |
|
| 43 | + $loginData->getUser()->getUID(), |
|
| 44 | + 'core', |
|
| 45 | + 'lostpassword' |
|
| 46 | + ); |
|
| 47 | 47 | |
| 48 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
| 49 | - } |
|
| 48 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
| 49 | + } |
|
| 50 | 50 | } |
@@ -28,22 +28,22 @@ |
||
| 28 | 28 | use OC\User\Session; |
| 29 | 29 | |
| 30 | 30 | class CompleteLoginCommand extends ALoginCommand { |
| 31 | - /** @var Session */ |
|
| 32 | - private $userSession; |
|
| 31 | + /** @var Session */ |
|
| 32 | + private $userSession; |
|
| 33 | 33 | |
| 34 | - public function __construct(Session $userSession) { |
|
| 35 | - $this->userSession = $userSession; |
|
| 36 | - } |
|
| 34 | + public function __construct(Session $userSession) { |
|
| 35 | + $this->userSession = $userSession; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function process(LoginData $loginData): LoginResult { |
|
| 39 | - $this->userSession->completeLogin( |
|
| 40 | - $loginData->getUser(), |
|
| 41 | - [ |
|
| 42 | - 'loginName' => $loginData->getUsername(), |
|
| 43 | - 'password' => $loginData->getPassword(), |
|
| 44 | - ] |
|
| 45 | - ); |
|
| 38 | + public function process(LoginData $loginData): LoginResult { |
|
| 39 | + $this->userSession->completeLogin( |
|
| 40 | + $loginData->getUser(), |
|
| 41 | + [ |
|
| 42 | + 'loginName' => $loginData->getUsername(), |
|
| 43 | + 'password' => $loginData->getPassword(), |
|
| 44 | + ] |
|
| 45 | + ); |
|
| 46 | 46 | |
| 47 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
| 48 | - } |
|
| 47 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -29,27 +29,27 @@ |
||
| 29 | 29 | use OCP\IUser; |
| 30 | 30 | |
| 31 | 31 | class UidLoginCommand extends ALoginCommand { |
| 32 | - /** @var Manager */ |
|
| 33 | - private $userManager; |
|
| 34 | - |
|
| 35 | - public function __construct(Manager $userManager) { |
|
| 36 | - $this->userManager = $userManager; |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @param LoginData $loginData |
|
| 41 | - * |
|
| 42 | - * @return LoginResult |
|
| 43 | - */ |
|
| 44 | - public function process(LoginData $loginData): LoginResult { |
|
| 45 | - /* @var $loginResult IUser */ |
|
| 46 | - $user = $this->userManager->checkPasswordNoLogging( |
|
| 47 | - $loginData->getUsername(), |
|
| 48 | - $loginData->getPassword() |
|
| 49 | - ); |
|
| 50 | - |
|
| 51 | - $loginData->setUser($user); |
|
| 52 | - |
|
| 53 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
| 54 | - } |
|
| 32 | + /** @var Manager */ |
|
| 33 | + private $userManager; |
|
| 34 | + |
|
| 35 | + public function __construct(Manager $userManager) { |
|
| 36 | + $this->userManager = $userManager; |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @param LoginData $loginData |
|
| 41 | + * |
|
| 42 | + * @return LoginResult |
|
| 43 | + */ |
|
| 44 | + public function process(LoginData $loginData): LoginResult { |
|
| 45 | + /* @var $loginResult IUser */ |
|
| 46 | + $user = $this->userManager->checkPasswordNoLogging( |
|
| 47 | + $loginData->getUsername(), |
|
| 48 | + $loginData->getPassword() |
|
| 49 | + ); |
|
| 50 | + |
|
| 51 | + $loginData->setUser($user); |
|
| 52 | + |
|
| 53 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -30,25 +30,25 @@ |
||
| 30 | 30 | use OCP\IUserManager; |
| 31 | 31 | |
| 32 | 32 | class PreLoginHookCommand extends ALoginCommand { |
| 33 | - /** @var IUserManager */ |
|
| 34 | - private $userManager; |
|
| 33 | + /** @var IUserManager */ |
|
| 34 | + private $userManager; |
|
| 35 | 35 | |
| 36 | - public function __construct(IUserManager $userManager) { |
|
| 37 | - $this->userManager = $userManager; |
|
| 38 | - } |
|
| 36 | + public function __construct(IUserManager $userManager) { |
|
| 37 | + $this->userManager = $userManager; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public function process(LoginData $loginData): LoginResult { |
|
| 41 | - if ($this->userManager instanceof PublicEmitter) { |
|
| 42 | - $this->userManager->emit( |
|
| 43 | - '\OC\User', |
|
| 44 | - 'preLogin', |
|
| 45 | - [ |
|
| 46 | - $loginData->getUsername(), |
|
| 47 | - $loginData->getPassword(), |
|
| 48 | - ] |
|
| 49 | - ); |
|
| 50 | - } |
|
| 40 | + public function process(LoginData $loginData): LoginResult { |
|
| 41 | + if ($this->userManager instanceof PublicEmitter) { |
|
| 42 | + $this->userManager->emit( |
|
| 43 | + '\OC\User', |
|
| 44 | + 'preLogin', |
|
| 45 | + [ |
|
| 46 | + $loginData->getUsername(), |
|
| 47 | + $loginData->getPassword(), |
|
| 48 | + ] |
|
| 49 | + ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
| 53 | - } |
|
| 52 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -26,21 +26,21 @@ |
||
| 26 | 26 | namespace OC\Authentication\Login; |
| 27 | 27 | |
| 28 | 28 | abstract class ALoginCommand { |
| 29 | - /** @var ALoginCommand */ |
|
| 30 | - protected $next; |
|
| 29 | + /** @var ALoginCommand */ |
|
| 30 | + protected $next; |
|
| 31 | 31 | |
| 32 | - public function setNext(ALoginCommand $next): ALoginCommand { |
|
| 33 | - $this->next = $next; |
|
| 34 | - return $next; |
|
| 35 | - } |
|
| 32 | + public function setNext(ALoginCommand $next): ALoginCommand { |
|
| 33 | + $this->next = $next; |
|
| 34 | + return $next; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - protected function processNextOrFinishSuccessfully(LoginData $loginData): LoginResult { |
|
| 38 | - if ($this->next !== null) { |
|
| 39 | - return $this->next->process($loginData); |
|
| 40 | - } else { |
|
| 41 | - return LoginResult::success($loginData); |
|
| 42 | - } |
|
| 43 | - } |
|
| 37 | + protected function processNextOrFinishSuccessfully(LoginData $loginData): LoginResult { |
|
| 38 | + if ($this->next !== null) { |
|
| 39 | + return $this->next->process($loginData); |
|
| 40 | + } else { |
|
| 41 | + return LoginResult::success($loginData); |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - abstract public function process(LoginData $loginData): LoginResult; |
|
| 45 | + abstract public function process(LoginData $loginData): LoginResult; |
|
| 46 | 46 | } |
@@ -28,19 +28,19 @@ |
||
| 28 | 28 | use OCP\ISession; |
| 29 | 29 | |
| 30 | 30 | class UpdateLastPasswordConfirmCommand extends ALoginCommand { |
| 31 | - /** @var ISession */ |
|
| 32 | - private $session; |
|
| 31 | + /** @var ISession */ |
|
| 32 | + private $session; |
|
| 33 | 33 | |
| 34 | - public function __construct(ISession $session) { |
|
| 35 | - $this->session = $session; |
|
| 36 | - } |
|
| 34 | + public function __construct(ISession $session) { |
|
| 35 | + $this->session = $session; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function process(LoginData $loginData): LoginResult { |
|
| 39 | - $this->session->set( |
|
| 40 | - 'last-password-confirm', |
|
| 41 | - $loginData->getUser()->getLastLogin() |
|
| 42 | - ); |
|
| 38 | + public function process(LoginData $loginData): LoginResult { |
|
| 39 | + $this->session->set( |
|
| 40 | + 'last-password-confirm', |
|
| 41 | + $loginData->getUser()->getLastLogin() |
|
| 42 | + ); |
|
| 43 | 43 | |
| 44 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
| 45 | - } |
|
| 44 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -25,22 +25,22 @@ |
||
| 25 | 25 | namespace OC\App\AppStore\Bundles; |
| 26 | 26 | |
| 27 | 27 | class GroupwareBundle extends Bundle { |
| 28 | - /** |
|
| 29 | - * {@inheritDoc} |
|
| 30 | - */ |
|
| 31 | - public function getName() { |
|
| 32 | - return $this->l10n->t('Groupware bundle'); |
|
| 33 | - } |
|
| 28 | + /** |
|
| 29 | + * {@inheritDoc} |
|
| 30 | + */ |
|
| 31 | + public function getName() { |
|
| 32 | + return $this->l10n->t('Groupware bundle'); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * {@inheritDoc} |
|
| 37 | - */ |
|
| 38 | - public function getAppIdentifiers() { |
|
| 39 | - return [ |
|
| 40 | - 'calendar', |
|
| 41 | - 'contacts', |
|
| 42 | - 'deck', |
|
| 43 | - 'mail' |
|
| 44 | - ]; |
|
| 45 | - } |
|
| 35 | + /** |
|
| 36 | + * {@inheritDoc} |
|
| 37 | + */ |
|
| 38 | + public function getAppIdentifiers() { |
|
| 39 | + return [ |
|
| 40 | + 'calendar', |
|
| 41 | + 'contacts', |
|
| 42 | + 'deck', |
|
| 43 | + 'mail' |
|
| 44 | + ]; |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -24,25 +24,25 @@ |
||
| 24 | 24 | namespace OC\App\AppStore\Bundles; |
| 25 | 25 | |
| 26 | 26 | class EnterpriseBundle extends Bundle { |
| 27 | - /** |
|
| 28 | - * {@inheritDoc} |
|
| 29 | - */ |
|
| 30 | - public function getName(): string { |
|
| 31 | - return $this->l10n->t('Enterprise bundle'); |
|
| 32 | - } |
|
| 27 | + /** |
|
| 28 | + * {@inheritDoc} |
|
| 29 | + */ |
|
| 30 | + public function getName(): string { |
|
| 31 | + return $this->l10n->t('Enterprise bundle'); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * {@inheritDoc} |
|
| 36 | - */ |
|
| 37 | - public function getAppIdentifiers(): array { |
|
| 38 | - return [ |
|
| 39 | - 'admin_audit', |
|
| 40 | - 'user_ldap', |
|
| 41 | - 'files_retention', |
|
| 42 | - 'files_automatedtagging', |
|
| 43 | - 'user_saml', |
|
| 44 | - 'files_accesscontrol', |
|
| 45 | - 'terms_of_service', |
|
| 46 | - ]; |
|
| 47 | - } |
|
| 34 | + /** |
|
| 35 | + * {@inheritDoc} |
|
| 36 | + */ |
|
| 37 | + public function getAppIdentifiers(): array { |
|
| 38 | + return [ |
|
| 39 | + 'admin_audit', |
|
| 40 | + 'user_ldap', |
|
| 41 | + 'files_retention', |
|
| 42 | + 'files_automatedtagging', |
|
| 43 | + 'user_saml', |
|
| 44 | + 'files_accesscontrol', |
|
| 45 | + 'terms_of_service', |
|
| 46 | + ]; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -24,22 +24,22 @@ |
||
| 24 | 24 | namespace OC\App\AppStore\Bundles; |
| 25 | 25 | |
| 26 | 26 | class SocialSharingBundle extends Bundle { |
| 27 | - /** |
|
| 28 | - * {@inheritDoc} |
|
| 29 | - */ |
|
| 30 | - public function getName() { |
|
| 31 | - return $this->l10n->t('Social sharing bundle'); |
|
| 32 | - } |
|
| 27 | + /** |
|
| 28 | + * {@inheritDoc} |
|
| 29 | + */ |
|
| 30 | + public function getName() { |
|
| 31 | + return $this->l10n->t('Social sharing bundle'); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * {@inheritDoc} |
|
| 36 | - */ |
|
| 37 | - public function getAppIdentifiers() { |
|
| 38 | - return [ |
|
| 39 | - 'socialsharing_twitter', |
|
| 40 | - 'socialsharing_facebook', |
|
| 41 | - 'socialsharing_email', |
|
| 42 | - 'socialsharing_diaspora', |
|
| 43 | - ]; |
|
| 44 | - } |
|
| 34 | + /** |
|
| 35 | + * {@inheritDoc} |
|
| 36 | + */ |
|
| 37 | + public function getAppIdentifiers() { |
|
| 38 | + return [ |
|
| 39 | + 'socialsharing_twitter', |
|
| 40 | + 'socialsharing_facebook', |
|
| 41 | + 'socialsharing_email', |
|
| 42 | + 'socialsharing_diaspora', |
|
| 43 | + ]; |
|
| 44 | + } |
|
| 45 | 45 | } |