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

Commit eb4eced

Browse files
authored
Merge pull request #98 from silinternational/develop
Release 7.4.2
2 parents ef7e0a2 + dc3bb90 commit eb4eced

4 files changed

Lines changed: 68 additions & 2 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,28 @@ Translations are categorized by page in definition files located in the `diction
232232
Localization is affected by the configuration setting `language.available`. Only language codes found in this property will be utilized.
233233
For example, if a translation is provided in Afrikaans for this module, the configuration must be adjusted to make 'af' an available
234234
language. If that's not done, the translation function will not utilize the translations even if provided.
235+
236+
### Debugging
237+
238+
Xdebug can be enabled by doing the following:
239+
240+
1. Define `REMOTE_DEBUG_IP` in `local.env`. This should be the IP address of your development machine, i.e. the one that
241+
is running your IDE. If you're using Linux as your Docker host, you can use 172.17.0.1 here.
242+
2. Map run-debug.sh into the container you wish to debug. For example:
243+
```yaml
244+
volumes:
245+
- ./development/run-debug.sh:/data/run.sh
246+
```
247+
3. Enable debugging in your IDE. See the next section for PhpStorm setup.
248+
249+
## Configuring PhpStorm for remote debugging
250+
251+
In PhpStorm go to: Preferences > PHP > Debug > DBGp Proxy and set the following settings:
252+
- Host: (your IP address or hostname)
253+
- Port: 9000
254+
255+
Set path mappings in: Preferences > PHP > Servers
256+
- Add a server and map the project folder to '/data/vendor/simplesamlphp/simplesamlphp/modules/material'
257+
- Map other directories as needed. PhpStorm should prompt when an unrecognized path is encountered.
258+
259+
Then start listening by clicking the "listen" button on the PhpStorm toolbar.

development/run-debug.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
# establish a signal handler to catch the SIGTERM from a 'docker stop'
6+
# reference: https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86
7+
term_handler() {
8+
apache2ctl stop
9+
exit 143; # 128 + 15 -- SIGTERM
10+
}
11+
trap 'kill ${!}; term_handler' SIGTERM
12+
13+
export XDEBUG_CONFIG="remote_enable=1 remote_host="$REMOTE_DEBUG_IP
14+
15+
apt-get update
16+
apt-get install php-xdebug
17+
18+
cd /data
19+
20+
# Send info about this image's O/S and PHP version to our logs.
21+
cat /etc/*release | grep PRETTY
22+
php -v | head -n 1
23+
24+
apache2ctl -k start -D FOREGROUND
25+
26+
# endless loop with a wait is needed for the trap to work
27+
while true
28+
do
29+
tail -f /dev/null & wait ${!}
30+
done

local.env.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ MFA_U2F_apiSecret=
88
MFA_U2F_appId=
99

1010
### Optional ENV vars ###
11-
LOGENTRIES_KEY=
1211
COMPOSER_AUTH=
12+
13+
REMOTE_DEBUG_IP=

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function createHiddenInput(name) {
8787
</script>
8888
</head>
8989

90-
<body class="gradient-bg" onload="verifyU2f()">
90+
<?php $isU2fSupported = $this->data['supportsU2f']; ?>
91+
92+
<body class="gradient-bg" onload="<?= $isU2fSupported ? 'verifyU2f()' : '' ?>">
9193
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
9294
<header class="mdl-layout__header">
9395
<div class="mdl-layout__header-row">
@@ -111,11 +113,19 @@ class="icon">
111113
</h1>
112114
</div>
113115

116+
<?php if ($isU2fSupported): ?>
114117
<div class="mdl-card__title">
115118
<p class="mdl-card__subtitle-text">
116119
<?= $this->t('{material:mfa:u2f_instructions}') ?>
117120
</p>
118121
</div>
122+
<?php else: ?>
123+
<div class="mdl-card__title">
124+
<p class="mdl-typography--text-center mdl-color-text--red">
125+
<?= $this->t('{material:mfa:u2f_unsupported}') ?>
126+
</p>
127+
</div>
128+
<?php endif; ?>
119129

120130
<?php
121131
$message = $this->data['errorMessage'];

0 commit comments

Comments
 (0)