Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -1126,30 +1126,28 @@ |
1127 | 1127 | $this->printDebug( "Retrieving preferences", NONSENSITIVE ); |
1128 | 1128 | $prefs = $wgLDAPPreferences[$_SESSION['wsDomain']]; |
1129 | 1129 | foreach ( array_keys( $prefs ) as $key ) { |
| 1130 | + $attr = strtolower( $prefs[$key] ); |
| 1131 | + if ( isset( $this->userInfo[0][$attr] ) ) { |
| 1132 | + $value = $this->userInfo[0][$attr]; |
| 1133 | + } else { |
| 1134 | + continue; |
| 1135 | + } |
1130 | 1136 | switch ( $key ) { |
1131 | 1137 | case "email": |
1132 | | - if ( isset( $this->userInfo[0]["$prefs[$key]"] ) ) { |
1133 | | - $this->email = $this->userInfo[0]["$prefs[$key]"][0]; |
1134 | | - $this->printDebug( "Retrieved email ($this->email) using attribute ($prefs[$key])", NONSENSITIVE ); |
1135 | | - } |
| 1138 | + $this->email = $value; |
| 1139 | + $this->printDebug( "Retrieved email ($this->email) using attribute ($attr)", NONSENSITIVE ); |
1136 | 1140 | break; |
1137 | 1141 | case "language": |
1138 | | - if ( isset( $this->userInfo[0]["$prefs[$key]"] ) ) { |
1139 | | - $this->lang = $this->userInfo[0][$prefs[$key]][0]; |
1140 | | - $this->printDebug( "Retrieved language ($this->lang) using attribute ($prefs[$key])", NONSENSITIVE ); |
1141 | | - } |
| 1142 | + $this->lang = $value; |
| 1143 | + $this->printDebug( "Retrieved language ($this->lang) using attribute ($attr)", NONSENSITIVE ); |
1142 | 1144 | break; |
1143 | 1145 | case "nickname": |
1144 | | - if ( isset( $this->userInfo[0]["$prefs[$key]"] ) ) { |
1145 | | - $this->nickname = $this->userInfo[0]["$prefs[$key]"][0]; |
1146 | | - $this->printDebug( "Retrieved nickname ($this->nickname) using attribute ($prefs[$key])", NONSENSITIVE ); |
1147 | | - } |
| 1146 | + $this->nickname = $value; |
| 1147 | + $this->printDebug( "Retrieved nickname ($this->nickname) using attribute ($attr)", NONSENSITIVE ); |
1148 | 1148 | break; |
1149 | 1149 | case "realname": |
1150 | | - if ( isset( $this->userInfo[0]["$prefs[$key]"] ) ) { |
1151 | | - $this->realname = $this->userInfo[0]["$prefs[$key]"][0]; |
1152 | | - $this->printDebug( "Retrieved realname ($this->realname) using attribute ($prefs[$key])", NONSENSITIVE ); |
1153 | | - } |
| 1150 | + $this->realname = $value; |
| 1151 | + $this->printDebug( "Retrieved realname ($this->realname) using attribute ($attr)", NONSENSITIVE ); |
1154 | 1152 | break; |
1155 | 1153 | } |
1156 | 1154 | } |
— | — | @@ -1384,7 +1382,7 @@ |
1385 | 1383 | |
1386 | 1384 | $this->userLDAPGroups = $groups; |
1387 | 1385 | } else { |
1388 | | - $this->printDebug( "memberOf attribute isn't set:", NONSENSITIVE ); |
| 1386 | + $this->printDebug( "memberOf attribute isn't set", NONSENSITIVE ); |
1389 | 1387 | } |
1390 | 1388 | } else { |
1391 | 1389 | $this->printDebug( "Searching for the groups", NONSENSITIVE ); |