Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: CrowdAuthentication/CrowdAuthentication.php
- ===================================================================
- --- CrowdAuthentication/CrowdAuthentication.php (revision 78055)
- +++ CrowdAuthentication/CrowdAuthentication.php (working copy)
- @@ -165,18 +165,15 @@
- * Find the groups this user is a member of.
- */
- - $restr = new caSearchRestriction();
- - $restr->name = "group.principal.member";
- - $restr->value = $this->findUsername($user->getName());
- - $groups = $this->crowd->searchGroups(array("in0" => $this->token, "in1" => array($restr)));
- - $groups = $groups->out->SOAPGroup;
- + $groups = $this->crowd->findGroupMemberships(array("in0" => $this->token, "in1" => $user->getName()));
- + $groups = $groups->out->string;
- $dbw = wfGetDB(DB_MASTER);
- if ($caOverwriteLocalGroups)
- $dbw->delete('user_group', array('ug_user' => $user->getId()));
- foreach ($groups as $group) {
- - $user->addGroup($group->name);
- + $user->addGroup($group);
- }
- }
- @@ -219,7 +216,7 @@
- $nameparts = split(" ", $realname, 2);
- $firstname = $user->getName();
- $lastname = "";
- - if (count($nameparts) > 0)
- + if (count($nameparts) > 0 && strlen($nameparts[0]))
- $firstname = $nameparts[0];
- if (count($nameparts) > 1)
- $lastname = $nameparts[1];
- @@ -231,10 +228,10 @@
- new caSOAPAttribute("mail", $email),
- new caSOAPAttribute("givenName", $firstname),
- new caSOAPAttribute("sn", $lastname),
- - new caSOAPAttribute("invalidPasswordAttempts", 0),
- - new caSOAPAttribute("lastAuthenticated", 0),
- - new caSOAPAttribute("passwordLastChanged", 0),
- - new caSOAPAttribute("requiresPasswordChange", 0),
- + # new caSOAPAttribute("invalidPasswordAttempts", 0),
- + # new caSOAPAttribute("lastAuthenticated", 0),
- + # new caSOAPAttribute("passwordLastChanged", 0),
- + # new caSOAPAttribute("requiresPasswordChange", 0),
- );
- $principal->active = true;
- $principal->conception = 0;
- @@ -244,8 +241,12 @@
- $crowd->addPrincipal(array("in0" => $this->token,
- "in1" => $principal,
- "in2" => $cred));
- - foreach ($caDefaultGroups as $group)
- - $crowd->addPrincipalToGroup(array("in0" => $this->token, "in1" => $user->getName(), "in2" => $group));
- + foreach ($caDefaultGroups as $group) {
- + // XXX hack
- + try {
- + $crowd->addPrincipalToGroup(array("in0" => $this->token, "in1" => $user->getName(), "in2" => $group));
- + } catch (Exception $e) { }
- + }
- return true;
- } catch (Exception $e) {
Add Comment
Please, Sign In to add comment