|
|
|
@ -22,8 +22,7 @@ class HookCreateDrupalUser extends HookObserver implements HookCreateUserObserve |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a Drupal user when the Chamilo user is registered |
|
|
|
* Create a Drupal user when the Chamilo user is registered |
|
|
|
* @param HookCreateUserEventInterface $hook The hook |
|
|
|
* @param HookCreateUserEventInterface $hook The hook |
|
|
|
* @return array|bool Drupal created user id |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function hookCreateUser(HookCreateUserEventInterface $hook) |
|
|
|
public function hookCreateUser(HookCreateUserEventInterface $hook) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -57,9 +56,8 @@ class HookCreateDrupalUser extends HookObserver implements HookCreateUserObserve |
|
|
|
$client = new SoapClient(null, $options); |
|
|
|
$client = new SoapClient(null, $options); |
|
|
|
$drupalUserId = $client->addUser($fields, $extraFields); |
|
|
|
$drupalUserId = $client->addUser($fields, $extraFields); |
|
|
|
if ($drupalUserId !== false) { |
|
|
|
if ($drupalUserId !== false) { |
|
|
|
$drupalUserId = array('drupal_user_id' => $drupalUserId); |
|
|
|
UserManager::update_extra_field_value($return, 'drupal_user_id', $drupalUserId); |
|
|
|
} |
|
|
|
} |
|
|
|
return $drupalUserId; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|