@@ -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 | } |
@@ -38,20 +38,20 @@ |
||
38 | 38 | * @since 20.0.0 |
39 | 39 | */ |
40 | 40 | interface IContextPortation { |
41 | - /** |
|
42 | - * All relevant context identifiers that are needed to restore the state |
|
43 | - * of an entity shall be returned with this method. The resulting array |
|
44 | - * must be JSON-serializable. |
|
45 | - * |
|
46 | - * @since 20.0.0 |
|
47 | - */ |
|
48 | - public function exportContextIDs(): array; |
|
41 | + /** |
|
42 | + * All relevant context identifiers that are needed to restore the state |
|
43 | + * of an entity shall be returned with this method. The resulting array |
|
44 | + * must be JSON-serializable. |
|
45 | + * |
|
46 | + * @since 20.0.0 |
|
47 | + */ |
|
48 | + public function exportContextIDs(): array; |
|
49 | 49 | |
50 | - /** |
|
51 | - * This method receives the array as returned by `exportContextIDs()` in |
|
52 | - * order to restore the state of the IEntity if necessary. |
|
53 | - * |
|
54 | - * @since 20.0.0 |
|
55 | - */ |
|
56 | - public function importContextIDs(array $contextIDs): void; |
|
50 | + /** |
|
51 | + * This method receives the array as returned by `exportContextIDs()` in |
|
52 | + * order to restore the state of the IEntity if necessary. |
|
53 | + * |
|
54 | + * @since 20.0.0 |
|
55 | + */ |
|
56 | + public function importContextIDs(array $contextIDs): void; |
|
57 | 57 | } |
@@ -32,15 +32,15 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IDisplayText { |
35 | - /** |
|
36 | - * returns translated text used for display to the end user. For instance, |
|
37 | - * it can describe the event in a human readable way. |
|
38 | - * |
|
39 | - * The entity may react to a verbosity level that is provided. With the |
|
40 | - * basic level, 0, it would return brief information, and more with higher |
|
41 | - * numbers. All information shall be shown at a level of 3. |
|
42 | - * |
|
43 | - * @since 18.0.0 |
|
44 | - */ |
|
45 | - public function getDisplayText(int $verbosity = 0): string; |
|
35 | + /** |
|
36 | + * returns translated text used for display to the end user. For instance, |
|
37 | + * it can describe the event in a human readable way. |
|
38 | + * |
|
39 | + * The entity may react to a verbosity level that is provided. With the |
|
40 | + * basic level, 0, it would return brief information, and more with higher |
|
41 | + * numbers. All information shall be shown at a level of 3. |
|
42 | + * |
|
43 | + * @since 18.0.0 |
|
44 | + */ |
|
45 | + public function getDisplayText(int $verbosity = 0): string; |
|
46 | 46 | } |