@@ 158-170 (lines=13) @@ | ||
155 | * @param User $user |
|
156 | * @param bool $autocreated |
|
157 | */ |
|
158 | public function onLocalUserCreated( $user, $autocreated ) { |
|
159 | // For $autocreated, see self::autoCreatedAccount() |
|
160 | if ( !$autocreated ) { |
|
161 | $hookUser = $user; |
|
162 | // No way to know the domain, just hope the provider handles that. |
|
163 | $this->auth->initUser( $hookUser, $autocreated ); |
|
164 | if ( $hookUser !== $user ) { |
|
165 | throw new \UnexpectedValueException( |
|
166 | get_class( $this->auth ) . '::initUser() tried to replace $user!' |
|
167 | ); |
|
168 | } |
|
169 | } |
|
170 | } |
|
171 | ||
172 | public function getUniqueId() { |
|
173 | return parent::getUniqueId() . ':' . get_class( $this->auth ); |
|
@@ 419-428 (lines=10) @@ | ||
416 | } |
|
417 | } |
|
418 | ||
419 | public function autoCreatedAccount( $user, $source ) { |
|
420 | $hookUser = $user; |
|
421 | // No way to know the domain, just hope the provider handles that. |
|
422 | $this->auth->initUser( $hookUser, true ); |
|
423 | if ( $hookUser !== $user ) { |
|
424 | throw new \UnexpectedValueException( |
|
425 | get_class( $this->auth ) . '::initUser() tried to replace $user!' |
|
426 | ); |
|
427 | } |
|
428 | } |
|
429 | } |
|
430 |