aboutsummaryrefslogtreecommitdiff
path: root/app/views/api/oauth2/applications/index.php
blob: 56652dd0a7e37d85380b6251b081f22345fc3231 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
<? if (isset($applications) && count($applications)) { ?>
    <? foreach ($applications as $application) { ?>
        <article class="studip">
            <header>
                <h1>
                    <a href="<?= $controller->link_for('api/oauth2/applications/details/' . $application['id']) ?>" data-dialog="size=auto">
                        <?= htmlReady($application['name']) ?>
                    </a>
                </h1>
                <nav>
                    <form
                        action ="<?= $controller->link_for('api/oauth2/applications/revoke') ?>"
                        method="post">
                        <?= CSRFProtection::tokenTag() ?>
                        <input type="hidden" name="application" value="<?= htmlReady($application['id']) ?>">
                        <?= ActionMenu::get()
                                      ->addButton(
                                          _('Autorisierung widerrufen'),
                                          'revoke_authorisation',
                                          Icon::create('trash'),
                                          [
                                              'data-confirm' => _('Wollen Sie die OAuth2-Autorisierung wirklich widerrufen?'),
                                              'title' => _('Autorisierung widerrufen'),
                                          ]
                                      )
                                      ->render() ?>
                    </form>
                </nav>
            </header>

            <div>
                <span class="oauth2-application--owned-by">
                    <?= _('Entwickelt durch') ?>:
                    <a rel="noreferrer noopener" target="_blank"
                        href="<?= htmlReady($application['homepage']) ?>">
                        <?= htmlReady($application['owner']) ?>
                    </a>
                </span>
            </div>

            <ul>
                <? foreach ($application['scopes'] as $scope) { ?>
                    <li><?= htmlReady($scope->description) ?></li>
                <? } ?>
            </ul>
        </article>
    <? } ?>
<? } else { ?>
    <?= \MessageBox::info(
        _('Keine autorisierten Drittanwendungen'),
        [ _('Sie haben keine Anwendungen, die zum Zugriff auf Ihr Konto berechtigt sind.') ]) ?>
<? } ?>