Feature #306 - Trimming whitespace from the top level php files.

skala
Ivan Tcholakov 16 years ago
parent e197cb109e
commit 65d6998db5
  1. 144
      index.php
  2. 4
      newsList.php
  3. 64
      user_portal.php
  4. 18
      webchatdeny.php
  5. 78
      whoisonline.php
  6. 46
      whoisonlinesession.php

@ -1,5 +1,5 @@
<?php // $Id: index.php 22368 2009-07-24 23:25:57Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
@ -181,15 +181,15 @@ if (!api_get_user_id()) {
$home= 'home/';
if ($_configuration['multiple_access_urls']==true) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1){
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1){
$url_info = api_get_access_url($access_url_id);
// "http://" and the final "/" replaced
$url = substr($url_info['url'],7,strlen($url_info['url'])-8);
// "http://" and the final "/" replaced
$url = substr($url_info['url'],7,strlen($url_info['url'])-8);
$clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/','-',$clean_url);
$clean_url = $clean_url.'/';
$home_old = 'home/';
$home_old = 'home/';
$home= 'home/'.$clean_url;
}
}
@ -201,7 +201,7 @@ if (!empty ($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/',$_GET['in
include ('./'.$home.$_GET['include']);
$page_included = true;
} else {
if (!empty($_SESSION['user_language_choice'])) {
$user_selected_language=$_SESSION['user_language_choice'];
} elseif(!empty($_SESSION['_user']['language'])) {
@ -209,13 +209,13 @@ if (!empty ($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/',$_GET['in
} else {
$user_selected_language=api_get_setting('platformLanguage');
}
if(!file_exists($home.'home_news_'.$user_selected_language.'.html')) {
if (file_exists($home.'home_top.html'))
$home_top_temp=file($home.'home_top.html');
else {
$home_top_temp=file($home_old.'home_top.html');
}
}
$home_top_temp=implode('',$home_top_temp);
$open=str_replace('{rel_path}',api_get_path(REL_PATH),$home_top_temp);
echo $open;
@ -268,7 +268,7 @@ Display :: display_footer();
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*/
function logout()
function logout()
{
global $_configuration, $extAuthSource;
// variable initialisation
@ -288,19 +288,19 @@ function logout()
if (Database::num_rows($q_last_connection)>0) {
$i_id_last_connection=Database::result($q_last_connection,0,"login_id");
}
if (!isset($_SESSION['login_as'])) {
$current_date=date('Y-m-d H:i:s',time());
$s_sql_update_logout_date="UPDATE $tbl_track_login SET logout_date='".$current_date."' WHERE login_id='$i_id_last_connection'";
api_sql_query($s_sql_update_logout_date);
}
LoginDelete($uid, $_configuration['statistics_database']); //from inc/lib/online.inc.php - removes the "online" status
//the following code enables the use of an external logout function.
//example: define a $extAuthSource['ldap']['logout']="file.php" in configuration.php
// then a function called ldap_logout() inside that file
// (using *authent_name*_logout as the function name) and the following code
// will find and execute it
// then a function called ldap_logout() inside that file
// (using *authent_name*_logout as the function name) and the following code
// will find and execute it
$uinfo = api_get_user_info($uid);
if (($uinfo['auth_source'] != PLATFORM_AUTH_SOURCE) && is_array($extAuthSource)) {
if (is_array($extAuthSource[$uinfo['auth_source']])) {
@ -328,14 +328,14 @@ function logout()
*/
function category_has_open_courses($category) {
global $setting_show_also_closed_courses;
$user_identified = (api_get_user_id()>0 && !api_is_anonymous());
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $main_course_table WHERE category_code='$category'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
while ($course = Database::fetch_array($sql_result)) {
if ($setting_show_also_closed_courses == false) {
if ((api_get_user_id()>0
if ((api_get_user_id()>0
and $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)
or ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD)) {
return true; //at least one open course
@ -343,7 +343,7 @@ function category_has_open_courses($category) {
} else {
if(isset($course['visibility'])){
return true; //at least one course (does not matter weither it's open or not because $setting_show_also_closed_courses = true
}
}
}
}
return false;
@ -403,26 +403,26 @@ function display_anonymous_right_menu() {
$show_menu=false;
$show_create_link=false;
$show_course_link=false;
$show_course_link=false;
$display_add_course_link = api_is_allowed_to_create_course() && ($_SESSION["studentview"] != "studentenview");
if ($display_add_course_link) {
//display_create_course_link();
$show_menu=true;
$show_create_link=true;
$show_create_link=true;
}
if (api_is_platform_admin() || api_is_course_admin() || api_is_allowed_to_create_course()) {
$show_menu=true;
$show_course_link=true;
} else {
if (api_get_setting('allow_students_to_browse_courses')=='true') {
$show_course_link=true;
} else {
if (api_get_setting('allow_students_to_browse_courses')=='true') {
$show_menu=true;
$show_course_link=true;
}
$show_course_link=true;
}
}
if ($show_menu){
echo "<div class=\"menusection\">";
echo "<span class=\"menusectioncaption\">".get_lang("MenuUser")."</span>";
@ -430,11 +430,11 @@ function display_anonymous_right_menu() {
if ($show_create_link)
display_create_course_link();
if ($show_course_link)
display_edit_course_list_links();
display_edit_course_list_links();
echo "</ul>";
echo "</div>";
echo "</div>";
}
if (!empty($menu_navigation)) {
echo "<div class=\"menusection\">";
echo "<span class=\"menusectioncaption\">".get_lang("MainNavigation")."</span>";
@ -450,16 +450,16 @@ function display_anonymous_right_menu() {
echo '</div>';
}
}
// help section
/*** hide right menu "general" and other parts on anonymous right menu *****/
$user_selected_language = api_get_interface_language();
global $home, $home_old;
if (!isset ($user_selected_language))
{
$user_selected_language = $platformLanguage;
}
}
if (!file_exists($home.'home_menu_'.$user_selected_language.'.html') && file_exists($home.'home_menu.html') && file_get_contents($home.'home_menu.html')!='')
{
@ -475,22 +475,22 @@ function display_anonymous_right_menu() {
}
elseif(file_exists($home.'home_menu_'.$user_selected_language.'.html') && file_get_contents($home.'home_menu_'.$user_selected_language.'.html')!='')
{
{
echo "<div class=\"menusection\">", "<span class=\"menusectioncaption\">".get_lang("MenuGeneral")."</span>";
echo "<ul class=\"menulist\">";
include($home.'home_menu_'.$user_selected_language.'.html');
echo '</ul>';
echo '</div>';
}
}
if ($_user['user_id'] && api_number_of_plugins('campushomepage_menu') > 0) {
echo '<div class="note" style="background: none">';
api_plugin('campushomepage_menu');
echo '</div>';
}
// includes for any files to be displayed below anonymous right menu
if (!file_exists($home.'home_notice_'.$user_selected_language.'.html') && file_exists($home.'home_notice.html') && file_get_contents($home.'home_notice.html')!='') {
echo '<div class="note">';
if (file_exists($home.'home_notice.html'))
@ -501,9 +501,9 @@ function display_anonymous_right_menu() {
echo '</div>';
} elseif(file_exists($home.'home_notice_'.$user_selected_language.'.html') && file_get_contents($home.'home_notice_'.$user_selected_language.'.html')!='') {
echo '<div class="note">';
include($home.'home_notice_'.$user_selected_language.'.html');
include($home.'home_notice_'.$user_selected_language.'.html');
echo '</div>';
}
}
}
/**
@ -548,7 +548,7 @@ function handle_login_failed() {
* Adds a form to let users login
* @version 1.1
*/
function display_login_form()
function display_login_form()
{
$form = new FormValidator('formLogin');
$form->addElement('text','login',get_lang('UserName'),array('size'=>17));
@ -578,8 +578,8 @@ function display_lost_password_info() {
*/
function display_anonymous_course_list() {
$ctok = $_SESSION['sec_token'];
$stok = Security::get_token();
$stok = Security::get_token();
//init
$user_identified = (api_get_user_id()>0 && !api_is_anonymous());
$web_course_path = api_get_path(WEB_COURSE_PATH);
@ -596,19 +596,19 @@ function display_anonymous_course_list() {
$sql_get_course_list = "SELECT * FROM $main_course_table cours
WHERE category_code = '".Database::escape_string($_GET["category"])."'
ORDER BY title, UPPER(visual_code)";
//showing only the courses of the current access_url_id
//showing only the courses of the current access_url_id
global $_configuration;
if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
$tbl_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql_get_course_list="SELECT * FROM $main_course_table as course INNER JOIN $tbl_url_rel_course as url_rel_course
$tbl_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql_get_course_list="SELECT * FROM $main_course_table as course INNER JOIN $tbl_url_rel_course as url_rel_course
ON (url_rel_course.course_code=course.code)
WHERE access_url_id = $url_access_id AND category_code = '".Database::escape_string($_GET["category"])."' ORDER BY title, UPPER(visual_code)";
}
}
//removed: AND cours.visibility='".COURSE_VISIBILITY_OPEN_WORLD."'
$sql_result_courses = api_sql_query($sql_get_course_list, __FILE__, __LINE__);
@ -622,14 +622,14 @@ function display_anonymous_course_list() {
if ($setting_show_also_closed_courses) {
$platform_visible_courses = '';
} else {
$platform_visible_courses = " AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' OR t3.visibility='".COURSE_VISIBILITY_OPEN_PLATFORM."' )";
$platform_visible_courses = " AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' OR t3.visibility='".COURSE_VISIBILITY_OPEN_PLATFORM."' )";
}
} else {
if ($setting_show_also_closed_courses) {
$platform_visible_courses = '';
} else {
$platform_visible_courses = " AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' )";
}
$platform_visible_courses = " AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' )";
}
}
$sqlGetSubCatList = "
SELECT t1.name,t1.code,t1.parent_id,t1.children_count,COUNT(DISTINCT t3.code) AS nbCourse
@ -638,26 +638,26 @@ function display_anonymous_course_list() {
LEFT JOIN $main_course_table t3 ON (t3.category_code=t1.code $platform_visible_courses)
WHERE t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count ORDER BY t1.tree_pos, t1.name";
//showing only the category of courses of the current access_url_id
//showing only the category of courses of the current access_url_id
global $_configuration;
if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
$tbl_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$tbl_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sqlGetSubCatList = "
SELECT t1.name,t1.code,t1.parent_id,t1.children_count,COUNT(DISTINCT t3.code) AS nbCourse
FROM $main_category_table t1
LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
LEFT JOIN $main_course_table t3 ON (t3.category_code=t1.code $platform_visible_courses)
INNER JOIN $tbl_url_rel_course as url_rel_course
INNER JOIN $tbl_url_rel_course as url_rel_course
ON (url_rel_course.course_code=t3.code)
WHERE access_url_id = $url_access_id AND t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
WHERE access_url_id = $url_access_id AND t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count ORDER BY t1.tree_pos, t1.name";
}
}
$resCats = api_sql_query($sqlGetSubCatList, __FILE__, __LINE__);
$thereIsSubCat = false;
if (Database::num_rows($resCats) > 0) {
@ -724,16 +724,16 @@ function display_anonymous_course_list() {
$courses_list_string .= "<hr size=\"1\" noshade=\"noshade\">\n";
}
$courses_list_string .= "<h4 style=\"margin-top: 0px;\">".get_lang("CourseList")."</h4>\n"."<ul>\n";
if (api_get_user_id()) {
$courses_of_user = get_courses_of_user(api_get_user_id());
}
foreach ($course_list AS $course) {
// $setting_show_also_closed_courses
if ($setting_show_also_closed_courses==false) {
// if we do not show the closed courses
// if we do not show the closed courses
// we only show the courses that are open to the world (to everybody)
// and the courses that are open to the platform (if the current user is a registered user
if( ($user_identified && $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM) OR ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD)) {
@ -748,7 +748,7 @@ function display_anonymous_course_list() {
}
if (api_get_setting("display_teacher_in_courselist") == "true") {
$courses_list_string .= $course['tutor_name'];
}
}
if (api_get_setting('show_different_course_language') == 'true' && $course['course_language'] <> api_get_setting('platformLanguage')) {
$courses_list_string .= ' - '.$course['course_language'];
}
@ -762,21 +762,21 @@ function display_anonymous_course_list() {
// 3. the user is logged in and the user is subscribed to the course and the course visibility is not COURSE_VISIBILITY_CLOSED
// 4. the user is logged in and the user is course admin of te course (regardless of the course visibility setting)
// 5. the user is the platform admin api_is_platform_admin()
//
//
else {
$courses_shown++;
$courses_list_string .= "<li>\n";
if ( $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
OR ($user_identified AND $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)
OR ($user_identified AND key_exists($course['code'],$courses_of_user) AND $course['visibility'] <> COURSE_VISIBILITY_CLOSED)
OR ($user_identified AND $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)
OR ($user_identified AND key_exists($course['code'],$courses_of_user) AND $course['visibility'] <> COURSE_VISIBILITY_CLOSED)
OR $courses_of_user[$course['code']]['status'] == '1'
OR api_is_platform_admin()) {
$courses_list_string .= "<a href=\"".$web_course_path.$course['directory']."/\">";
}
$courses_list_string .= $course['title'];
if ( $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
OR ($user_identified AND $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)
OR ($user_identified AND key_exists($course['code'],$courses_of_user) AND $course['visibility'] <> COURSE_VISIBILITY_CLOSED)
OR ($user_identified AND $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)
OR ($user_identified AND key_exists($course['code'],$courses_of_user) AND $course['visibility'] <> COURSE_VISIBILITY_CLOSED)
OR $courses_of_user[$course['code']]['status'] == '1'
OR api_is_platform_admin()) {
$courses_list_string .="</a><br />";
@ -790,14 +790,14 @@ function display_anonymous_course_list() {
if (api_get_setting("display_teacher_in_courselist") == "true")
{
$courses_list_string .= $course['tutor_name'];
}
}
if (api_get_setting('show_different_course_language') == 'true' && $course['course_language'] <> api_get_setting('platformLanguage')) {
$courses_list_string .= ' - '.$course['course_language'];
}
if (api_get_setting('show_different_course_language') == 'true' && $course['course_language'] <> api_get_setting('platformLanguage')) {
$courses_list_string .= ' - '.$course['course_language'];
}
// We display a subscription link if
// We display a subscription link if
// 1. it is allowed to register for the course and if the course is not already in the courselist of the user and if the user is identiefied
// 2
if ($user_identified AND !key_exists($course['code'],$courses_of_user)) {

@ -5,7 +5,7 @@
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = array ('courses', 'index');
// including necessary files
@ -14,7 +14,7 @@ include_once (api_get_path(LIBRARY_PATH).'/system_announcements.lib.php');
$tool_name = get_lang("SystemAnnouncements");
Display::display_header($tool_name);
if(isset($_GET['start']))
{
$start = (int)$_GET['start'];

@ -1,5 +1,5 @@
<?php // $Id: user_portal.php 22375 2009-07-26 18:54:59Z herodoto $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -215,7 +215,7 @@ function get_personal_course_list($user_id) {
WHERE course.code = course_rel_user.course_code"."
AND course_rel_user.user_id = '".$user_id."'
ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC,i";
$course_list_sql_result = api_sql_query($personal_course_list_sql, __FILE__, __LINE__);
while ($result_row = Database::fetch_array($course_list_sql_result)) {
@ -389,7 +389,7 @@ function get_logged_user_course_html($my_course) {
$course_tool_table = Database :: get_course_table(TABLE_TOOL_LIST, $course_database);
$tool_edit_table = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course_database);
$course_group_user_table = Database :: get_course_table(TOOL_USER, $course_database);
$user_id = api_get_user_id();
$course_system_code = $my_course['k'];
$course_visual_code = $my_course['c'];
@ -401,23 +401,23 @@ function get_logged_user_course_html($my_course) {
$course_access_settings = CourseManager :: get_access_settings($course_system_code);
$course_id = isset($course_info['course_id'])?$course_info['course_id']:null;
$course_visibility = $course_access_settings['visibility'];
$user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_system_code);
//function logic - act on the data
$is_virtual_course = CourseManager :: is_virtual_course_from_system_code($my_course['k']);
if ($is_virtual_course) {
if ($is_virtual_course) {
// If the current user is also subscribed in the real course to which this
// virtual course is linked, we don't need to display the virtual course entry in
// the course list - it is combined with the real course entry.
$target_course_code = CourseManager :: get_target_of_linked_course($course_system_code);
$target_course_code = CourseManager :: get_target_of_linked_course($course_system_code);
$is_subscribed_in_target_course = CourseManager :: is_user_subscribed_in_course(api_get_user_id(), $target_course_code);
if ($is_subscribed_in_target_course) {
if ($is_subscribed_in_target_course) {
return; //do not display this course entry
}
}
$has_virtual_courses = CourseManager :: has_virtual_courses_from_code($course_system_code, api_get_user_id());
if ($has_virtual_courses) {
if ($has_virtual_courses) {
$return_result = CourseManager :: determine_course_title_from_course_info(api_get_user_id(), $course_info);
$course_display_title = $return_result['title'];
$course_display_code = $return_result['code'];
@ -474,10 +474,10 @@ function get_logged_user_course_html($my_course) {
$result .= ' ('.$course_teacher_email.')';
}
}
$current_course_settings = CourseManager :: get_access_settings($my_course['k']);
// display the what's new icons
$result .= show_notification($my_course);
@ -526,7 +526,7 @@ function get_logged_user_course_html($my_course) {
$session = '';
$active = false;
if (!empty($my_course['session_name'])) {
// Request for the name of the general coach
$sql = 'SELECT lastname, firstname
FROM '.$tbl_session.' ts
@ -537,7 +537,7 @@ function get_logged_user_course_html($my_course) {
$rs = api_sql_query($sql, __FILE__, __LINE__);
$sessioncoach = api_store_result($rs);
$sessioncoach = $sessioncoach[0];
$session = array();
$session['title'] = $my_course['session_name'];
if ( $my_course['date_start']=='0000-00-00' ) {
@ -597,14 +597,14 @@ function show_notification($my_course) {
AND ctt.visibility = '1'
AND tet.lastedit_user_id != $user_id
ORDER BY tet.lastedit_date";
$res = api_sql_query($sql);
//get the group_id's with user membership
$group_ids = GroupManager :: get_group_ids($course_database, $user_id);
$group_ids[] = 0; //add group 'everyone'
//filter all selected items
while ($res && ($item_property = Database::fetch_array($res))) {
if ((!isset ($lastTrackInCourseDate[$item_property['tool']])
if ((!isset ($lastTrackInCourseDate[$item_property['tool']])
|| $lastTrackInCourseDate[$item_property['tool']] < $item_property['lastedit_date'])
&& ((in_array($item_property['to_group_id'], $group_ids) && $item_property['tool'] != TOOL_DROPBOX)
|| $item_property['to_user_id'] == $user_id)
@ -769,7 +769,7 @@ if (!empty ($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/',$_GET['in
$thisAgenda = $maxCourse - $nbDigestEntries; // new max entries for agenda
if ($maxAgenda < $thisAgenda) {
$thisAgenda = $maxAgenda;
}
}
// collect from agenda, but only if tool is visible for the course
if ($result && $thisAgenda > 0 && Database::num_rows($result) > 0) {
$tableCal = $courseTablePrefix.$thisCourseDbName.$_configuration['db_glue']."calendar_event";
@ -914,22 +914,22 @@ $show_digest_link=false;
$display_add_course_link = api_is_allowed_to_create_course() && ($_SESSION["studentview"] != "studentenview");
if ($display_add_course_link) {
$show_menu=true;
$show_create_link=true;
$show_create_link=true;
}
if (api_is_platform_admin() || api_is_course_admin() || api_is_allowed_to_create_course()) {
$show_menu=true;
$show_course_link=true;
} else {
if (api_get_setting('allow_students_to_browse_courses')=='true') {
$show_course_link=true;
} else {
if (api_get_setting('allow_students_to_browse_courses')=='true') {
$show_menu=true;
$show_course_link=true;
}
$show_course_link=true;
}
}
if(isset($toolsList) and is_array($toolsList) and isset($digest)) {
$show_digest_link=true;
$show_menu=true;
$show_menu=true;
}
// My account section
@ -942,10 +942,10 @@ if ($show_menu){
if ($show_course_link)
display_edit_course_list_links();
if ($show_digest_link)
display_digest($toolsList, $digest, $orderKey, $courses);
display_digest($toolsList, $digest, $orderKey, $courses);
echo '</ul>';
echo '</div>';
}
}
// Main navigation section
// tabs that are deactivated are added here
@ -972,15 +972,15 @@ if (isset($_plugins['mycourses_menu']) && is_array($_plugins['mycourses_menu']))
echo '</div>';
}
if (api_get_setting('allow_reservation')=='true' && api_is_allowed_to_create_course() ){
//include_once('main/reservation/rsys.php');
if (api_get_setting('allow_reservation')=='true' && api_is_allowed_to_create_course() ){
//include_once('main/reservation/rsys.php');
echo '<div class="menusection">';
echo '<span class="menusectioncaption">'.get_lang('Booking').'</span>';
echo '<ul class="menulist">';
echo '<a href="main/reservation/reservation.php">'.get_lang('ManageReservations').'</a><br/>';
echo '<a href="main/reservation/reservation.php">'.get_lang('ManageReservations').'</a><br/>';
//echo '<a href="main/reservation/reservation.php">'.get_lang('ManageReservations').'</a><br/>';
/*require_once('main/reservation/rsys.php');
/*require_once('main/reservation/rsys.php');
if(api_is_platform_admin() || Rsys :: check_user_status() == 1) { // Only for admins & teachers...
echo '<a href="main/reservation/m_item.php">'.get_lang('ManageItems').'</a><br/>';
echo '<a href="main/reservation/m_reservation.php">'.get_lang('ManageReservationPeriods').'</a><br/>';

@ -2,16 +2,16 @@
/* For licensing terms, see /dokeos_license.txt */
/**
* @todo can't this be moved to a different file so that we can delete this file?
* @todo can't this be moved to a different file so that we can delete this file?
* Is this still in use? If not, then it should be removed or maybe offered as an extension
*/
/**
==============================================================================
==============================================================================
* Deletes the web-chat request form the user table
==============================================================================
==============================================================================
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = "index";
// including necessary files
@ -20,7 +20,7 @@ include_once('./main/inc/global.inc.php');
// table definitions
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
if (isset($_user['user_id']) && $_user['user_id']!='') {
$_user['user_id'] = intval($_user['user_id']);
$_user['user_id'] = intval($_user['user_id']);
$sql="update $track_user_table set chatcall_user_id = '', chatcall_date = '', chatcall_text='DENIED' where (user_id = ".$_user['user_id'].")";
$result=api_sql_query($sql,__FILE__,__LINE__);
}
@ -31,10 +31,10 @@ $message=get_lang("RequestDenied")."<br><br><a href='javascript:history.back()'>
Display::display_normal_message($message);
/*
==============================================================================
FOOTER
==============================================================================
*/
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
?>

@ -9,7 +9,7 @@
// name of the language file that needs to be included
$language_file = array('index','registration','messages','userInfo');
if (!isset($_GET['cidReq'])) {
$cidReset = true;
$cidReset = true;
}
// including necessary files
require_once './main/inc/global.inc.php';
@ -19,13 +19,13 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
// table definitions
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script type="text/javascript">
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
height = parseInt(height) + 20;
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
$htmlHeadXtra[] = '<script type="text/javascript" src="./main/inc/lib/javascript/jquery.js"></script>';
$htmlHeadXtra[] = '<script type="text/javascript" src="./main/inc/lib/javascript/thickbox.js"></script>';
@ -36,7 +36,7 @@ $(document).ready(function (){
if (confirm("'.get_lang('SendMessageInvitation', '').'")) {
$("#form_register_friend").submit();
}
});
});
});
function change_panel (mypanel_id,myuser_id) {
$.ajax({
@ -50,10 +50,10 @@ function change_panel (mypanel_id,myuser_id) {
$("div#id_content_panel_init").html(datos);
$("div#display_response_id").html("");
}
});
});
}
function action_database_panel(option_id,myuser_id) {
if (option_id==5) {
my_txt_subject=$("#txt_subject_id").val();
} else {
@ -75,8 +75,8 @@ function action_database_panel(option_id,myuser_id) {
success: function(datos) {
$("#display_response_id").html(datos);
}
});
}
});
}
function display_hide () {
setTimeout("hide_display_message()",3000);
}
@ -91,7 +91,7 @@ function hide_display_message () {
}catch(e) {
$("#txt_area_invite").val("");
}
}
}
</script>';
if ($_GET['chatid'] != '') {
//send out call request
@ -103,7 +103,7 @@ if ($_GET['chatid'] != '') {
$result=api_sql_query($sql,__FILE__,__LINE__);
//redirect caller to chat
header("Location: ".$_configuration['code_append']."chat/chat.php?".api_get_cidreq()."&origin=whoisonline&target=".Security::remove_XSS($chatid));
exit;
exit;
}
}
@ -121,21 +121,21 @@ function display_user_list($user_list, $_plugins)
if(strlen($_GET['cidReq']) > 0) {
$extra_params['cidReq'] = Security::remove_XSS($_GET['cidReq']);
$course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']);
}
}
foreach ($user_list as $user) {
$uid=$user[0];
$user_info = api_get_user_info($uid);
$table_row = array();
$url = '?id='.$uid.$course_url;
$image_array=UserManager::get_user_picture_path_by_id($uid,'system',false,true);
$friends_profile = UserFriend::get_picture_user($uid, $image_array['file'], 92, 'medium_', ' width="90" height="90" ');
//reduce image
$table_row[] = '<center><a href="'.$url.'"><img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' border="1"></a></center>';
$table_row[] = '<a href="'.$url.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>';
//$table_row[] = '<a href="'.$url.'">'.$user_info['lastName'].'</a>';
if (api_get_setting('show_email_addresses') == 'true') {
$table_row[] = Display::encrypted_mailto_link($user_info['mail']);
}
@ -148,7 +148,7 @@ function display_user_list($user_list, $_plugins)
<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
} else {
$table_row[] = '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
}
}
}
}
$table_data[] = $table_row;
@ -156,27 +156,27 @@ function display_user_list($user_list, $_plugins)
$table_header[] = array(get_lang('UserPicture'),false,'width="90"');
$table_header[] = array(get_lang('Name'),true);
//$table_header[] = array(get_lang('LastName'),true);
if (api_get_setting('show_email_addresses') == 'true') {
$table_header[] = array(get_lang('Email'),true);
}
$user_anonymous=api_get_anonymous_id();
if (api_get_setting('allow_social_tool')=='true' && api_get_user_id()<>$user_anonymous && api_get_user_id()<>0) {
$table_header[] = array(get_lang('Friends'),false,'width="200"');
}
}
/*this feature is deprecated
if ( api_get_setting('allow_message_tool')=='true' && isset($_SESSION['_user'])) {
$table_header[] = array(get_lang('SendMessage'),true);
}
*/
$sorting_options['column'] = (isset ($_GET['column']) ? (int)$_GET['column'] : 2);
/*if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true' ) {
/*if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true' ) {
//send_invitation_friend_user();
echo '<div align="right"><input type="button" name="id_btn_send_invitation" id="id_btn_send_invitation" value="'.get_lang('SendInviteMessage').'"/></div>';
echo '<div align="right"><input type="button" name="id_btn_send_invitation" id="id_btn_send_invitation" value="'.get_lang('SendInviteMessage').'"/></div>';
echo '<form action="whoisonline.php" name="form_register_friend" id="form_register_friend" method="post">';
}*/
Display::display_sortable_table($table_header,$table_data,$sorting_options,array('per_page_default'=>count($table_data)),$extra_params);
Display::display_sortable_table($table_header,$table_data,$sorting_options,array('per_page_default'=>count($table_data)),$extra_params);
/*if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true' ) {
echo '</form>';
}*/
@ -190,7 +190,7 @@ function display_individual_user($user_id)
{
global $interbreadcrumb;
$safe_user_id = Database::escape_string($user_id);
// to prevent a hacking attempt: http://www.dokeos.com/forum/viewtopic.php?t=5363
$user_table=Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE user_id='".$safe_user_id."'";
@ -207,7 +207,7 @@ function display_individual_user($user_id)
echo '</div><br/>';
echo '<div style="text-align: center">';
if (strlen(trim($user_object->picture_uri)) > 0) {
$sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id,'system');
$sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id,'system');
$sysdir = $sysdir_array['dir'];
$webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id,'web');
$webdir = $webdir_array['dir'];
@ -217,25 +217,25 @@ function display_individual_user($user_id)
$resizing = (($height > 200) ? 'height="200"' : '');
$height += 30;
$width += 30;
$window_name = 'window'.uniqid('');
// get the path,width and height from original picture
$window_name = 'window'.uniqid('');
// get the path,width and height from original picture
$big_image = $webdir.'big_'.$user_object->picture_uri;
$big_image_size = api_getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
$url_big_image = $big_image.'?rnd='.time();
echo '<input type="image" src="'.$fullurl.'" alt="'.$alt.'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/><br />';
global $user_anonymous;
if (api_get_setting('allow_social_tool')=='true' && api_get_user_id()<>$user_anonymous && api_get_user_id()<>0) {
if (api_get_setting('allow_social_tool')=='true' && api_get_user_id()<>$user_anonymous && api_get_user_id()<>0) {
echo '<br />';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$safe_user_id.'">'.get_lang('ViewSharedProfile').'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$safe_user_id.'">'.get_lang('ViewSharedProfile').'</a>';
echo '<br />';
}
} else {
}
} else {
echo Display::return_icon('unknown.jpg',get_lang('Unknown'));
echo '<br />';
}
if (api_get_setting("show_email_addresses") == "true")
{
echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'<br />';
@ -274,10 +274,10 @@ function display_individual_user($user_id)
* @todo use the correct api_get_path instead of $clarolineRepositoryWeb
*/
function display_productions($user_id)
{
{
$sysdir_array = UserManager::get_user_picture_path_by_id($user_id,'system');
$sysdir = $sysdir_array['dir'].$user_id.'/';
$webdir_array = UserManager::get_user_picture_path_by_id($user_id,'web');
$webdir_array = UserManager::get_user_picture_path_by_id($user_id,'web');
$webdir = $webdir_array['dir'].$user_id.'/';
if( !is_dir($sysdir)) {
mkpath($sysdir);
@ -304,7 +304,7 @@ function display_productions($user_id)
foreach($subs as $my => $sub) {
if(substr($sub,0,1) != '.' && is_file($sysdir.$file.'/'.$sub))
{
echo '<li><a href="'.$webdir.urlencode($file).'/'.urlencode($sub).'" target=_blank>'.$sub.'</a></li>';
echo '<li><a href="'.$webdir.urlencode($file).'/'.urlencode($sub).'" target=_blank>'.$sub.'</a></li>';
}
}
}
@ -367,10 +367,10 @@ else
$referer = empty($_GET['referer'])?'index.php':api_htmlentities(strip_tags($_GET['referer']),ENT_QUOTES,$charset);
if (isset($_GET['id'])) {
echo '<a href="whoisonline.php" class="fake_button_back">'.get_lang('Back').'</a>';
echo '<a href="whoisonline.php" class="fake_button_back">'.get_lang('Back').'</a>';
} else {
echo '<a href="'.$referer.'" class="fake_button_back">'.get_lang('BackHome').'</a>';
}
echo '<a href="'.$referer.'" class="fake_button_back">'.get_lang('BackHome').'</a>';
}
/*
==============================================================================

@ -3,10 +3,10 @@
/**
* @todo variables are sometimes in cammelcase, or even worse a mixture of CammelCase and udnerscoring: $a_userList
*
*
*/
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = array ('index', 'chat', 'tracking');
include_once("./main/inc/global.inc.php");
@ -50,34 +50,34 @@ Display::display_header(get_lang('UserOnlineListSession'));
$sessionIsCoach = array();
if (isset($_user['user_id']) && $_user['user_id']!='') {
$_user['user_id'] = intval($_user['user_id']);
$result = api_sql_query("SELECT DISTINCT id,
name,
date_start,
date_end
FROM $tbl_session as session
$result = api_sql_query("SELECT DISTINCT id,
name,
date_start,
date_end
FROM $tbl_session as session
INNER JOIN $tbl_session_course as session_rel_course
ON session_rel_course.id_coach = ".$_user['user_id']."
AND session.id = session_rel_course.id_session
ORDER BY date_start, date_end, name",__FILE__,__LINE__);
while ($session = Database:: fetch_array($result)) {
$sessionIsCoach[$session['id']] = $session;
}
$result = api_sql_query("SELECT DISTINCT id,
name,
date_start,
date_end
FROM $tbl_session as session
$result = api_sql_query("SELECT DISTINCT id,
name,
date_start,
date_end
FROM $tbl_session as session
WHERE session.id_coach = ".$_user['user_id']."
ORDER BY date_start, date_end, name",__FILE__,__LINE__);
while ($session = Database:: fetch_array($result)) {
$sessionIsCoach[$session['id']] = $session;
}
foreach($sessionIsCoach as $session) {
$sql = "SELECT DISTINCT last_access.access_user_id,
last_access.access_date,
$sql = "SELECT DISTINCT last_access.access_user_id,
last_access.access_date,
last_access.access_cours_code,
last_access.access_session_id,
".(api_is_western_name_order() ? "CONCAT(user.firstname,' ',user.lastname)" : "CONCAT(user.lastname,' ',user.firstname)")." as name,
@ -85,16 +85,16 @@ Display::display_header(get_lang('UserOnlineListSession'));
FROM ".Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS)." AS last_access
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user
ON user.user_id = last_access.access_user_id
WHERE access_session_id='".$session['id']."'
WHERE access_session_id='".$session['id']."'
AND NOW()-access_date<1000 GROUP BY access_user_id";
$result = api_sql_query($sql,__FILE__,__LINE__);
while($a_userList = mysql_fetch_array($result)) {
$a_onlineStudent[$a_userList['access_user_id']] = $a_userList;
}
}
if(count($a_onlineStudent)>0) {
foreach($a_onlineStudent as $onlineStudent) {
echo "<tr>
@ -115,7 +115,7 @@ Display::display_header(get_lang('UserOnlineListSession'));
else
{
echo get_lang('NoEmail');
}
}
echo " </td>
<td align='center'>
";

Loading…
Cancel
Save