diff options
Diffstat (limited to 'apps/encryption/lib/Session.php')
-rw-r--r-- | apps/encryption/lib/Session.php | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/apps/encryption/lib/Session.php b/apps/encryption/lib/Session.php index c8f6ac6d0da..df1e5d664ad 100644 --- a/apps/encryption/lib/Session.php +++ b/apps/encryption/lib/Session.php @@ -1,48 +1,27 @@ <?php + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Bjoern Schiessle <bjoern@schiessle.org> - * @author Björn Schießle <bjoern@schiessle.org> - * @author Clark Tomlinson <fallen013@gmail.com> - * @author Lukas Reschke <lukas@statuscode.ch> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ - namespace OCA\Encryption; use OCA\Encryption\Exceptions\PrivateKeyMissingException; -use \OCP\ISession; +use OCP\ISession; class Session { - /** @var ISession */ - protected $session; - - const NOT_INITIALIZED = '0'; - const INIT_EXECUTED = '1'; - const INIT_SUCCESSFUL = '2'; - const RUN_MIGRATION = '3'; + public const NOT_INITIALIZED = '0'; + public const INIT_EXECUTED = '1'; + public const INIT_SUCCESSFUL = '2'; /** * @param ISession $session */ - public function __construct(ISession $session) { - $this->session = $session; + public function __construct( + protected ISession $session, + ) { } /** @@ -87,7 +66,7 @@ class Session { public function getPrivateKey() { $key = $this->session->get('privateKey'); if (is_null($key)) { - throw new Exceptions\PrivateKeyMissingException('please try to log-out and log-in again', 0); + throw new PrivateKeyMissingException('please try to log-out and log-in again'); } return $key; } @@ -184,5 +163,4 @@ class Session { $this->session->remove('decryptAllKey'); $this->session->remove('decryptAllUid'); } - } |