if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
if (api_get_setting("use_session_mode") == "true" && isset($_user['user_id']) && api_is_coach()) {
@ -110,7 +110,7 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR
} else {
$number_online_in_course = 0;
}
echo "<li>";
// Display the who's online of the platform
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
@ -148,7 +148,7 @@ if ( api_is_allowed_to_edit() ) {
</div>
<divclass="clear"> </div>
</div>
<divid="header3">
<?php
/*
@ -162,7 +162,7 @@ if ($_user['user_id']) {
$login = '('.get_lang('Anonymous').')';
} else {
$uinfo = api_get_user_info(api_get_user_id());
$login = '('.$uinfo['username'].')';
$login = '('.$uinfo['username'].')';
}
?>
<!-- start user section line with name, my course, my profile, scorm info, etc -->
@ -216,7 +216,7 @@ if ($_user['user_id'] && !api_is_anonymous()) {
@ -1072,9 +1072,9 @@ function update_Db_course($courseDbName)
PRIMARY KEY (id),
UNIQUE KEY UN_filename (filename)
)", __FILE__, __LINE__);
api_sql_query("ALTER TABLE `$TABLETOOLDROPBOXFILE` ADD INDEX ( `session_id` )", __FILE__, __LINE__);
api_sql_query("
CREATE TABLE `".$TABLETOOLDROPBOXPOST . "` (
file_id int unsigned NOT NULL,
@ -1085,7 +1085,7 @@ function update_Db_course($courseDbName)
session_id SMALLINT UNSIGNED NOT NULL,
PRIMARY KEY (file_id,dest_user_id)
)", __FILE__, __LINE__);
api_sql_query("ALTER TABLE `$TABLETOOLDROPBOXPOST` ADD INDEX ( `session_id` )", __FILE__, __LINE__);
api_sql_query("
@ -1139,10 +1139,10 @@ function update_Db_course($courseDbName)
"prevent_reinit tinyint unsigned not null default 1," . //stores the default behaviour regarding items re-initialisation when viewed a second time after success
"js_lib tinytext not null default ''," . //the JavaScript library to load for this lp
"debug tinyint unsigned not null default 0," . //stores the default behaviour regarding items re-initialisation when viewed a second time after success
"theme varchar(255) not null default '', " . //stores the theme of the LP
"theme varchar(255) not null default '', " . //stores the theme of the LP
"preview_image varchar(255) not null default '', " . //stores the theme of the LP
"author varchar(255) not null default '', " . //stores the theme of the LP
"session_id int unsigned not null default 0 " . //the session_id
"session_id int unsigned not null default 0 " . //the session_id
")";
if(!api_sql_query($sql, __FILE__, __LINE__))
{
@ -1170,7 +1170,7 @@ function update_Db_course($courseDbName)
{
error_log($sql,0);
}
$sql = "CREATE TABLE IF NOT EXISTS `$TABLELPITEM` (" .
"id int unsigned primary key auto_increment," . //unique ID from MySQL
"lp_id int unsigned not null," . //lp_id from 'lp'
@ -1254,7 +1254,7 @@ function update_Db_course($courseDbName)
{
error_log($sql,0);
}
$sql = "CREATE TABLE IF NOT EXISTS `$TABLELPIVOBJECTIVE`(" .
* @todo Add option to unsubscribe class-members from the courses where the
* class was subscibed to
*/
@ -102,7 +102,7 @@ class ClassManager
/**
* Get all users from a class
* @param int $class_id
* @return array
* @return array
*/
function get_users($class_id)
{
@ -165,7 +165,7 @@ class ClassManager
/**
* Get all courses in which a class is subscribed
* @param int $class_id
* @return array
* @return array
*/
function get_courses($class_id)
{
@ -200,7 +200,7 @@ class ClassManager
}
}
/**
* Unsubscribe a class from a course.
* Unsubscribe a class from a course.
* Only students are unsubscribed. If a user is member of 2 classes which
* are both subscribed to the course, the user stays in the course.
* @param int $class_id The class id
@ -227,11 +227,11 @@ class ClassManager
$sql = "DELETE FROM $tbl_course_class WHERE course_code = '".mysql_real_escape_string($course_code)."' AND class_id = '".mysql_real_escape_string($class_id)."'";
error_log(__FILE__.' '.__LINE__.': Error renaming '.$base_work_dir.$path.' to '.$base_work_dir.$new_path.'. This is probably due to file permissions',0);
$sql = 'DELETE FROM '.$table_template.' WHERE course_code="'.$course_code.'" AND user_id="'.$user_id.'" AND ref_doc="'.$document_id.'"';
api_sql_query($sql);
}
/**
* return true if the documentpath have visibility=1 as item_property
@ -1048,7 +1048,7 @@ class DocumentManager {
//note the extra / at the end of doc_path to match every path in the
// document table that is part of the document path
$doc_path = Database::escape_string($doc_path);
$sql = "SELECT path FROM $docTable d, $propTable ip " .
"where d.id=ip.ref AND ip.tool='".TOOL_DOCUMENT."' AND d.filetype='file' AND visibility=0 AND ".
"locate(concat(path,'/'),'".$doc_path."/')=1";
@ -1058,10 +1058,10 @@ class DocumentManager {
//echo "$row[0] not visible";
return false;
}
//improved protection of documents viewable directly through the url: incorporates the same protections of the course at the url of documents: access allowed for the whole world Open, access allowed for users registered on the platform Private access, document accessible only to course members (see the Users list), Completely closed; the document is only accessible to the course admin and teaching assistants.
if ($_SESSION ['is_allowed_in_course'] || api_is_platform_admin())
@ -1081,7 +1081,7 @@ function clean_up_path(&$path)
/**
* Check if the file is dangerous, based on extension and/or mimetype.
* The list of extensions accepted/rejected can be found from
* The list of extensions accepted/rejected can be found from
* api_get_setting('upload_extensions_exclude') and api_get_setting('upload_extensions_include')
* @param string filename passed by reference. The filename will be modified if filter rules say so! (you can include path but the filename should look like 'abc.html')
* @return int 0 to skip file, 1 to keep file
@ -1193,7 +1193,7 @@ function get_document_id() moved to document.lib.php
* @return boolean true /false
*/
function update_existing_document($_course,$document_id,$filesize,$readonly=0)
$sql = 'SELECT COUNT(*) AS number_of_groups FROM '.$table_group_user.' gu, '.$table_group.' g WHERE gu.user_id = \''.$user_id.'\' AND g.id = gu.group_id AND g.category_id= \''.$cat_id.'\'';
* @author isaac flores paz <florespaz@bidsoftperu.com>
@ -206,21 +206,21 @@ class UserFriend extends UserManager {
if ($row_exist['count']==0) {
$sql='INSERT INTO '.$tbl_message.'(user_sender_id,user_receiver_id,msg_status,send_date,title,content) VALUES('.((int)$user_id).','.((int)$friend_id).','.((int)$status_invitation).',"'.$current_date.'","'.$message_title.'","'.$message_content.'")';
Database::query($sql,__FILE__,__LINE__);
return true;
return true;
} elseif ($row_exist['count']==1) {
$sql_if_exist='SELECT COUNT(*) AS count FROM '.$tbl_message.' WHERE user_sender_id='.((int)$user_id).' AND user_receiver_id='.((int)$friend_id).' AND msg_status=7';
$sql='UPDATE '.$tbl_message.' SET msg_status='.$msg_status.' WHERE user_sender_id='.((int)$user_send_id).' AND user_receiver_id='.((int)$user_receiver_id).';';
Database::query($sql,__FILE__,__LINE__);
Database::query($sql,__FILE__,__LINE__);
}
/**
* allow attach to group
@ -291,7 +291,7 @@ class UserFriend extends UserManager {
$sql='UPDATE '.$tbl_user_friend.' SET relation_type='.((int)$type_qualify).' WHERE user_id='.((int)$user_id).' AND friend_user_id='.((int)$id_friend_qualify).';';
Database::query($sql,__FILE__,__LINE__);
Database::query($sql,__FILE__,__LINE__);
}
/**
* Send invitation a your friends
@ -305,11 +305,11 @@ class UserFriend extends UserManager {
function create_group($survey_id,$group_title,$introduction,$table_group)
{
{
$sql_query = "SELECT * FROM $table_group WHERE groupname='".Database::escape_string($group_title)."' AND survey_id=".Database::escape_string($survey_id);
* Sort 2-dimensional table. It is possile of change the columns that will be show and the way that the columns are sorted.
* @param array $data The data to be sorted.
* @param int $column The column on which the data should be sorted (default = 0)
* @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
* @param array $column_show The columns that we will show in the table i.e: $column_show=array('1','0','1') we will show the 1st and the 3th column.
* @param array $column_show The columns that we will show in the table i.e: $column_show=array('1','0','1') we will show the 1st and the 3th column.
* @param array $column_order Changes how the columns will be sorted ie. $column_order=array('1','4','3','4') The 2nd column will be sorted like the 4 column
* @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,SORT_STRING,SORT_DATE,SORT_IMAGE) *
* @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,SORT_STRING,SORT_DATE,SORT_IMAGE) *
$sql= "SELECT user_id FROM $table_url_rel_user WHERE access_url_id = ".Database::escape_string($url_id)." AND user_id = ".Database::escape_string($user_id)." ";
$sql= "SELECT course_code FROM $table_url_rel_course WHERE access_url_id = ".Database::escape_string($url_id)." AND course_code = '".Database::escape_string($course_id)."'";
$sql= "SELECT session_id FROM $table_url_rel_session WHERE access_url_id = ".Database::escape_string($url_id)." AND session_id = ".Database::escape_string($session_id);
$sql= "DELETE FROM $table_url_rel_course WHERE course_code = '".Database::escape_string($course_code)."' AND access_url_id=".Database::escape_string($url_id)." ";
$sql= "DELETE FROM $table_url_rel_session WHERE session_id = ".Database::escape_string($session_id)." AND access_url_id=".Database::escape_string($url_id)." ";
@ -377,13 +377,13 @@ if (api_get_setting('allow_terms_conditions')=='true') {
//huh... nothing to do... we shouldn't get here
error_log('Dokeos Authentication file '. $extAuthSource[$uData['auth_source']]['login']. ' could not be found - this might prevent your system from doing the corresponding authentication process',0);