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

Commit 0912db7

Browse files
Merge pull request #71 from silinternational/links-of-desire
users wanted a way to get to their profile and help docs
2 parents 3d77f4f + b2ff63b commit 0912db7

File tree

4 files changed

+47
-14
lines changed

4 files changed

+47
-14
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ If provided, an alert will be shown to the user filled with the content of that
103103
1. Click **idp2** (second one)
104104
1. Forgot password link should be visible
105105

106+
### Helpful links functionality
107+
108+
1. Goto [SP 1](http://ssp-sp1.local:8082/module.php/core/authenticate.php?as=hub-discovery)
109+
1. Click **idp4** (third one)
110+
1. Help link should be visible under login form
111+
1. Profile link should be visible under login form
112+
106113
### Expiry functionality
107114

108115
#### About to expire page

dictionaries/login.definition.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,17 @@
4646
"es": "Logotipo de {idpName}",
4747
"fr": "Logo {idpName}",
4848
"ko": "{idpName} 로고"
49+
},
50+
"help": {
51+
"en": "I need help",
52+
"es": "necesito ayuda",
53+
"fr": "j'ai besoin d'aide",
54+
"ko": "도움이 필요해."
55+
},
56+
"profile": {
57+
"en": "Manage my profile",
58+
"es": "Administrar mi perfil",
59+
"fr": "Gérer mon profil",
60+
"ko": "내 프로필 관리"
4961
}
5062
}

docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ services:
8383
IDP_NAME: "idp-2"
8484
IDP_DISPLAY_NAME: "IdP 2"
8585
ANALYTICS_ID: "UA-XXXX-Y"
86-
PASSWORD_CHANGE_URL: "http://example.org"
87-
PASSWORD_FORGOT_URL: "http://example.org"
86+
PASSWORD_CHANGE_URL: "https://example.org/change"
87+
PASSWORD_FORGOT_URL: "https://example.org/forgot"
8888

89-
idp4: # used for mfa testing
89+
idp4: # used for mfa testing (as well as some helpful links)
9090
image: silintl/ssp-base:local-testing-with-develop-deps
9191
volumes:
9292
- ./development/cert:/data/vendor/simplesamlphp/simplesamlphp/cert
@@ -126,6 +126,7 @@ services:
126126
ID_BROKER_BASE_URI: "http://broker"
127127
REMEMBER_ME_SECRET: "dummy"
128128
PROFILE_URL: "https://example.org/profile"
129+
HELP_CENTER_URL: "https://example.org/help"
129130
command: ["bash", "-c", "whenavail silAuthDb 3306 60 ./run-idp.sh"]
130131

131132
silAuthDb:

themes/material/core/loginuserpass.php

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ function onRecaptchaLoad() {
4545
<?php include __DIR__ . '/../common-announcement.php' ?>
4646

4747
<form method="post" autocomplete="off">
48-
<input type="hidden" name="AuthState"
49-
value="<?= htmlentities($this->data['stateparams']['AuthState']) ?>" />
48+
<input type="hidden" name="AuthState" value="<?= htmlentities($this->data['stateparams']['AuthState']) ?>" />
49+
5050
<?php
5151
$csrfToken = htmlentities($this->data['csrfToken']);
5252
?>
5353
<input type="hidden" name="csrf-token" value="<?= $csrfToken ?>" />
5454

5555
<div class="mdl-card mdl-shadow--8dp fill-phone-viewport">
5656
<div class="mdl-card__media white-bg margin" layout-children="column">
57-
<img src="/logo.png"
58-
alt="<?= $this->t('{material:login:logo}', ['{idpName}' => $idpName]) ?>">
57+
<img src="/logo.png" alt="<?= $this->t('{material:login:logo}', ['{idpName}' => $idpName]) ?>">
5958
</div>
6059

6160
<div class="mdl-card__title center">
@@ -69,20 +68,21 @@ function onRecaptchaLoad() {
6968
<label for="username" class="mdl-textfield__label">
7069
<?= $this->t('{material:login:label_username}') ?>
7170
</label>
71+
7272
<?php
7373
$username = htmlentities($this->data['username'] ?? null);
7474
?>
75-
<input type="text" name="username" class="mdl-textfield__input"
76-
value="<?= $username ?>" <?= empty($username) ? 'autofocus' : '' ?>
77-
id="username"/>
75+
<input type="text" name="username" class="mdl-textfield__input" value="<?= $username ?>"
76+
<?= empty($username) ? 'autofocus' : '' ?> id="username"/>
7877
</div>
7978

8079
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
8180
<label for="password" class="mdl-textfield__label">
8281
<?= $this->t('{material:login:label_password}') ?>
8382
</label>
84-
<input type="password" name="password" class="mdl-textfield__input"
85-
<?= ! empty($username) ? 'autofocus' : '' ?> id="password"/>
83+
84+
<input type="password" name="password" class="mdl-textfield__input" <?= ! empty($username) ? 'autofocus' : '' ?>
85+
id="password"/>
8686
</div>
8787
</div>
8888

@@ -114,8 +114,7 @@ function onRecaptchaLoad() {
114114
$forgotPasswordUrl = htmlentities($this->configuration->getValue('passwordForgotUrl'));
115115
if (! empty($forgotPasswordUrl)) {
116116
?>
117-
<a href="<?= $forgotPasswordUrl ?>" target="_blank"
118-
class="mdl-button mdl-button--colored mdl-typography--caption">
117+
<a href="<?= $forgotPasswordUrl ?>" target="_blank" class="mdl-button mdl-button--colored mdl-typography--caption">
119118
<?= $this->t('{material:login:forgot}') ?>
120119
</a>
121120
<?php
@@ -129,6 +128,20 @@ class="mdl-button mdl-button--colored mdl-typography--caption">
129128
</button>
130129
</div>
131130
</div>
131+
132+
<section layout-children="row" child-spacing="space-around">
133+
<?php if (! empty($this->data['helpCenterUrl'])): ?>
134+
<a href="<?= $this->data['helpCenterUrl'] ?>" target="_blank">
135+
<?= $this->t('{material:login:help}') ?>
136+
</a>
137+
<?php endif; ?>
138+
139+
<?php if (! empty($this->data['profileUrl'])): ?>
140+
<a href="<?= $this->data['profileUrl'] ?>" target="_blank">
141+
<?= $this->t('{material:login:profile}') ?>
142+
</a>
143+
<?php endif; ?>
144+
</section>
132145
</form>
133146
</main>
134147
</div>

0 commit comments

Comments
 (0)