File tree 2 files changed +11
-4
lines changed
module/VuFind/src/VuFind/Auth
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 8
8
username = fakeuser1
9
9
10
10
; Map of user attributes to set (corresponding to columns in the user table).
11
+ ; Comment this out to use defaults, and set "attributes = false" to disable all
12
+ ; attributes.
11
13
attributes[firstname] = Test
12
14
attributes[lastname] = User
13
15
attributes[email] =
" [email protected] "
Original file line number Diff line number Diff line change @@ -96,10 +96,15 @@ public function authenticate($request)
96
96
throw new AuthException ('Simulated failure ' );
97
97
}
98
98
$ user = $ this ->getUserTable ()->getByUsername ($ username );
99
- $ attribs = array_merge (
100
- $ this ->defaultAttributes ,
101
- $ this ->simulatedSSOConfig ['General ' ]['attributes ' ] ?? []
102
- );
99
+
100
+ // Get attribute configuration -- use defaults if no value is set, and use an
101
+ // empty array if something invalid was provided.
102
+ $ attribs = $ this ->simulatedSSOConfig ['General ' ]['attributes ' ]
103
+ ?? $ this ->defaultAttributes ;
104
+ if (!is_array ($ attribs )) {
105
+ $ attribs = [];
106
+ }
107
+
103
108
$ catPassword = null ;
104
109
foreach ($ attribs as $ attribute => $ value ) {
105
110
if ($ attribute == 'email ' ) {
You can’t perform that action at this time.
0 commit comments