|
|
|
@ -15,7 +15,7 @@ if (!isset($_GET['cidReq'])) { |
|
|
|
|
// including necessary files |
|
|
|
|
require_once './main/inc/global.inc.php'; |
|
|
|
|
|
|
|
|
|
if(isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0 ) { |
|
|
|
|
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0 ) { |
|
|
|
|
api_protect_course_script(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -95,47 +95,47 @@ $(document).ready(function() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($_GET['chatid'] != '') { |
|
|
|
|
//send out call request |
|
|
|
|
$time = time(); |
|
|
|
|
$time = date("Y-m-d H:i:s", $time); |
|
|
|
|
$chatid = intval($_GET['chatid']); |
|
|
|
|
if ($_GET['chatid'] == strval(intval($_GET['chatid']))) { |
|
|
|
|
$sql = "update $track_user_table set chatcall_user_id = '".Database::escape_string($_user['user_id'])."', chatcall_date = '".Database::escape_string($time)."', chatcall_text = '' where (user_id = ".(int)Database::escape_string($chatid).")"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
//redirect caller to chat |
|
|
|
|
header("Location: ".api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&origin=whoisonline&target=".Security::remove_XSS($chatid)); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
//send out call request |
|
|
|
|
$time = time(); |
|
|
|
|
$time = date("Y-m-d H:i:s", $time); |
|
|
|
|
$chatid = intval($_GET['chatid']); |
|
|
|
|
if ($_GET['chatid'] == strval(intval($_GET['chatid']))) { |
|
|
|
|
$sql = "update $track_user_table set chatcall_user_id = '".Database::escape_string($_user['user_id'])."', chatcall_date = '".Database::escape_string($time)."', chatcall_text = '' where (user_id = ".(int)Database::escape_string($chatid).")"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
//redirect caller to chat |
|
|
|
|
header("Location: ".api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&origin=whoisonline&target=".Security::remove_XSS($chatid)); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// This if statement prevents users accessing the who's online feature when it has been disabled. |
|
|
|
|
if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) || ((api_get_setting('showonline', 'users') == 'true' || api_get_setting('showonline', 'course') == 'true') && $_user['user_id'])) { |
|
|
|
|
|
|
|
|
|
if(isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0 ) { |
|
|
|
|
$user_list = who_is_online_in_this_course(0, 9, api_get_user_id(), api_get_setting('time_limit_whosonline'), $_GET['cidReq']); |
|
|
|
|
} else { |
|
|
|
|
$user_list = who_is_online(0, 9); |
|
|
|
|
} |
|
|
|
|
if (!isset($_GET['id'])) { |
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
|
if (!api_is_anonymous()) { |
|
|
|
|
//this include the social menu div |
|
|
|
|
$social_left_content = SocialManager::show_social_menu('whoisonline'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0 ) { |
|
|
|
|
$user_list = who_is_online_in_this_course(0, 9, api_get_user_id(), api_get_setting('time_limit_whosonline'), $_GET['cidReq']); |
|
|
|
|
} else { |
|
|
|
|
$user_list = who_is_online(0, 9); |
|
|
|
|
} |
|
|
|
|
if (!isset($_GET['id'])) { |
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
|
if (!api_is_anonymous()) { |
|
|
|
|
//this include the social menu div |
|
|
|
|
$social_left_content = SocialManager::show_social_menu('whoisonline'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($user_list) { |
|
|
|
|
if (!isset($_GET['id'])) { |
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
|
if (!api_is_anonymous()) { |
|
|
|
|
$query = isset($_GET['q']) ? $_GET['q']: null; |
|
|
|
|
$social_right_content .= '<div class="span9">'.UserManager::get_search_form($query).'</div>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$social_right_content .= SocialManager::display_user_list($user_list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($user_list) { |
|
|
|
|
if (!isset($_GET['id'])) { |
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
|
if (!api_is_anonymous()) { |
|
|
|
|
$query = isset($_GET['q']) ? $_GET['q']: null; |
|
|
|
|
$social_right_content .= '<div class="span9">'.UserManager::get_search_form($query).'</div>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$social_right_content .= SocialManager::display_user_list($user_list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($_GET['id'])) { |
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
@ -146,7 +146,7 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) || |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
api_not_allowed(); |
|
|
|
|
api_not_allowed(); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|