r107436 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107435‎ | r107436 | r107437 >
Date:21:53, 27 December 2011
Author:laner
Status:resolved
Tags:
Comment:
Follow up to r107433. Delete userinfo key when modifying user.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -855,6 +855,8 @@
856856 * @return bool
857857 */
858858 public function updateExternalDB( $user ) {
 859+ global $wgMemc;
 860+
859861 $this->printDebug( "Entering updateExternalDB", NONSENSITIVE );
860862
861863 if ( !$this->getConf( 'UpdateLDAP' ) || $this->getSessionDomain() == 'local' ) {
@@ -896,6 +898,9 @@
897899 if ( '' != $this->lang ) { $values["preferredlanguage"] = $this->lang; }
898900
899901 if ( count( $values ) && LdapAuthenticationPlugin::ldap_modify( $this->ldapconn, $this->userdn, $values ) ) {
 902+ // We changed the user, we need to invalidate the memcache key
 903+ $key = wfMemcKey( 'ldapauthentication', 'userinfo', $this->userdn );
 904+ $wgMemc->delete( $key )
900905 $this->printDebug( "Successfully modified the user's attributes", NONSENSITIVE );
901906 LdapAuthenticationPlugin::ldap_unbind( $this->ldapconn );
902907 return true;
@@ -1368,7 +1373,7 @@
13691374 */
13701375 function getUserInfoStateless( $userdn ) {
13711376 global $wgMemc;
1372 - $key = wfMemcKey( 'ldapauthentication', 'userdn', $userdn );
 1377+ $key = wfMemcKey( 'ldapauthentication', 'userinfo', $userdn );
13731378
13741379 $userInfo = $wgMemc->get( $key );
13751380 if ( !is_array( $userInfo ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r107439; at end of line, missing from r107436reedy21:57, 27 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107433Yay, more memcachingreedy21:40, 27 December 2011

Status & tagging log