Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit a142c5c

Browse files
Merge pull request #37 from silinternational/develop
Various fixes
2 parents 61b9dc3 + 1743d9d commit a142c5c

File tree

11 files changed

+91
-57
lines changed

11 files changed

+91
-57
lines changed

dictionaries/login.definition.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"title": {
3-
"en": "Login account",
4-
"es": "Cuenta de inicio de sesión",
5-
"fr": "Compte de connexion",
6-
"ko": "로그인 계정"
3+
"en": "Login with your {idpName} account",
4+
"es": "Inicie sesión con su cuenta {idpName}",
5+
"fr": "Connectez-vous avec votre compte {idpName}",
6+
"ko": "{idpName} 계정으로 로그인하십시오."
77
},
88
"header": {
99
"en": "Login with your {idpName} account",

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ services:
8383
PASSWORD_FORGOT_URL: "http://example.org"
8484

8585
idp4:
86-
image: silintl/ssp-base:feature_mfa #TODO: move this to :develop when PR'd
86+
image: silintl/ssp-base:develop
8787
volumes:
8888
- ./development/idp4/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
8989
- ./development/idp4/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
@@ -134,7 +134,7 @@ services:
134134
MYSQL_PASSWORD: "pass"
135135

136136
broker:
137-
image: silintl/idp-id-broker:feature2sv #TODO: move this to :develop when PR'd
137+
image: silintl/idp-id-broker:develop
138138
volumes:
139139
- ./development/idp4/m991231_235959_insert_mfa_test_users.php:/data/console/migrations/m991231_235959_insert_mfa_test_users.php
140140
ports:

themes/material/common-head-elements.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$colors = htmlentities($this->configuration->getValue('theme.color-scheme') ?: 'indigo-purple');
3333
?>
3434
<link rel="stylesheet" href="material.<?= $colors ?>.1.2.1.min.css">
35-
<link rel="stylesheet" href="styles.2.2.1.css">
35+
<link rel="stylesheet" href="styles.2.2.2.css">
3636

3737
<script async src="material.1.2.1.min.js"></script>
3838

themes/material/core/loginuserpass.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title><?= $this->t('{material:login:title}') ?></title>
4+
<?php
5+
$idpName = htmlentities($this->configuration->getValue(
6+
'idp_display_name',
7+
$this->configuration->getValue('idp_name', '')
8+
));
9+
?>
10+
11+
<title><?= $this->t('{material:login:title}', ['{idpName}' => $idpName]) ?></title>
512

613
<?php include __DIR__ . '/../common-head-elements.php' ?>
714

@@ -10,8 +17,7 @@
1017

1118
if (! empty($siteKey)) {
1219
?>
13-
<script src='https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit'
14-
async defer></script>
20+
<script src='https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit' async defer></script>
1521

1622
<script>
1723
function submitForm() {
@@ -47,12 +53,6 @@ function onRecaptchaLoad() {
4753
<input type="hidden" name="csrf-token" value="<?= $csrfToken ?>" />
4854

4955
<div class="mdl-card mdl-shadow--8dp fill-phone-viewport">
50-
<?php
51-
$idpName = htmlentities($this->configuration->getValue(
52-
'idp_display_name',
53-
$this->configuration->getValue('idp_name', '')
54-
));
55-
?>
5656
<div class="mdl-card__media white-bg margin" layout-children="column">
5757
<img src="/logo.png"
5858
alt="<?= $this->t('{material:login:logo}', ['{idpName}' => $idpName]) ?>">

themes/material/mfa/other_mfas.php

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1-
<!-- used type=button to avoid form submission on click -->
2-
<button id="others" type="button" class="mdl-button mdl-js-button">
3-
<span class="mdl-typography--caption">
4-
<?= $this->t('{material:mfa:use_others}') ?>
5-
</span>
6-
</button>
7-
<ul class="mdl-menu mdl-js-menu mdl-menu--top-left" data-mdl-for="others">
8-
<?php
9-
$mfaOptions = $this->data['mfaOptions'];
10-
$currentMfaId = filter_input(INPUT_GET, 'mfaId');
1+
<?php
2+
$mfaOptions = $this->data['mfaOptions'];
3+
$currentMfaId = filter_input(INPUT_GET, 'mfaId');
114

12-
function excludeSelf($others, $selfId) {
13-
return array_filter($others, function($option) use ($selfId) {
14-
return $option['id'] != $selfId;
15-
});
16-
}
5+
function excludeSelf($others, $selfId) {
6+
return array_filter($others, function($option) use ($selfId) {
7+
return $option['id'] != $selfId;
8+
});
9+
}
1710

18-
foreach (excludeSelf($mfaOptions, $currentMfaId) as $otherOption) {
19-
$type = $otherOption['type'];
11+
$otherOptions = excludeSelf($mfaOptions, $currentMfaId);
12+
if (count($otherOptions) > 0) {
13+
?>
14+
<div layout-children="column" child-spacing="center">
15+
<!-- used type=button to avoid form submission on click since this is just used to display the ul -->
16+
<button id="others" type="button" class="mdl-button mdl-js-button">
17+
<span class="mdl-typography--caption">
18+
<?= $this->t('{material:mfa:use_others}') ?>
19+
</span>
20+
</button>
21+
<ul class="mdl-menu mdl-js-menu mdl-menu--top-left" data-mdl-for="others">
22+
<?php
23+
foreach ($otherOptions as $option) {
24+
$type = $option['type'];
2025

21-
//TODO: is there an svg of the u2f icon?
22-
$image = 'mfa-'.$type.($type === 'u2f' ? '.png' : '.svg');
23-
?>
24-
<li class="mdl-menu__item" onclick="location.href += '&mfaId=<?= $otherOption['id'] ?>'">
25-
<span class="mdl-list__item-primary-content">
26-
<img class="mdl-list__item-icon" src="<?= $image ?>"
27-
alt="<?= $this->t('{material:mfa:'.$type.'_icon}') ?>">
26+
$image = 'mfa-' . $type . '.svg';
27+
$altText = $this->t('{material:mfa:' . $type . '_icon}');
28+
?>
29+
<li class="mdl-menu__item" onclick="location.href += '&mfaId=<?= $option['id'] ?>'">
30+
<span class="mdl-list__item-primary-content">
31+
<img class="mdl-list__item-icon" src="<?= $image ?>" alt="<?= $altText ?>">
2832

29-
<?= $this->t('{material:mfa:use_'.$type.'}') ?>
30-
</span>
31-
</li>
32-
<?php
33-
}
34-
?>
35-
</ul>
33+
<?= $this->t('{material:mfa:use_' . $type . '}') ?>
34+
</span>
35+
</li>
36+
<?php
37+
}
38+
?>
39+
</ul>
40+
</div>
41+
<?php
42+
}
43+
?>

themes/material/mfa/prompt-for-mfa-backupcode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ class="mdl-button mdl-button--raised mdl-button--primary">
7474
</button>
7575
</div>
7676

77-
<div layout-children="column" child-spacing="center">
78-
<?php include __DIR__ . '/other_mfas.php' ?>
79-
</div>
77+
<?php include __DIR__ . '/other_mfas.php' ?>
8078
</div>
8179

8280
<div>

themes/material/mfa/prompt-for-mfa-totp.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ class="mdl-button mdl-button--raised mdl-button--primary">
7373
</button>
7474
</div>
7575

76-
<div layout-children="column" child-spacing="center">
77-
<?php include __DIR__ . '/other_mfas.php' ?>
78-
</div>
76+
<?php include __DIR__ . '/other_mfas.php' ?>
7977
</div>
8078

8179
<div>

themes/material/mfa/prompt-for-mfa-u2f.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function createHiddenInput(name) {
115115
<form layout-children="column" method="post">
116116
<div class="mdl-card mdl-shadow--8dp">
117117
<div class="mdl-card__media white-bg margin" layout-children="column">
118-
<img src="mfa-u2f.png" alt="<?= $this->t('{material:mfa:u2f_icon}') ?>">
118+
<img src="mfa-u2f.svg" alt="<?= $this->t('{material:mfa:u2f_icon}') ?>">
119119
</div>
120120

121121
<div class="mdl-card__title center">
@@ -166,9 +166,7 @@ class="mdl-button mdl-color-text--red <?= ! empty($message) ? 'show' : 'hide' ?>
166166

167167
</div>
168168

169-
<div layout-children="column" child-spacing="center">
170-
<?php include __DIR__ . '/other_mfas.php' ?>
171-
</div>
169+
<?php include __DIR__ . '/other_mfas.php' ?>
172170
</div>
173171

174172
<div>

www/mfa-u2f.png

-3.86 KB
Binary file not shown.

www/mfa-u2f.svg

Lines changed: 27 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)