@@ -26,60 +26,60 @@ |
||
26 | 26 | |
27 | 27 | class RequestUserAgent extends AbstractStringCheck { |
28 | 28 | |
29 | - /** @var IRequest */ |
|
30 | - protected $request; |
|
29 | + /** @var IRequest */ |
|
30 | + protected $request; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param IL10N $l |
|
34 | - * @param IRequest $request |
|
35 | - */ |
|
36 | - public function __construct(IL10N $l, IRequest $request) { |
|
37 | - parent::__construct($l); |
|
38 | - $this->request = $request; |
|
39 | - } |
|
32 | + /** |
|
33 | + * @param IL10N $l |
|
34 | + * @param IRequest $request |
|
35 | + */ |
|
36 | + public function __construct(IL10N $l, IRequest $request) { |
|
37 | + parent::__construct($l); |
|
38 | + $this->request = $request; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param string $operator |
|
43 | - * @param string $value |
|
44 | - * @return bool |
|
45 | - */ |
|
46 | - public function executeCheck($operator, $value) { |
|
47 | - $actualValue = $this->getActualValue(); |
|
48 | - if (in_array($operator, ['is', '!is'], true)) { |
|
49 | - switch ($value) { |
|
50 | - case 'android': |
|
51 | - $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
52 | - $value = IRequest::USER_AGENT_CLIENT_ANDROID; |
|
53 | - break; |
|
54 | - case 'ios': |
|
55 | - $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
56 | - $value = IRequest::USER_AGENT_CLIENT_IOS; |
|
57 | - break; |
|
58 | - case 'desktop': |
|
59 | - $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
60 | - $value = IRequest::USER_AGENT_CLIENT_DESKTOP; |
|
61 | - break; |
|
62 | - case 'mail': |
|
63 | - if ($operator === 'is') { |
|
64 | - return $this->executeStringCheck('matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) |
|
65 | - || $this->executeStringCheck('matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); |
|
66 | - } |
|
41 | + /** |
|
42 | + * @param string $operator |
|
43 | + * @param string $value |
|
44 | + * @return bool |
|
45 | + */ |
|
46 | + public function executeCheck($operator, $value) { |
|
47 | + $actualValue = $this->getActualValue(); |
|
48 | + if (in_array($operator, ['is', '!is'], true)) { |
|
49 | + switch ($value) { |
|
50 | + case 'android': |
|
51 | + $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
52 | + $value = IRequest::USER_AGENT_CLIENT_ANDROID; |
|
53 | + break; |
|
54 | + case 'ios': |
|
55 | + $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
56 | + $value = IRequest::USER_AGENT_CLIENT_IOS; |
|
57 | + break; |
|
58 | + case 'desktop': |
|
59 | + $operator = $operator === 'is' ? 'matches' : '!matches'; |
|
60 | + $value = IRequest::USER_AGENT_CLIENT_DESKTOP; |
|
61 | + break; |
|
62 | + case 'mail': |
|
63 | + if ($operator === 'is') { |
|
64 | + return $this->executeStringCheck('matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) |
|
65 | + || $this->executeStringCheck('matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); |
|
66 | + } |
|
67 | 67 | |
68 | - return $this->executeStringCheck('!matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) |
|
69 | - && $this->executeStringCheck('!matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); |
|
70 | - } |
|
71 | - } |
|
72 | - return $this->executeStringCheck($operator, $value, $actualValue); |
|
73 | - } |
|
68 | + return $this->executeStringCheck('!matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) |
|
69 | + && $this->executeStringCheck('!matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); |
|
70 | + } |
|
71 | + } |
|
72 | + return $this->executeStringCheck($operator, $value, $actualValue); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @return string |
|
77 | - */ |
|
78 | - protected function getActualValue() { |
|
79 | - return $this->request->getHeader('User-Agent'); |
|
80 | - } |
|
75 | + /** |
|
76 | + * @return string |
|
77 | + */ |
|
78 | + protected function getActualValue() { |
|
79 | + return $this->request->getHeader('User-Agent'); |
|
80 | + } |
|
81 | 81 | |
82 | - public function isAvailableForScope(int $scope): bool { |
|
83 | - return true; |
|
84 | - } |
|
82 | + public function isAvailableForScope(int $scope): bool { |
|
83 | + return true; |
|
84 | + } |
|
85 | 85 | } |
@@ -38,128 +38,128 @@ |
||
38 | 38 | |
39 | 39 | class SettingsController extends Controller { |
40 | 40 | |
41 | - /** @var IL10N */ |
|
42 | - private $l; |
|
43 | - |
|
44 | - /** @var IUserManager */ |
|
45 | - private $userManager; |
|
46 | - |
|
47 | - /** @var IUserSession */ |
|
48 | - private $userSession; |
|
49 | - |
|
50 | - /** @var KeyManager */ |
|
51 | - private $keyManager; |
|
52 | - |
|
53 | - /** @var Crypt */ |
|
54 | - private $crypt; |
|
55 | - |
|
56 | - /** @var Session */ |
|
57 | - private $session; |
|
58 | - |
|
59 | - /** @var ISession */ |
|
60 | - private $ocSession; |
|
61 | - |
|
62 | - /** @var Util */ |
|
63 | - private $util; |
|
64 | - |
|
65 | - /** |
|
66 | - * @param string $AppName |
|
67 | - * @param IRequest $request |
|
68 | - * @param IL10N $l10n |
|
69 | - * @param IUserManager $userManager |
|
70 | - * @param IUserSession $userSession |
|
71 | - * @param KeyManager $keyManager |
|
72 | - * @param Crypt $crypt |
|
73 | - * @param Session $session |
|
74 | - * @param ISession $ocSession |
|
75 | - * @param Util $util |
|
76 | - */ |
|
77 | - public function __construct($AppName, |
|
78 | - IRequest $request, |
|
79 | - IL10N $l10n, |
|
80 | - IUserManager $userManager, |
|
81 | - IUserSession $userSession, |
|
82 | - KeyManager $keyManager, |
|
83 | - Crypt $crypt, |
|
84 | - Session $session, |
|
85 | - ISession $ocSession, |
|
86 | - Util $util |
|
41 | + /** @var IL10N */ |
|
42 | + private $l; |
|
43 | + |
|
44 | + /** @var IUserManager */ |
|
45 | + private $userManager; |
|
46 | + |
|
47 | + /** @var IUserSession */ |
|
48 | + private $userSession; |
|
49 | + |
|
50 | + /** @var KeyManager */ |
|
51 | + private $keyManager; |
|
52 | + |
|
53 | + /** @var Crypt */ |
|
54 | + private $crypt; |
|
55 | + |
|
56 | + /** @var Session */ |
|
57 | + private $session; |
|
58 | + |
|
59 | + /** @var ISession */ |
|
60 | + private $ocSession; |
|
61 | + |
|
62 | + /** @var Util */ |
|
63 | + private $util; |
|
64 | + |
|
65 | + /** |
|
66 | + * @param string $AppName |
|
67 | + * @param IRequest $request |
|
68 | + * @param IL10N $l10n |
|
69 | + * @param IUserManager $userManager |
|
70 | + * @param IUserSession $userSession |
|
71 | + * @param KeyManager $keyManager |
|
72 | + * @param Crypt $crypt |
|
73 | + * @param Session $session |
|
74 | + * @param ISession $ocSession |
|
75 | + * @param Util $util |
|
76 | + */ |
|
77 | + public function __construct($AppName, |
|
78 | + IRequest $request, |
|
79 | + IL10N $l10n, |
|
80 | + IUserManager $userManager, |
|
81 | + IUserSession $userSession, |
|
82 | + KeyManager $keyManager, |
|
83 | + Crypt $crypt, |
|
84 | + Session $session, |
|
85 | + ISession $ocSession, |
|
86 | + Util $util |
|
87 | 87 | ) { |
88 | - parent::__construct($AppName, $request); |
|
89 | - $this->l = $l10n; |
|
90 | - $this->userSession = $userSession; |
|
91 | - $this->userManager = $userManager; |
|
92 | - $this->keyManager = $keyManager; |
|
93 | - $this->crypt = $crypt; |
|
94 | - $this->session = $session; |
|
95 | - $this->ocSession = $ocSession; |
|
96 | - $this->util = $util; |
|
97 | - } |
|
98 | - |
|
99 | - |
|
100 | - /** |
|
101 | - * @NoAdminRequired |
|
102 | - * @UseSession |
|
103 | - * |
|
104 | - * @param string $oldPassword |
|
105 | - * @param string $newPassword |
|
106 | - * @return DataResponse |
|
107 | - */ |
|
108 | - public function updatePrivateKeyPassword($oldPassword, $newPassword) { |
|
109 | - $result = false; |
|
110 | - $uid = $this->userSession->getUser()->getUID(); |
|
111 | - $errorMessage = $this->l->t('Could not update the private key password.'); |
|
112 | - |
|
113 | - //check if password is correct |
|
114 | - $passwordCorrect = $this->userManager->checkPassword($uid, $newPassword); |
|
115 | - if ($passwordCorrect === false) { |
|
116 | - // if check with uid fails we need to check the password with the login name |
|
117 | - // e.g. in the ldap case. For local user we need to check the password with |
|
118 | - // the uid because in this case the login name is case insensitive |
|
119 | - $loginName = $this->ocSession->get('loginname'); |
|
120 | - $passwordCorrect = $this->userManager->checkPassword($loginName, $newPassword); |
|
121 | - } |
|
122 | - |
|
123 | - if ($passwordCorrect !== false) { |
|
124 | - $encryptedKey = $this->keyManager->getPrivateKey($uid); |
|
125 | - $decryptedKey = $this->crypt->decryptPrivateKey($encryptedKey, $oldPassword, $uid); |
|
126 | - |
|
127 | - if ($decryptedKey) { |
|
128 | - $encryptedKey = $this->crypt->encryptPrivateKey($decryptedKey, $newPassword, $uid); |
|
129 | - $header = $this->crypt->generateHeader(); |
|
130 | - if ($encryptedKey) { |
|
131 | - $this->keyManager->setPrivateKey($uid, $header . $encryptedKey); |
|
132 | - $this->session->setPrivateKey($decryptedKey); |
|
133 | - $result = true; |
|
134 | - } |
|
135 | - } else { |
|
136 | - $errorMessage = $this->l->t('The old password was not correct, please try again.'); |
|
137 | - } |
|
138 | - } else { |
|
139 | - $errorMessage = $this->l->t('The current log-in password was not correct, please try again.'); |
|
140 | - } |
|
141 | - |
|
142 | - if ($result === true) { |
|
143 | - $this->session->setStatus(Session::INIT_SUCCESSFUL); |
|
144 | - return new DataResponse( |
|
145 | - ['message' => $this->l->t('Private key password successfully updated.')] |
|
146 | - ); |
|
147 | - } else { |
|
148 | - return new DataResponse( |
|
149 | - ['message' => $errorMessage], |
|
150 | - Http::STATUS_BAD_REQUEST |
|
151 | - ); |
|
152 | - } |
|
153 | - } |
|
154 | - |
|
155 | - /** |
|
156 | - * @UseSession |
|
157 | - * |
|
158 | - * @param bool $encryptHomeStorage |
|
159 | - * @return DataResponse |
|
160 | - */ |
|
161 | - public function setEncryptHomeStorage($encryptHomeStorage) { |
|
162 | - $this->util->setEncryptHomeStorage($encryptHomeStorage); |
|
163 | - return new DataResponse(); |
|
164 | - } |
|
88 | + parent::__construct($AppName, $request); |
|
89 | + $this->l = $l10n; |
|
90 | + $this->userSession = $userSession; |
|
91 | + $this->userManager = $userManager; |
|
92 | + $this->keyManager = $keyManager; |
|
93 | + $this->crypt = $crypt; |
|
94 | + $this->session = $session; |
|
95 | + $this->ocSession = $ocSession; |
|
96 | + $this->util = $util; |
|
97 | + } |
|
98 | + |
|
99 | + |
|
100 | + /** |
|
101 | + * @NoAdminRequired |
|
102 | + * @UseSession |
|
103 | + * |
|
104 | + * @param string $oldPassword |
|
105 | + * @param string $newPassword |
|
106 | + * @return DataResponse |
|
107 | + */ |
|
108 | + public function updatePrivateKeyPassword($oldPassword, $newPassword) { |
|
109 | + $result = false; |
|
110 | + $uid = $this->userSession->getUser()->getUID(); |
|
111 | + $errorMessage = $this->l->t('Could not update the private key password.'); |
|
112 | + |
|
113 | + //check if password is correct |
|
114 | + $passwordCorrect = $this->userManager->checkPassword($uid, $newPassword); |
|
115 | + if ($passwordCorrect === false) { |
|
116 | + // if check with uid fails we need to check the password with the login name |
|
117 | + // e.g. in the ldap case. For local user we need to check the password with |
|
118 | + // the uid because in this case the login name is case insensitive |
|
119 | + $loginName = $this->ocSession->get('loginname'); |
|
120 | + $passwordCorrect = $this->userManager->checkPassword($loginName, $newPassword); |
|
121 | + } |
|
122 | + |
|
123 | + if ($passwordCorrect !== false) { |
|
124 | + $encryptedKey = $this->keyManager->getPrivateKey($uid); |
|
125 | + $decryptedKey = $this->crypt->decryptPrivateKey($encryptedKey, $oldPassword, $uid); |
|
126 | + |
|
127 | + if ($decryptedKey) { |
|
128 | + $encryptedKey = $this->crypt->encryptPrivateKey($decryptedKey, $newPassword, $uid); |
|
129 | + $header = $this->crypt->generateHeader(); |
|
130 | + if ($encryptedKey) { |
|
131 | + $this->keyManager->setPrivateKey($uid, $header . $encryptedKey); |
|
132 | + $this->session->setPrivateKey($decryptedKey); |
|
133 | + $result = true; |
|
134 | + } |
|
135 | + } else { |
|
136 | + $errorMessage = $this->l->t('The old password was not correct, please try again.'); |
|
137 | + } |
|
138 | + } else { |
|
139 | + $errorMessage = $this->l->t('The current log-in password was not correct, please try again.'); |
|
140 | + } |
|
141 | + |
|
142 | + if ($result === true) { |
|
143 | + $this->session->setStatus(Session::INIT_SUCCESSFUL); |
|
144 | + return new DataResponse( |
|
145 | + ['message' => $this->l->t('Private key password successfully updated.')] |
|
146 | + ); |
|
147 | + } else { |
|
148 | + return new DataResponse( |
|
149 | + ['message' => $errorMessage], |
|
150 | + Http::STATUS_BAD_REQUEST |
|
151 | + ); |
|
152 | + } |
|
153 | + } |
|
154 | + |
|
155 | + /** |
|
156 | + * @UseSession |
|
157 | + * |
|
158 | + * @param bool $encryptHomeStorage |
|
159 | + * @return DataResponse |
|
160 | + */ |
|
161 | + public function setEncryptHomeStorage($encryptHomeStorage) { |
|
162 | + $this->util->setEncryptHomeStorage($encryptHomeStorage); |
|
163 | + return new DataResponse(); |
|
164 | + } |
|
165 | 165 | } |
@@ -35,71 +35,71 @@ |
||
35 | 35 | |
36 | 36 | class StatusController extends Controller { |
37 | 37 | |
38 | - /** @var IL10N */ |
|
39 | - private $l; |
|
38 | + /** @var IL10N */ |
|
39 | + private $l; |
|
40 | 40 | |
41 | - /** @var Session */ |
|
42 | - private $session; |
|
41 | + /** @var Session */ |
|
42 | + private $session; |
|
43 | 43 | |
44 | - /** @var IManager */ |
|
45 | - private $encryptionManager; |
|
44 | + /** @var IManager */ |
|
45 | + private $encryptionManager; |
|
46 | 46 | |
47 | - /** |
|
48 | - * @param string $AppName |
|
49 | - * @param IRequest $request |
|
50 | - * @param IL10N $l10n |
|
51 | - * @param Session $session |
|
52 | - * @param IManager $encryptionManager |
|
53 | - */ |
|
54 | - public function __construct($AppName, |
|
55 | - IRequest $request, |
|
56 | - IL10N $l10n, |
|
57 | - Session $session, |
|
58 | - IManager $encryptionManager |
|
59 | - ) { |
|
60 | - parent::__construct($AppName, $request); |
|
61 | - $this->l = $l10n; |
|
62 | - $this->session = $session; |
|
63 | - $this->encryptionManager = $encryptionManager; |
|
64 | - } |
|
47 | + /** |
|
48 | + * @param string $AppName |
|
49 | + * @param IRequest $request |
|
50 | + * @param IL10N $l10n |
|
51 | + * @param Session $session |
|
52 | + * @param IManager $encryptionManager |
|
53 | + */ |
|
54 | + public function __construct($AppName, |
|
55 | + IRequest $request, |
|
56 | + IL10N $l10n, |
|
57 | + Session $session, |
|
58 | + IManager $encryptionManager |
|
59 | + ) { |
|
60 | + parent::__construct($AppName, $request); |
|
61 | + $this->l = $l10n; |
|
62 | + $this->session = $session; |
|
63 | + $this->encryptionManager = $encryptionManager; |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * @NoAdminRequired |
|
68 | - * @return DataResponse |
|
69 | - */ |
|
70 | - public function getStatus() { |
|
71 | - $status = 'error'; |
|
72 | - $message = 'no valid init status'; |
|
73 | - switch ($this->session->getStatus()) { |
|
74 | - case Session::INIT_EXECUTED: |
|
75 | - $status = 'interactionNeeded'; |
|
76 | - $message = $this->l->t( |
|
77 | - 'Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files.' |
|
78 | - ); |
|
79 | - break; |
|
80 | - case Session::NOT_INITIALIZED: |
|
81 | - $status = 'interactionNeeded'; |
|
82 | - if ($this->encryptionManager->isEnabled()) { |
|
83 | - $message = $this->l->t( |
|
84 | - 'Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.' |
|
85 | - ); |
|
86 | - } else { |
|
87 | - $message = $this->l->t( |
|
88 | - 'Please enable server side encryption in the admin settings in order to use the encryption module.' |
|
89 | - ); |
|
90 | - } |
|
91 | - break; |
|
92 | - case Session::INIT_SUCCESSFUL: |
|
93 | - $status = 'success'; |
|
94 | - $message = $this->l->t('Encryption app is enabled and ready'); |
|
95 | - } |
|
66 | + /** |
|
67 | + * @NoAdminRequired |
|
68 | + * @return DataResponse |
|
69 | + */ |
|
70 | + public function getStatus() { |
|
71 | + $status = 'error'; |
|
72 | + $message = 'no valid init status'; |
|
73 | + switch ($this->session->getStatus()) { |
|
74 | + case Session::INIT_EXECUTED: |
|
75 | + $status = 'interactionNeeded'; |
|
76 | + $message = $this->l->t( |
|
77 | + 'Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files.' |
|
78 | + ); |
|
79 | + break; |
|
80 | + case Session::NOT_INITIALIZED: |
|
81 | + $status = 'interactionNeeded'; |
|
82 | + if ($this->encryptionManager->isEnabled()) { |
|
83 | + $message = $this->l->t( |
|
84 | + 'Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.' |
|
85 | + ); |
|
86 | + } else { |
|
87 | + $message = $this->l->t( |
|
88 | + 'Please enable server side encryption in the admin settings in order to use the encryption module.' |
|
89 | + ); |
|
90 | + } |
|
91 | + break; |
|
92 | + case Session::INIT_SUCCESSFUL: |
|
93 | + $status = 'success'; |
|
94 | + $message = $this->l->t('Encryption app is enabled and ready'); |
|
95 | + } |
|
96 | 96 | |
97 | - return new DataResponse( |
|
98 | - [ |
|
99 | - 'status' => $status, |
|
100 | - 'data' => [ |
|
101 | - 'message' => $message] |
|
102 | - ] |
|
103 | - ); |
|
104 | - } |
|
97 | + return new DataResponse( |
|
98 | + [ |
|
99 | + 'status' => $status, |
|
100 | + 'data' => [ |
|
101 | + 'message' => $message] |
|
102 | + ] |
|
103 | + ); |
|
104 | + } |
|
105 | 105 | } |
@@ -30,24 +30,24 @@ |
||
30 | 30 | |
31 | 31 | class Version1004Date20170924124212 extends SimpleMigrationStep { |
32 | 32 | |
33 | - /** |
|
34 | - * @param IOutput $output |
|
35 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
36 | - * @param array $options |
|
37 | - * @return null|ISchemaWrapper |
|
38 | - * @since 13.0.0 |
|
39 | - */ |
|
40 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
41 | - /** @var ISchemaWrapper $schema */ |
|
42 | - $schema = $schemaClosure(); |
|
33 | + /** |
|
34 | + * @param IOutput $output |
|
35 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
36 | + * @param array $options |
|
37 | + * @return null|ISchemaWrapper |
|
38 | + * @since 13.0.0 |
|
39 | + */ |
|
40 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - $table = $schema->getTable('cards'); |
|
45 | - $table->addIndex(['addressbookid'], 'cards_abid'); |
|
46 | - $table->addIndex(['addressbookid', 'uri'], 'cards_abiduri'); |
|
44 | + $table = $schema->getTable('cards'); |
|
45 | + $table->addIndex(['addressbookid'], 'cards_abid'); |
|
46 | + $table->addIndex(['addressbookid', 'uri'], 'cards_abiduri'); |
|
47 | 47 | |
48 | - $table = $schema->getTable('cards_properties'); |
|
49 | - $table->addIndex(['addressbookid'], 'cards_prop_abid'); |
|
48 | + $table = $schema->getTable('cards_properties'); |
|
49 | + $table->addIndex(['addressbookid'], 'cards_prop_abid'); |
|
50 | 50 | |
51 | - return $schema; |
|
52 | - } |
|
51 | + return $schema; |
|
52 | + } |
|
53 | 53 | } |
@@ -35,21 +35,21 @@ |
||
35 | 35 | * Auto-generated migration step: Please modify to your needs! |
36 | 36 | */ |
37 | 37 | class Version21000Date20210119195004 extends SimpleMigrationStep { |
38 | - /** |
|
39 | - * @param IOutput $output |
|
40 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | - * @param array $options |
|
42 | - * @return null|ISchemaWrapper |
|
43 | - */ |
|
44 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
45 | - /** @var ISchemaWrapper $schema */ |
|
46 | - $schema = $schemaClosure(); |
|
38 | + /** |
|
39 | + * @param IOutput $output |
|
40 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | + * @param array $options |
|
42 | + * @return null|ISchemaWrapper |
|
43 | + */ |
|
44 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
45 | + /** @var ISchemaWrapper $schema */ |
|
46 | + $schema = $schemaClosure(); |
|
47 | 47 | |
48 | - $table = $schema->getTable('authtoken'); |
|
49 | - if ($table->hasIndex('authtoken_version_index')) { |
|
50 | - $table->dropIndex('authtoken_version_index'); |
|
51 | - } |
|
48 | + $table = $schema->getTable('authtoken'); |
|
49 | + if ($table->hasIndex('authtoken_version_index')) { |
|
50 | + $table->dropIndex('authtoken_version_index'); |
|
51 | + } |
|
52 | 52 | |
53 | - return $schema; |
|
54 | - } |
|
53 | + return $schema; |
|
54 | + } |
|
55 | 55 | } |
@@ -31,24 +31,24 @@ |
||
31 | 31 | use OCP\Migration\SimpleMigrationStep; |
32 | 32 | |
33 | 33 | class Version14000Date20180518120534 extends SimpleMigrationStep { |
34 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
35 | - /** @var ISchemaWrapper $schema */ |
|
36 | - $schema = $schemaClosure(); |
|
34 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
35 | + /** @var ISchemaWrapper $schema */ |
|
36 | + $schema = $schemaClosure(); |
|
37 | 37 | |
38 | - $table = $schema->getTable('authtoken'); |
|
39 | - $table->addColumn('private_key', 'text', [ |
|
40 | - 'notnull' => false, |
|
41 | - ]); |
|
42 | - $table->addColumn('public_key', 'text', [ |
|
43 | - 'notnull' => false, |
|
44 | - ]); |
|
45 | - $table->addColumn('version', 'smallint', [ |
|
46 | - 'notnull' => true, |
|
47 | - 'default' => 1, |
|
48 | - 'unsigned' => true, |
|
49 | - ]); |
|
50 | - $table->addIndex(['uid'], 'authtoken_uid_index'); |
|
38 | + $table = $schema->getTable('authtoken'); |
|
39 | + $table->addColumn('private_key', 'text', [ |
|
40 | + 'notnull' => false, |
|
41 | + ]); |
|
42 | + $table->addColumn('public_key', 'text', [ |
|
43 | + 'notnull' => false, |
|
44 | + ]); |
|
45 | + $table->addColumn('version', 'smallint', [ |
|
46 | + 'notnull' => true, |
|
47 | + 'default' => 1, |
|
48 | + 'unsigned' => true, |
|
49 | + ]); |
|
50 | + $table->addIndex(['uid'], 'authtoken_uid_index'); |
|
51 | 51 | |
52 | - return $schema; |
|
53 | - } |
|
52 | + return $schema; |
|
53 | + } |
|
54 | 54 | } |
@@ -35,37 +35,37 @@ |
||
35 | 35 | * @see \OCP\AppFramework\Services\IInitialState |
36 | 36 | */ |
37 | 37 | interface IInitialStateService { |
38 | - /** |
|
39 | - * Allows an app to provide its initial state to the template system. |
|
40 | - * Use this if you know your initial state sill be used for example if |
|
41 | - * you are in the render function of you controller. |
|
42 | - * |
|
43 | - * @since 16.0.0 |
|
44 | - * |
|
45 | - * @param string $appName |
|
46 | - * @param string $key |
|
47 | - * @param bool|int|float|string|array|\JsonSerializable $data |
|
48 | - * |
|
49 | - * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
50 | - * @see \OCP\AppFramework\Services\IInitialState::provideInitialState() |
|
51 | - */ |
|
52 | - public function provideInitialState(string $appName, string $key, $data): void; |
|
38 | + /** |
|
39 | + * Allows an app to provide its initial state to the template system. |
|
40 | + * Use this if you know your initial state sill be used for example if |
|
41 | + * you are in the render function of you controller. |
|
42 | + * |
|
43 | + * @since 16.0.0 |
|
44 | + * |
|
45 | + * @param string $appName |
|
46 | + * @param string $key |
|
47 | + * @param bool|int|float|string|array|\JsonSerializable $data |
|
48 | + * |
|
49 | + * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
50 | + * @see \OCP\AppFramework\Services\IInitialState::provideInitialState() |
|
51 | + */ |
|
52 | + public function provideInitialState(string $appName, string $key, $data): void; |
|
53 | 53 | |
54 | - /** |
|
55 | - * Allows an app to provide its initial state via a lazy method. |
|
56 | - * This will call the closure when the template is being generated. |
|
57 | - * Use this if your app is injected into pages. Since then the render method |
|
58 | - * is not called explicitly. But we do not want to load the state on webdav |
|
59 | - * requests for example. |
|
60 | - * |
|
61 | - * @since 16.0.0 |
|
62 | - * |
|
63 | - * @param string $appName |
|
64 | - * @param string $key |
|
65 | - * @param Closure $closure returns a primitive or an object that implements JsonSerializable |
|
66 | - * |
|
67 | - * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
68 | - * @see \OCP\AppFramework\Services\IInitialState::provideLazyInitialState() |
|
69 | - */ |
|
70 | - public function provideLazyInitialState(string $appName, string $key, Closure $closure): void; |
|
54 | + /** |
|
55 | + * Allows an app to provide its initial state via a lazy method. |
|
56 | + * This will call the closure when the template is being generated. |
|
57 | + * Use this if your app is injected into pages. Since then the render method |
|
58 | + * is not called explicitly. But we do not want to load the state on webdav |
|
59 | + * requests for example. |
|
60 | + * |
|
61 | + * @since 16.0.0 |
|
62 | + * |
|
63 | + * @param string $appName |
|
64 | + * @param string $key |
|
65 | + * @param Closure $closure returns a primitive or an object that implements JsonSerializable |
|
66 | + * |
|
67 | + * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
68 | + * @see \OCP\AppFramework\Services\IInitialState::provideLazyInitialState() |
|
69 | + */ |
|
70 | + public function provideLazyInitialState(string $appName, string $key, Closure $closure): void; |
|
71 | 71 | } |
@@ -24,10 +24,10 @@ |
||
24 | 24 | |
25 | 25 | //.sgi |
26 | 26 | class SGI extends Bitmap { |
27 | - /** |
|
28 | - * {@inheritDoc} |
|
29 | - */ |
|
30 | - public function getMimeType(): string { |
|
31 | - return '/image\/sgi/'; |
|
32 | - } |
|
27 | + /** |
|
28 | + * {@inheritDoc} |
|
29 | + */ |
|
30 | + public function getMimeType(): string { |
|
31 | + return '/image\/sgi/'; |
|
32 | + } |
|
33 | 33 | } |
@@ -24,10 +24,10 @@ |
||
24 | 24 | |
25 | 25 | //.tga |
26 | 26 | class TGA extends Bitmap { |
27 | - /** |
|
28 | - * {@inheritDoc} |
|
29 | - */ |
|
30 | - public function getMimeType(): string { |
|
31 | - return '/image\/t(ar)?ga/'; |
|
32 | - } |
|
27 | + /** |
|
28 | + * {@inheritDoc} |
|
29 | + */ |
|
30 | + public function getMimeType(): string { |
|
31 | + return '/image\/t(ar)?ga/'; |
|
32 | + } |
|
33 | 33 | } |