diff --git a/main/auth/sso/sso.Drupal.class.php b/main/auth/sso/sso.Drupal.class.php index eb9789d789..679ea1db56 100755 --- a/main/auth/sso/sso.Drupal.class.php +++ b/main/auth/sso/sso.Drupal.class.php @@ -225,4 +225,30 @@ class ssoDrupal { private function decode_cookie($cookie) { return unserialize(base64_decode($cookie)); } + + /** + * Generate the URL for profile editing + * @global array $_user + * @return string If the URL is obtained return the drupal_user_id. Otherwise return false + */ + public function generateProfileEditingURL() + { + global $_user; + + $userId = $_user['user_id']; + + $userExtraFieldValue = new ExtraFieldValue('user'); + $drupalUserIdData = $userExtraFieldValue->get_values_by_handler_and_field_variable($userId, 'drupal_user_id'); + + if ($drupalUserIdData === false) { + return false; + } + + $drupalUserId = $drupalUserIdData['field_value']; + + $url = "{$this->protocol}{$this->domain}/user/{$drupalUserId}/edit"; + + return $url; + } + } diff --git a/main/auth/sso/sso.class.php b/main/auth/sso/sso.class.php index 89c4f840c1..06ec40dc4d 100755 --- a/main/auth/sso/sso.class.php +++ b/main/auth/sso/sso.class.php @@ -254,4 +254,16 @@ class sso { { return unserialize(base64_decode($cookie)); } + + /** + * Generate the URL for profile editing + * @return string The SSO URL + */ + public function generateProfileEditingURL() + { + $url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php'; + + return $url; + } + } diff --git a/main/social/home.php b/main/social/home.php index 96f7252f56..ceb6109d8c 100755 --- a/main/social/home.php +++ b/main/social/home.php @@ -103,9 +103,28 @@ $list = array( ); // information current user $socialRightContent .= '