Skip to content
Snippets Groups Projects
Commit 4eb4f73f authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

use source_ip instead of user name when there is no authentication

parent e5f72caf
No related branches found
No related tags found
No related merge requests found
......@@ -413,6 +413,9 @@ sub req_complete_challenge {
PRE_CHOMP => CHOMP_ONE,
INCLUDE_PATH => $templates_dir
});
my $source_ip = $ENV{HTTP_X_FORWARDED_FOR} ?
(split(/, /, $ENV{HTTP_X_FORWARDED_FOR}))[0] :
$ENV{REMOTE_ADDR};
my $user =
$ENV{'HTTP_DISPLAYNAME'} ? $ENV{'HTTP_DISPLAYNAME'} :
$ENV{'displayName'} ? $ENV{'displayName'} :
......@@ -429,6 +432,7 @@ sub req_complete_challenge {
name => $self->{configuration}->{app}->{name},
},
user => $user,
source_ip => $source_ip,
idp => {
entityid => $idp,
},
......
......@@ -182,6 +182,11 @@ msgstr "Sélectionnez votre adresse e-mail"
msgid "Select your service provider"
msgstr "Sélectionnez votre fournisseur de service"
#. (source_ip, sp.entityid)
#: templates/mail/send_authentication_token.tt2.html:6 templates/mail/send_authentication_token.tt2.txt:5
msgid "Somebody has requested creation of test accounts for service provider %1, from IP address %2."
msgstr "Quelqu'un a demandé la création de comptes de test pour le fournisseur de service %1, depuis l'adresse IP %2."
#: templates/web/edugain/create_accounts.tt2.html:8 templates/web/renater/create_accounts.tt2.html:10
msgid "Test accounts created"
msgstr "Comptes de test créés"
......
<p>
[% lh.maketext("This is an email challenge automatically sent to you by [_1].", app.name) %]
[% IF user && idp %]
[% lh.maketext("User [_1], authenticated by Identity Provider [_2], has requested creation of test accounts for Service Provider [_3].", user, idp.entityid, sp.entityid) %]
[% ELSE %]
[% lh.maketext("Somebody has requested creation of test accounts for service provider [_1], from IP address [_2].", sp.entityid, source_ip) %]
[% END %]
[% lh.maketext("The address [_1] is mentioned in the federation metadata as a contact for this Service Provider.", to) %]
</p>
......
[% lh.maketext("This is an email challenge automatically sent to you by [_1].", app.name) %]
[% IF user && idp %]
[% lh.maketext("User [_1], authenticated by Identity Provider [_2], has requested creation of test accounts for Service Provider [_3].", user, idp.entityid, sp.entityid) %]
[% ELSE %]
[% lh.maketext("Somebody has requested creation of test accounts for service provider [_1], from IP address [_2].", sp.entityid, source_ip) %]
[% END %]
[% lh.maketext("The address [_1] is mentioned in the federation metadata as a contact for this Service Provider.", to) %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in [_1]:", app.name) %]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment