Index: trunk/extensions/CrowdAuthentication/CrowdAuthentication.php |
— | — | @@ -236,11 +236,8 @@ |
237 | 237 | * Find the groups this user is a member of. |
238 | 238 | */ |
239 | 239 | |
240 | | - $restr = new caSearchRestriction(); |
241 | | - $restr->name = "group.principal.member"; |
242 | | - $restr->value = $this->findUsername( $user->getName() ); |
243 | | - $groups = $this->crowd->searchGroups( array( "in0" => $this->token, "in1" => array( $restr ) ) ); |
244 | | - $groups = $groups->out->SOAPGroup; |
| 240 | + $groups = $this->crowd->findGroupMemberships( array( "in0" => $this->token, "in1" => $user->getName() ) ); |
| 241 | + $groups = $groups->out->string; |
245 | 242 | |
246 | 243 | $dbw = wfGetDB( DB_MASTER ); |
247 | 244 | if ( $caOverwriteLocalGroups ) { |
— | — | @@ -248,7 +245,7 @@ |
249 | 246 | } |
250 | 247 | |
251 | 248 | foreach ( $groups as $group ) { |
252 | | - $user->addGroup( $group->name ); |
| 249 | + $user->addGroup( $group ); |
253 | 250 | } |
254 | 251 | return true; |
255 | 252 | } |
— | — | @@ -320,7 +317,7 @@ |
321 | 318 | $nameparts = split( " ", $realname, 2 ); |
322 | 319 | $firstname = $user->getName(); |
323 | 320 | $lastname = ""; |
324 | | - if ( count( $nameparts ) > 0 ) { |
| 321 | + if ( count( $nameparts ) > 0 && strlen( $nameparts[0] ) ) { |
325 | 322 | $firstname = $nameparts[0]; |
326 | 323 | |
327 | 324 | if ( count( $nameparts ) > 1 ) { |
— | — | @@ -335,10 +332,10 @@ |
336 | 333 | new caSOAPAttribute( "mail", $email ), |
337 | 334 | new caSOAPAttribute( "givenName", $firstname ), |
338 | 335 | new caSOAPAttribute( "sn", $lastname ), |
339 | | - new caSOAPAttribute( "invalidPasswordAttempts", 0 ), |
340 | | - new caSOAPAttribute( "lastAuthenticated", 0 ), |
341 | | - new caSOAPAttribute( "passwordLastChanged", 0 ), |
342 | | - new caSOAPAttribute( "requiresPasswordChange", 0 ), |
| 336 | + // new caSOAPAttribute( "invalidPasswordAttempts", 0 ), |
| 337 | + // new caSOAPAttribute( "lastAuthenticated", 0 ), |
| 338 | + // new caSOAPAttribute( "passwordLastChanged", 0 ), |
| 339 | + // new caSOAPAttribute( "requiresPasswordChange", 0 ), |
343 | 340 | ); |
344 | 341 | $principal->active = true; |
345 | 342 | $principal->conception = 0; |
— | — | @@ -351,7 +348,10 @@ |
352 | 349 | ) |
353 | 350 | ); |
354 | 351 | foreach ( $caDefaultGroups as $group ) { |
355 | | - $crowd->addPrincipalToGroup( array( "in0" => $this->token, "in1" => $user->getName(), "in2" => $group ) ); |
| 352 | + // XXX hack from Toolserver |
| 353 | + try { |
| 354 | + $crowd->addPrincipalToGroup( array( "in0" => $this->token, "in1" => $user->getName(), "in2" => $group ) ); |
| 355 | + } catch (Exception $e) { } |
356 | 356 | } |
357 | 357 | |
358 | 358 | return true; |