Skip to content

Commit 0f1dbcb

Browse files
authored
Merge pull request #22 from RRZE-Webteam/dev
Dev
2 parents 667aa87 + 3dcb15c commit 0f1dbcb

6 files changed

+52
-35
lines changed

includes/Authenticate.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,21 @@ public function authenticate($user, $userLogin)
128128
foreach ($_atts as $key => $value) {
129129
if (
130130
is_array($value)
131-
&& in_array($key, ['uid', 'mail', 'displayName', 'cn', 'sn', 'givenName', 'o'])
131+
&& in_array(
132+
$key,
133+
[
134+
'uid',
135+
'subject-id',
136+
'eduPersonUniqueId',
137+
'eduPersonPrincipalName',
138+
'mail',
139+
'displayName',
140+
'cn',
141+
'sn',
142+
'givenName',
143+
'o'
144+
]
145+
)
132146
) {
133147
$atts[$key] = $value[0];
134148
} else {
@@ -138,7 +152,10 @@ public function authenticate($user, $userLogin)
138152

139153
$domainScope = '';
140154
$identityProviders = simpleSAML()->getIdentityProviders();
155+
141156
$userLogin = $atts['uid'] ?? '';
157+
$subjectId = $atts['subject-id'] ?? $atts['eduPersonUniqueId'] ?? $atts['eduPersonPrincipalName'] ?? '';
158+
$userLogin = $userLogin ?: explode('@', $subjectId)[0];
142159

143160
foreach (array_keys($identityProviders) as $key) {
144161
$key = sanitize_title($key);

languages/rrze-sso-de_DE.mo

0 Bytes
Binary file not shown.

languages/rrze-sso-de_DE.po

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: RRZE SSO\n"
44
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rrze-sso\n"
5-
"POT-Creation-Date: 2023-04-12T14:49:56+00:00\n"
6-
"PO-Revision-Date: 2023-04-12 16:50+0200\n"
5+
"POT-Creation-Date: 2023-04-13T15:21:18+00:00\n"
6+
"PO-Revision-Date: 2023-04-13 17:22+0200\n"
77
"Last-Translator: RRZE Webteam <[email protected]>\n"
88
"Language-Team: Deutsch\n"
99
"Language: de_DE\n"
@@ -42,42 +42,42 @@ msgstr "https://blogs.fau.de/webworking/"
4242
msgid "User attributes could not be retrieved."
4343
msgstr "Benutzerattribute konnten nicht abgerufen werden."
4444

45-
#: includes/Authenticate.php:156
45+
#: includes/Authenticate.php:173
4646
msgid "The username entered is not valid."
4747
msgstr "Die eingegebene Kennung ist nicht gültig."
4848

49-
#: includes/Authenticate.php:238
49+
#: includes/Authenticate.php:255
5050
msgid "The user could not be added."
5151
msgstr "Der Benutzer konnte nicht registriert werden."
5252

5353
#. translators: %s: username.
54-
#: includes/Authenticate.php:260
54+
#: includes/Authenticate.php:277
5555
msgid "The username \"%s\" is not registered on this website."
5656
msgstr "Der Benutzername „%s“ ist auf dieser Website nicht registriert."
5757

58-
#: includes/Authenticate.php:309
58+
#: includes/Authenticate.php:326
5959
msgid "ERROR:"
6060
msgstr "Fehler:"
6161

6262
#. translators: %s: name of the website.
63-
#: includes/Authenticate.php:316
63+
#: includes/Authenticate.php:333
6464
msgid "Authentication failed on the &ldquo;%s&rdquo; website."
6565
msgstr "Die Anmeldung auf der Website &bdquo;%s&ldquo; ist fehlgeschlagen."
6666

67-
#: includes/Authenticate.php:322
67+
#: includes/Authenticate.php:339
6868
msgid ""
6969
"However, if no login is possible, please contact the contact person of the "
7070
"website."
7171
msgstr ""
7272
"Sollte dennoch keine Anmeldung möglich sein, dann wenden Sie sich bitte an "
7373
"den Ansprechpartner der Website."
7474

75-
#: includes/Authenticate.php:331 includes/Authenticate.php:374
75+
#: includes/Authenticate.php:348 includes/Authenticate.php:391
7676
msgid "Single Sign-On Log Out"
7777
msgstr "Single Sign-On Abmeldung"
7878

7979
#. translators: %s: name of the website.
80-
#: includes/Authenticate.php:348
80+
#: includes/Authenticate.php:365
8181
msgid ""
8282
"You attempted to access the &ldquo;%1$s&rdquo; dashboard, but you do not "
8383
"currently have privileges on this website. If you believe you should be able "
@@ -89,7 +89,7 @@ msgstr ""
8989
"Zugriff auf das &bdquo;%1$s&ldquo; Dashboard haben, dann wenden Sie sich "
9090
"bitte an den Ansprechpartner der Website."
9191

92-
#: includes/Authenticate.php:353
92+
#: includes/Authenticate.php:370
9393
msgid ""
9494
"If you reached this screen by accident and meant to visit one of your own "
9595
"websites, here are some shortcuts to help you find your way."
@@ -98,24 +98,24 @@ msgstr ""
9898
"Ihrer eigenen Websites besuchen wollten, hier ein paar hoffentlich "
9999
"hilfreiche Links."
100100

101-
#: includes/Authenticate.php:355
101+
#: includes/Authenticate.php:372
102102
msgid "Your Websites"
103103
msgstr "Ihre Websites"
104104

105-
#: includes/Authenticate.php:361
105+
#: includes/Authenticate.php:378
106106
msgid "Visit the Dashboard"
107107
msgstr "Dashboard besuchen"
108108

109-
#: includes/Authenticate.php:362
109+
#: includes/Authenticate.php:379
110110
msgid "View the website"
111111
msgstr "Webseite anzeigen"
112112

113113
#. translators: %s: name of the website.
114-
#: includes/Authenticate.php:400
114+
#: includes/Authenticate.php:417
115115
msgid "Contact persons for the &ldquo;%s&rdquo; website"
116116
msgstr "Ansprechpartner und Kontakt für die &bdquo;%s&ldquo; Website"
117117

118-
#: includes/Authenticate.php:409
118+
#: includes/Authenticate.php:426
119119
msgid "Email Address:"
120120
msgstr "E-Mail-Adresse:"
121121

languages/rrze-sso-de_DE_formal.mo

0 Bytes
Binary file not shown.

languages/rrze-sso-de_DE_formal.po

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: RRZE SSO\n"
44
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rrze-sso\n"
5-
"POT-Creation-Date: 2023-04-12T14:49:56+00:00\n"
6-
"PO-Revision-Date: 2023-04-12 16:50+0200\n"
5+
"POT-Creation-Date: 2023-04-13T15:21:18+00:00\n"
6+
"PO-Revision-Date: 2023-04-13 17:22+0200\n"
77
"Last-Translator: RRZE Webteam <[email protected]>\n"
88
"Language-Team: Deutsch (Sie)\n"
99
"Language: de\n"
@@ -42,42 +42,42 @@ msgstr "https://blogs.fau.de/webworking/"
4242
msgid "User attributes could not be retrieved."
4343
msgstr "Benutzerattribute konnten nicht abgerufen werden."
4444

45-
#: includes/Authenticate.php:156
45+
#: includes/Authenticate.php:173
4646
msgid "The username entered is not valid."
4747
msgstr "Die eingegebene Kennung ist nicht gültig."
4848

49-
#: includes/Authenticate.php:238
49+
#: includes/Authenticate.php:255
5050
msgid "The user could not be added."
5151
msgstr "Der Benutzer konnte nicht registriert werden."
5252

5353
#. translators: %s: username.
54-
#: includes/Authenticate.php:260
54+
#: includes/Authenticate.php:277
5555
msgid "The username \"%s\" is not registered on this website."
5656
msgstr "Der Benutzername „%s“ ist auf dieser Website nicht registriert."
5757

58-
#: includes/Authenticate.php:309
58+
#: includes/Authenticate.php:326
5959
msgid "ERROR:"
6060
msgstr "Fehler:"
6161

6262
#. translators: %s: name of the website.
63-
#: includes/Authenticate.php:316
63+
#: includes/Authenticate.php:333
6464
msgid "Authentication failed on the &ldquo;%s&rdquo; website."
6565
msgstr "Die Anmeldung auf der Website &bdquo;%s&ldquo; ist fehlgeschlagen."
6666

67-
#: includes/Authenticate.php:322
67+
#: includes/Authenticate.php:339
6868
msgid ""
6969
"However, if no login is possible, please contact the contact person of the "
7070
"website."
7171
msgstr ""
7272
"Sollte dennoch keine Anmeldung möglich sein, dann wenden Sie sich bitte an "
7373
"den Ansprechpartner der Website."
7474

75-
#: includes/Authenticate.php:331 includes/Authenticate.php:374
75+
#: includes/Authenticate.php:348 includes/Authenticate.php:391
7676
msgid "Single Sign-On Log Out"
7777
msgstr "Single Sign-On Abmeldung"
7878

7979
#. translators: %s: name of the website.
80-
#: includes/Authenticate.php:348
80+
#: includes/Authenticate.php:365
8181
msgid ""
8282
"You attempted to access the &ldquo;%1$s&rdquo; dashboard, but you do not "
8383
"currently have privileges on this website. If you believe you should be able "
@@ -89,7 +89,7 @@ msgstr ""
8989
"Zugriff auf das &bdquo;%1$s&ldquo; Dashboard haben, dann wenden Sie sich "
9090
"bitte an den Ansprechpartner der Website."
9191

92-
#: includes/Authenticate.php:353
92+
#: includes/Authenticate.php:370
9393
msgid ""
9494
"If you reached this screen by accident and meant to visit one of your own "
9595
"websites, here are some shortcuts to help you find your way."
@@ -98,24 +98,24 @@ msgstr ""
9898
"Ihrer eigenen Websites besuchen wollten, hier ein paar hoffentlich "
9999
"hilfreiche Links."
100100

101-
#: includes/Authenticate.php:355
101+
#: includes/Authenticate.php:372
102102
msgid "Your Websites"
103103
msgstr "Ihre Websites"
104104

105-
#: includes/Authenticate.php:361
105+
#: includes/Authenticate.php:378
106106
msgid "Visit the Dashboard"
107107
msgstr "Dashboard besuchen"
108108

109-
#: includes/Authenticate.php:362
109+
#: includes/Authenticate.php:379
110110
msgid "View the website"
111111
msgstr "Webseite anzeigen"
112112

113113
#. translators: %s: name of the website.
114-
#: includes/Authenticate.php:400
114+
#: includes/Authenticate.php:417
115115
msgid "Contact persons for the &ldquo;%s&rdquo; website"
116116
msgstr "Ansprechpartner und Kontakt für die &bdquo;%s&ldquo; Website"
117117

118-
#: includes/Authenticate.php:409
118+
#: includes/Authenticate.php:426
119119
msgid "Email Address:"
120120
msgstr "E-Mail-Adresse:"
121121

rrze-sso.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: RRZE SSO
55
Plugin URI: https://github.com/RRZE-Webteam/rrze-sso
66
Description: Single-Sign-On (SSO) SAML-Integrations-Plugin für WordPress.
7-
Version: 1.6.0
7+
Version: 1.6.1
88
Author: RRZE-Webteam
99
Author URI: https://blogs.fau.de/webworking/
1010
License: GNU General Public License v2
@@ -18,7 +18,7 @@
1818
defined('ABSPATH') || exit;
1919

2020
const RRZE_PHP_VERSION = '8.0';
21-
const RRZE_WP_VERSION = '6.1';
21+
const RRZE_WP_VERSION = '6.2';
2222

2323
/**
2424
* SPL Autoloader (PSR-4).

0 commit comments

Comments
 (0)