From 23524307e647724454cf0e7ea15ea49f94ce2eae Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 20 Feb 2015 17:39:25 -0500 Subject: [PATCH] Recover normal profile edition in case of Drupal SSO - refs BT#9062 --- main/auth/sso/sso.Drupal.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; }