• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LibreSign / libresign / 20104047174

10 Dec 2025 03:32PM UTC coverage: 43.803%. First build
20104047174

Pull #6069

github

web-flow
Merge 5caf995ab into a49dfb931
Pull Request #6069: feat: sequential signing

46 of 146 new or added lines in 10 files covered. (31.51%)

5733 of 13088 relevant lines covered (43.8%)

5.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Files/TemplateLoader.php
1
<?php
2

3
declare(strict_types=1);
4
/**
5
 * SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8

9
namespace OCA\Libresign\Files;
10

11
use OCA\Files\Event\LoadSidebar;
12
use OCA\Libresign\AppInfo\Application;
13
use OCA\Libresign\Exception\LibresignException;
14
use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
15
use OCA\Libresign\Helper\ValidateHelper;
16
use OCA\Libresign\Service\AccountService;
17
use OCA\Libresign\Service\IdentifyMethodService;
18
use OCP\AppFramework\Services\IInitialState;
19
use OCP\EventDispatcher\Event;
20
use OCP\EventDispatcher\IEventDispatcher;
21
use OCP\EventDispatcher\IEventListener;
22
use OCP\IAppConfig;
23
use OCP\IRequest;
24
use OCP\IUserSession;
25

26
/**
27
 * @template-implements IEventListener<Event>
28
 */
29
class TemplateLoader implements IEventListener {
30
        public function __construct(
31
                private IRequest $request,
32
                private IUserSession $userSession,
33
                private AccountService $accountService,
34
                private IInitialState $initialState,
35
                private ValidateHelper $validateHelper,
36
                private IdentifyMethodService $identifyMethodService,
37
                private CertificateEngineFactory $certificateEngineFactory,
38
                private IAppConfig $appConfig,
39
        ) {
40
        }
×
41

42
        public static function register(IEventDispatcher $dispatcher): void {
43
                $dispatcher->addServiceListener(LoadSidebar::class, self::class);
×
44
        }
45

46
        #[\Override]
47
        public function handle(Event $event): void {
48
                if (!($event instanceof LoadSidebar)) {
×
49
                        return;
×
50
                }
51
                $this->initialState->provideInitialState(
×
52
                        'certificate_ok',
×
53
                        $this->certificateEngineFactory->getEngine()->isSetupOk()
×
54
                );
×
55

56
                $this->initialState->provideInitialState(
×
57
                        'identify_methods',
×
58
                        $this->identifyMethodService->getIdentifyMethodsSettings()
×
59
                );
×
60

NEW
61
                $this->initialState->provideInitialState(
×
NEW
62
                        'signature_flow',
×
NEW
63
                        $this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Service\SignatureFlow::PARALLEL->value)
×
NEW
64
                );
×
65

66
                try {
67
                        $this->validateHelper->canRequestSign($this->userSession->getUser());
×
68
                        $this->initialState->provideInitialState('can_request_sign', true);
×
69
                } catch (LibresignException) {
×
70
                        $this->initialState->provideInitialState('can_request_sign', false);
×
71
                }
72
        }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc