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

LibreSign / libresign / 20643009881

01 Jan 2026 06:00PM UTC coverage: 44.935%. First build
20643009881

Pull #6295

github

web-flow
Merge ea3d2a7e9 into 6f4bafb31
Pull Request #6295: fix: file action api integration

0 of 4 new or added lines in 1 file covered. (0.0%)

6618 of 14728 relevant lines covered (44.93%)

5.09 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\App\IAppManager;
19
use OCP\AppFramework\Services\IInitialState;
20
use OCP\EventDispatcher\Event;
21
use OCP\EventDispatcher\IEventListener;
22
use OCP\IAppConfig;
23
use OCP\IRequest;
24
use OCP\IUserSession;
25
use OCP\Util;
26

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

44
        #[\Override]
45
        public function handle(Event $event): void {
46
                if (!($event instanceof LoadSidebar)) {
×
47
                        return;
×
48
                }
49

NEW
50
                if (!$this->appManager->isEnabledForUser('libresign')) {
×
NEW
51
                        return;
×
52
                }
53

54
                $this->initialState->provideInitialState(
×
55
                        'certificate_ok',
×
56
                        $this->certificateEngineFactory->getEngine()->isSetupOk()
×
57
                );
×
58

59
                $this->initialState->provideInitialState(
×
60
                        'identify_methods',
×
61
                        $this->identifyMethodService->getIdentifyMethodsSettings()
×
62
                );
×
63

64
                $this->initialState->provideInitialState(
×
65
                        'signature_flow',
×
66
                        $this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Enum\SignatureFlow::NONE->value)
×
67
                );
×
68

69
                try {
70
                        $this->validateHelper->canRequestSign($this->userSession->getUser());
×
71
                        $this->initialState->provideInitialState('can_request_sign', true);
×
72
                } catch (LibresignException) {
×
73
                        $this->initialState->provideInitialState('can_request_sign', false);
×
74
                }
75

NEW
76
                Util::addScript(Application::APP_ID, 'libresign-tab');
×
NEW
77
                Util::addStyle(Application::APP_ID, 'icons');
×
78
        }
79
}
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