diff --git a/main/auth/sso/sso.Drupal.class.php b/main/auth/sso/sso.Drupal.class.php index 2da1869caf..e5c8d51cf1 100755 --- a/main/auth/sso/sso.Drupal.class.php +++ b/main/auth/sso/sso.Drupal.class.php @@ -243,18 +243,19 @@ class ssoDrupal { $userExtraFieldValue = new ExtraFieldValue('user'); $drupalUserIdData = $userExtraFieldValue->get_values_by_handler_and_field_variable($userId, 'drupal_user_id'); + // If this is an administrator, allow him to make some changes in + // the Chamilo profile + if ($asAdmin && api_is_platform_admin(true)) { + return api_get_path(WEB_CODE_PATH) . "admin/user_edit.php?user_id=$userId"; + } + // If the user doesn't match a Drupal user, give the normal profile + // link if ($drupalUserIdData === false) { - if ($asAdmin && api_is_platform_admin(true)) { - return api_get_path(WEB_CODE_PATH) . "admin/user_edit.php?user_id=$userId"; - } - return api_get_path(WEB_CODE_PATH) . 'auth/profile.php'; } - + // In all other cases, generate a link to the Drupal profile edition $drupalUserId = $drupalUserIdData['field_value']; - $url = "{$this->protocol}{$this->domain}/user/{$drupalUserId}/edit"; - return $url; }