Skip to content
Snippets Groups Projects
Unverified Commit 30e8a5ca authored by Pavel Břoušek's avatar Pavel Břoušek Committed by GitHub
Browse files

Merge pull request #8 from CESNET/remember_me

remember_me checkbox does not display when turned off
parents 59a5b746 15c78a49
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ The main part of the login page. The `components` option is designed as a list,
#### local_login
This component represents a form with username and password. It can be used only once. There are some options that can be configured.
This component represents a form with username and password. It can be used only once. It's possible to show / hide the `remember_me` checkbox by configuring the `session.rememberme.enable` option in the `config.php` file. In the module configuration, there are following options:
`username_label` - this is displayed as a label above input for the username. If you want to add localization, you can write the value as a map with language codes as keys and localized strings as values. If current language is not found in keys, the ***first one*** is used instead. If not set at all, it displays a default value.
......
......@@ -74,17 +74,19 @@
{% endif %}
</div>
<div class="margin-bottom-24 text-left">
{% if muni_jvs %}
<label class="inp-item inp-item--checkbox" for="remember_me">
<input id="remember_me" type="checkbox" name="remember_me" value="Yes">
<span>{{ '{campusmultiauth:remember}'|trans }}</span>
</label>
{% else %}
<input type="checkbox" class="form-check-input border{% if configuration.priority == 'primary' %} border-dark{% else %} border-muted{% endif %}" id="remember_me" name="remember_me" value="Yes">
<label class="form-check-label margin-left-12 text-{% if configuration.priority == 'primary' %}dark{% else %}muted{% endif %}" for="remember_me">{{ '{campusmultiauth:remember}'|trans }}</label>
{% endif %}
</div>
{% if rememberme_enabled %}
<div class="margin-bottom-24 text-left">
{% if muni_jvs %}
<label class="inp-item inp-item--checkbox" for="remember_me">
<input id="remember_me" type="checkbox" name="remember_me" value="Yes">
<span>{{ '{campusmultiauth:remember}'|trans }}</span>
</label>
{% else %}
<input type="checkbox" class="form-check-input border{% if configuration.priority == 'primary' %} border-dark{% else %} border-muted{% endif %}" id="remember_me" name="remember_me" value="Yes">
<label class="form-check-label margin-left-12 text-{% if configuration.priority == 'primary' %}dark{% else %}muted{% endif %}" for="remember_me">{{ '{campusmultiauth:remember}'|trans }}</label>
{% endif %}
</div>
{% endif %}
<div class="margin-bottom-24" id="submit">
{% if muni_jvs %}
......
......@@ -117,6 +117,7 @@ array_key_exists('wrongUserPass', $_REQUEST) ? $t->data['wrongUserPass'] = true
$t->data['authstate'] = $authStateId;
$t->data['currentUrl'] = htmlentities($_SERVER['PHP_SELF']);
$t->data['wayf_config'] = $wayfConfig;
$t->data['rememberme_enabled'] = Configuration::getInstance()->getBoolean('session.rememberme.enable', false);
$t->data['muni_jvs'] = ($wayfConfig['css_framework'] ?? 'bootstrap5') === 'muni_jvs';
$t->data['idps'] = $idps;
$t->data['no_js_display_index'] = !empty($_POST['componentIndex']) ? $_POST['componentIndex'] : null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment