You are here

function zoomapi_api_update_user in Zoom API 7.2

Update Zoom user.

1 call to zoomapi_api_update_user()
zoomapi_update_user in ./zoomapi.module
Update Zoom user.

File

./zoomapi.api.inc, line 111
API callbacks for Zoom API module.

Code

function zoomapi_api_update_user($uid, $zoom_user_id, array $user_info) {
  try {
    drupal_alter('zoomapi_update_user', $user_info, $uid);
    $zoom_client = zoomapi_client();
    $zoom_client
      ->api('user')
      ->update($zoom_user_id, $user_info);
    if (!empty($user_info['email'])) {
      $zoom_user = $zoom_client
        ->api('user')
        ->fetch($zoom_user_id);
      zoomapi_track_user($uid, $zoom_user);
    }
    return TRUE;
  } catch (\Exception $e) {
    watchdog(__FUNCTION__, 'Unable to update zoom account @id for user !uid. Error: @e', [
      '@e' => $e
        ->getMessage(),
      '@id' => $zoom_user_id,
      '!uid' => $uid,
    ], WATCHDOG_CRITICAL);
    return FALSE;
  }
}