aboutsummaryrefslogtreecommitdiff
path: root/app/views/api/oauth2/authorize.php
blob: 693968adf86e818596b56e9280e09cf31718dbac (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
<section class="oauth authorize">
    <header>
        <h1><?= _('Autorisierungsanfrage') ?></h1>
    </header>

    <p>
        <?= sprintf(
            _('Die Applikation <strong>"%s"</strong> möchte auf Ihre Daten zugreifen.'),
            htmlReady($client->getName())
            ) ?>
    </p>

    <? if (count($scopes) > 0) { ?>
        <div class="scopes">
            <p><strong><?= _('Diese Applikation hat Zugriff auf:') ?></strong></p>
            <ul>
                <? foreach ($scopes as $scope) { ?>
                    <li><?= htmlReady($scope->description) ?></li>
                <? } ?>
            </ul>
        </div>
    <? } ?>

    <div class="buttons">
        <form action="<?= $controller->url_for('api/oauth2/authorize') ?>" method="post">
            <?= \CSRFProtection::tokenTag() ?>
            <input type="hidden" name="_method" value="delete">
            <input type="hidden" name="state" value="<?= htmlReady($state) ?>">
            <input type="hidden" name="client_id" value="<?= htmlReady($client->id) ?>">
            <input type="hidden" name="auth_token" value="<?= htmlReady($authToken) ?>">
            <?= Studip\Button::create(_('Verweigern'), 'deny') ?>
        </form>

        <form action="<?= $controller->url_for('api/oauth2/authorize') ?>" method="post">
            <?= \CSRFProtection::tokenTag() ?>
            <input type="hidden" name="state" value="<?= htmlReady($state) ?>">
            <input type="hidden" name="client_id" value="<?= htmlReady($client->id) ?>">
            <input type="hidden" name="auth_token" value="<?= htmlReady($authToken) ?>">
            <?= Studip\Button::create(_('Erlauben'), 'allow') ?>
        </form>
    </div>

    <p>
        <?= Avatar::getAvatar($GLOBALS['user']->id)->getImageTag(Avatar::SMALL) ?>

        <?= sprintf(
            _('Angemeldet als <strong>%s</strong> (%s)'),
            htmlReady($GLOBALS['user']->getFullName()),
            htmlReady($GLOBALS['user']->username)
            ) ?><br>
        <small>
            <a href="<?= URLHelper::getLink('logout.php') ?>">
                <?= sprintf(
                    _('Sind sie nicht <strong>%s</strong>, so melden Sie sich bitte ab und versuchen es erneut.'),
                    htmlReady($GLOBALS['user']->getFullName())
                ) ?>
            </a>
        </small>
    </p>
</section>