forked from LibreSign/libresign
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersion12000Date20250517134200.php
More file actions
39 lines (33 loc) · 1.09 KB
/
Version12000Date20250517134200.php
File metadata and controls
39 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Libresign\Migration;
use Closure;
use OCA\Libresign\AppInfo\Application;
use OCP\DB\ISchemaWrapper;
use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version12000Date20250517134200 extends SimpleMigrationStep {
public function __construct(
protected IAppConfig $appConfig,
) {
}
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
#[\Override]
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$keys = $this->appConfig->getKeys(Application::APP_ID);
if (in_array('notify_unsigned_user', $keys)) {
$current = $this->appConfig->getValueString(Application::APP_ID, 'notify_unsigned_user');
$this->appConfig->setValueString('activity', 'notify_email_libresign_file_to_sign', $current ? '1' : '0');
$this->appConfig->deleteKey(Application::APP_ID, 'notify_unsigned_user');
}
}
}