aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/oauth2/_clients.php
blob: 1332b5aabe40c3e07633311c85896e9d0d6af5cb (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
 * @var Admin_Oauth2Controller $controller
 * @var Studip\OAuth2\Models\Client[] $clients
 */

$sidebar = Sidebar::get();
$actions = new ActionsWidget();
$actions->addLink(
    _('OAuth2-Client hinzufügen'),
    $controller->url_for('api/oauth2/clients/add'),
    Icon::create('add')
);
$sidebar->addWidget($actions);
?>

<? if (isset($clients) && count($clients)) { ?>
    <h2>
        <?= _('Registrierte OAuth2-Clients') ?>
    </h2>

    <? foreach ($clients as $client) { ?>
        <article class="studip">
            <header>
                <h1>
                    <b><?= htmlReady($client['name']) ?></b>
                </h1>
                <nav>
                    <form
                        action ="<?= $controller->link_for('api/oauth2/clients/delete', $client) ?>"
                        method="post">
                        <?= CSRFProtection::tokenTag() ?>
                        <?= ActionMenu::get()
                                      ->addButton(
                                          sprintf(_('OAuth2-Client "%s" löschen'), $client['name']),
                                          'delete_client',
                                          Icon::create('trash'),
                                          [
                                              'data-confirm' => _('Wollen Sie den OAuth2-Client wirklich löschen?'),
                                              'title' => sprintf(_('OAuth2-Client "%s" löschen'), $client['name']),
                                          ]
                                      )
                                      ->render() ?>
                    </form>
                </nav>
            </header>

            <div>
                <dl>
                    <dt><?= _('Beschreibung') ?></dt>
                    <dd><?= htmlReady($client['description']) ?></dd>

                    <dt><?= _('Entwickelt durch') ?></dt>
                    <dd>
                        <a rel="noreferrer noopener" target="_blank"
                            href="<?= htmlReady($client['homepage']) ?>">
                            <?= htmlReady($client['owner']) ?>
                        </a>
                    </dd>

                    <dt><?= _('client_id') ?></dt>
                    <dd> <?= htmlReady($client['id']) ?> </dd>

                    <dt><?= _('Redirect-URIs') ?></dt>
                    <dd>
                        <ul>
                            <? foreach ($client->redirectUris() as $uri) { ?>
                                <li><?= htmlReady($uri) ?></li>
                            <? } ?>
                        </ul>
                    </dd>

                    <dt><?= _('Kann kryptographische Geheimnisse bewahren?') ?></dt>
                    <dd><?= $client->confidential() ? _('Ja') : _('Nein') ?></dd>

                    <dt><?= _('Notizen (nur für Root-Accounts sichtbar)') ?></dt>
                    <dd>
                        <?= htmlReady($client['admin_notes']) ?>
                    </dd>
                </dl>
            </div>
        </article>
    <? } ?>
<? } ?>