Index: trunk/extensions/CentralAuth/CentralAuthPlugin.php |
— | — | @@ -108,9 +108,10 @@ |
109 | 109 | */ |
110 | 110 | function updateUser( &$user ) { |
111 | 111 | $central = new CentralAuthUser( $user->getName() ); |
112 | | - $email = $central->getEmail(); |
113 | | - if ( strval( $email ) !== '' ) { |
114 | | - $user->setEmail( $email ); |
| 112 | + if ( $central->exists() && $central->isAttached() ) { |
| 113 | + $user->setEmail( $central->getEmail() ); |
| 114 | + $user->mEmailAuthenticated = $central->getEmailAuthenticationTimestamp(); |
| 115 | + $user->saveSettings(); |
115 | 116 | } |
116 | 117 | return true; |
117 | 118 | } |
Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -1045,6 +1045,14 @@ |
1046 | 1046 | __METHOD__ ); |
1047 | 1047 | } |
1048 | 1048 | |
| 1049 | + function getEmailAuthenticationTimestamp() { |
| 1050 | + $dbr = self::getCentralDB(); |
| 1051 | + return $dbr->selectField( self::tableName( 'globaluser' ), |
| 1052 | + 'gu_email_authenticated', |
| 1053 | + array( 'gu_id' => $this->getId() ), |
| 1054 | + __METHOD__ ); |
| 1055 | + } |
| 1056 | + |
1049 | 1057 | /** |
1050 | 1058 | * Salt and hash a new plaintext password. |
1051 | 1059 | * @param string $password plaintext |