diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php
index b252e0b829..83a79f951e 100755
--- a/main/inc/lib/userportal.lib.php
+++ b/main/inc/lib/userportal.lib.php
@@ -166,8 +166,10 @@ class IndexManager
echo self::return_notice();
}
- function return_teacher_link() {
+ function return_teacher_link()
+ {
$html = '';
+ $show_menu = false;
if (!empty($this->user_id)) {
// tabs that are deactivated are added here
@@ -803,16 +805,37 @@ class IndexManager
return $html;
}
- function return_user_image_block() {
- $img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
- $img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
- $profile_content = null;
- if (api_get_setting('allow_social_tool') == 'true') {
- $profile_content .='
';
- } else {
- $profile_content .='
';
+ /**
+ * @return null|string
+ */
+ public function return_user_image_block()
+ {
+ $html = null;
+ if (!api_is_anonymous()) {
+ $img_array = UserManager::get_user_picture_path_by_id(
+ api_get_user_id(),
+ 'web', true, true
+ );
+ $img_array = UserManager::get_picture_user(
+ api_get_user_id(),
+ $img_array['file'],
+ 50,
+ USER_IMAGE_SIZE_MEDIUM,
+ ' width="90" height="90" '
+ );
+ $profile_content = null;
+ if (api_get_setting('allow_social_tool') == 'true') {
+ $profile_content .= '
';
+ } else {
+ $profile_content .= '
';
+ }
+ $html = self::show_right_block(
+ null,
+ $profile_content,
+ 'user_image_block',
+ array('style' => 'text-align:center;')
+ );
}
- $html = self::show_right_block(null, $profile_content, 'user_image_block', array('style' => 'text-align:center;'));
return $html;
}