Task #1347 ยป LdapAuthentication.php.diff
| LdapAuthentication/LdapAuthentication.php 2016-01-26 16:40:10.604456113 +0100 | ||
|---|---|---|
| 1311 | 1311 |
$canonicalname = $username; |
| 1312 | 1312 |
if ( $username != '' ) {
|
| 1313 | 1313 |
$this->printDebug( "Username is: $username", NONSENSITIVE ); |
| 1314 |
if ( $this->getConf( 'LowerCaseUsername' ) ) {
|
|
| 1315 |
$canonicalname = ucfirst( strtolower( $canonicalname ) ); |
|
| 1316 |
} else {
|
|
| 1314 |
// if ( $this->getConf( 'LowerCaseUsername' ) ) {
|
|
| 1315 |
// $canonicalname = ucfirst( strtolower( $canonicalname ) );
|
|
| 1316 |
// } else {
|
|
| 1317 | 1317 |
# Fetch username, so that we can possibly use it. |
| 1318 | 1318 |
$userInfo = $wgMemc->get( $key ); |
| 1319 | 1319 |
if ( is_array( $userInfo ) ) {
|
| 1320 | 1320 |
$this->printDebug( "Fetched userInfo from memcache.", NONSENSITIVE ); |
| 1321 | 1321 |
if ( $userInfo["username"] == $username ) {
|
| 1322 | 1322 |
$this->printDebug( "Username matched a key in memcache, using the fetched name: " . $userInfo["canonicalname"], NONSENSITIVE ); |
| 1323 |
$canonicalname = ucfirst( strtolower( $canonicalname ) ); |
|
| 1323 | 1324 |
return $userInfo["canonicalname"]; |
| 1324 | 1325 |
} |
| 1325 | 1326 |
} |
| ... | ... | |
| 1345 | 1346 |
} |
| 1346 | 1347 | |
| 1347 | 1348 |
$wgMemc->set( $key, array( "username" => $username, "canonicalname" => $canonicalname ), 3600 * 24 ); |
| 1348 |
} |
|
| 1349 |
// }
|
|
| 1349 | 1350 |
} |
| 1350 | 1351 |
$this->printDebug( "Munged username: $canonicalname", NONSENSITIVE ); |
| 1351 | 1352 |
return $canonicalname; |