@ -39,33 +39,41 @@ switch ($action) {
$user_info = api_get_user_info($_REQUEST['user_id']);
$isAnonymous = api_is_anonymous();
if ($isAnonymous & & $courseId) {
if ('false' === api_get_setting('course_catalog_published')) {
break;
}
$coursesNotInCatalog = CoursesAndSessionsCatalog::getCoursesToAvoid();
if (in_array($courseId, $coursesNotInCatalog)) {
break;
}
}
echo '< div class = "row" > ';
echo '< div class = "col-sm-5" > ';
echo '< div class = "thumbnail" > ';
echo '< img src = "'.$user_info['avatar'].'" / > ';
echo Display::img($user_info['avatar'], $user_info['complete_name']) ;
echo '< / div > ';
echo '< / div > ';
echo '< div class = "col-sm-7" > ';
if ('false' == api_get_setting('show_email_addresses')) {
if ($isAnonymous || api_get_setting('show_email_addresses') == 'false' ) {
$user_info['mail'] = ' ';
} else {
$user_info['mail'] = ' '.$user_info['mail'].' ';
}
if ($isAnonymous) {
$user_info['mail'] = ' ';
}
$userData = '< h3 > '.$user_info['complete_name'].'< / h3 > '
.PHP_EOL
.$user_info['mail']
.PHP_EOL
.$user_info['official_code'];
$userData = '< h3 > '.$user_info['complete_name'].'< / h3 > '.$user_info['mail'].$user_info['official_code'];
if ($isAnonymous) {
// Only allow anonymous users to see user popup if the popup user
// is a teacher (which might be necessary to illustrate a course)
if (COURSEMANAGER === $user_info['status'] ) {
if ((int) $user_info['status'] === COURSEMANAGER ) {
echo $userData;
} else {
echo '< h3 > -< / h3 > ';
}
} else {
echo Display::url(
@ -76,7 +84,15 @@ switch ($action) {
echo '< / div > ';
echo '< / div > ';
$url = api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=send_message&user_id='.$user_info['user_id'].'&course_id='.$courseId.'&session_id='.$sessionId;
$url = api_get_path(WEB_AJAX_PATH).'message.ajax.php?'
.http_build_query(
[
'a' => 'send_message',
'user_id' => $user_info['user_id'],
'course_id' => $courseId,
'session_id' => $sessionId,
]
);
if (false === $isAnonymous & &
'true' == api_get_setting('allow_message_tool')