aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/oauth2/_setup_key.php
blob: 26b56633864dbc174747477ee5769275fb80954a (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
<?php
/**
 * @var  Studip\OAuth2\KeyInformation $key
 */

?>
<?php
$checkmark = function (bool $checked): Icon {
        return $checked
             ? Icon::create('accept', Icon::ROLE_STATUS_GREEN)
             : Icon::create('decline', Icon::ROLE_STATUS_RED);
    };

    $predicate = function ($checked, $positive, $negative) {
        return $checked ? $positive : $negative;
    };
?>
<ul>
    <li style="list-style-image: url(<?= $checkmark($key->exists())->asImagePath() ?>)">
        <?= $predicate($key->exists(), _('Datei existiert.'), _('Datei existiert nicht.')) ?>
    </li>
    <li style="list-style-image: url(<?= $checkmark($key->isReadable())->asImagePath() ?>)">
        <?= $predicate($key->isReadable(), _('Datei ist lesbar.'), _('Datei ist nicht lesbar.')) ?>
    </li>
    <? if ($key->isReadable()) { ?>
        <li style="list-style-image: url(<?= $checkmark($key->hasProperMode())->asImagePath() ?>)">
            <?= $predicate(
                $key->hasProperMode(),
                sprintf(_('Korrekte Zugriffsberechtigung: %s'), $key->mode()),
                sprintf(_('Falsche Zugriffsberechtigung: %s'), $key->mode())
            ) ?>
        </li>
    <? } ?>
</ul>