diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
commit | 8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch) | |
tree | 2492de6f1528dd44eaa169a5c1555026d9cb75ec /application/views/scripts/authentication | |
parent | Initial commit. (diff) | |
download | icingaweb2-upstream/2.11.4.tar.xz icingaweb2-upstream/2.11.4.zip |
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | application/views/scripts/authentication/login.phtml | 74 | ||||
-rw-r--r-- | application/views/scripts/authentication/logout.phtml | 79 |
2 files changed, 153 insertions, 0 deletions
diff --git a/application/views/scripts/authentication/login.phtml b/application/views/scripts/authentication/login.phtml new file mode 100644 index 0000000..167a468 --- /dev/null +++ b/application/views/scripts/authentication/login.phtml @@ -0,0 +1,74 @@ +<div id="login"> + <div class="login-form" data-base-target="layout"> + <div role="status" class="sr-only"> + <?= $this->translate( + 'Welcome to Icinga Web 2. For users of the screen reader Jaws full and expectant compliant' + . ' accessibility is possible only with use of the Firefox browser. VoiceOver on Mac OS X is tested on' + . ' Chrome, Safari and Firefox.' + ) ?> + </div> + <div class="logo-wrapper"><div id="icinga-logo" aria-hidden="true"></div></div> + <?php if ($requiresSetup): ?> + <p class="config-note"><?= sprintf( + $this->translate( + 'It appears that you did not configure Icinga Web 2 yet so it\'s not possible to log in without any defined ' + . 'authentication method. Please define a authentication method by following the instructions in the' + . ' %1$sdocumentation%3$s or by using our %2$sweb-based setup-wizard%3$s.' + ), + '<a href="https://icinga.com/docs/icinga-web-2/latest/doc/05-Authentication/#authentication" title="' + . $this->translate('Icinga Web 2 Documentation') . '">', + '<a href="' . $this->href('setup') . '" title="' . $this->translate('Icinga Web 2 Setup-Wizard') . '">', + '</a>' + ) ?></p> + <?php endif ?> + <?= $this->form ?> + <div id="login-footer"> + <p>Icinga Web 2 © 2013-<?= date('Y') ?></p> + <?= $this->qlink($this->translate('icinga.com'), 'https://icinga.com') ?> + </div> + </div> + <ul id="social"> + <li> + <?= $this->qlink( + null, + 'https://twitter.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'twitter', + 'title' => $this->translate('Icinga on Twitter') + ) + ) ?> + </li> + <li> + <?= $this->qlink( + null, + 'https://www.facebook.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'facebook-squared', + 'title' => $this->translate('Icinga on Facebook') + ) + ) ?> + </li> + <li><?= $this->qlink( + null, + 'https://github.com/Icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'github-circled', + 'title' => $this->translate('Icinga on GitHub') + ) + ) ?> + </li> + </ul> +</div> +<div id="orb-analytics" class="orb" ><?= $this->img('img/orb-analytics.png'); ?></div> +<div id="orb-automation" class="orb"><?= $this->img('img/orb-automation.png'); ?></div> +<div id="orb-cloud" class="orb"><?= $this->img('img/orb-cloud.png'); ?></div> +<div id="orb-icinga" class="orb"><?= $this->img('img/orb-icinga.png'); ?></div> +<div id="orb-infrastructure" class="orb"><?= $this->img('img/orb-infrastructure.png'); ?></div> +<div id="orb-metrics" class="orb" ><?= $this->img('img/orb-metrics.png'); ?></div> +<div id="orb-notifactions" class="orb"><?= $this->img('img/orb-notifications.png'); ?></div> diff --git a/application/views/scripts/authentication/logout.phtml b/application/views/scripts/authentication/logout.phtml new file mode 100644 index 0000000..d4bd78e --- /dev/null +++ b/application/views/scripts/authentication/logout.phtml @@ -0,0 +1,79 @@ +<!-- + This view provides a workaround to logout from an external authentication provider, in case external + authentication was configured (the default is to handle authentications internally in Icingaweb2). + + The <a href="http://tools.ietf.org/html/rfc2617">Http Basic and Digest Authentication</a> is not + designed to handle logout. When the user has provided valid credentials, the client is adviced to include these + in every further request until the browser was closed. To allow logout and to allow the user to change the + logged-in user this JavaScript provides a workaround to force a new authentication prompt in most browsers. +--> +<div class="content"> + <div id="icinga-logo" aria-hidden="true"></div> + <div class="alert alert-warning" id="logout-status"> + <b><?= $this->translate('Logging out...'); ?></b> + <br> + <?= $this->translate( + 'If this message does not disappear, it might be necessary to quit the' + . ' current session manually by clearing the cache, or by closing the current' + . ' browser session.' + ); ?> + </div> + + <div class="container"> + <a href="<?= $this->href('dashboard'); ?>"><?= $this->translate('Login'); ?></a> + </div> +</div> +<script type="text/javascript"> + /* + * When JavaScript is available, trigger an XmlHTTPRequest with the non-existing user 'logout' and abort it + * before it is able to finish. This will cause the browser to show a new authentication prompt in the next + * request. + */ + document.addEventListener('DOMContentLoaded', function () { + var msg = document.getElementById('logout-status'); + try { + if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) { + document.execCommand('ClearAuthenticationCache'); + } else { + var xhttp = new XMLHttpRequest(); + xhttp.open('GET', 'arbitrary url', true, 'logout', 'logout'); + xhttp.send(''); + xhttp.abort(); + } + } catch (e) { + } + msg.innerHTML = '<?= $this->translate('Logout successful!'); ?>'; + msg.className = 'alert alert-success'; + }); +</script> +<style type="text/css"> + body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + background-color: #0095bf; + color: white; + } + .content { + text-align: center; + } + + #icinga-logo { + background-image: url('../img/icinga-logo-big.svg'); + background-position: center bottom; + background-repeat: no-repeat; + background-size: contain; + height: 177px; + margin-top: 10em; + width: 100%; + } + + #logout-status { + margin: 2em 0 1em; + font-size: 2em; + font-weight: bold; + } + + .container a { + color: white; + font-size: 1.5em; + } +</style> |