'.get_lang('ThisFieldIsRequired'), 'required');
- if ($current_forum['allow_anonymous']==1 AND !isset($_uid))
+ if ($current_forum['allow_anonymous']==1 AND !isset($_user['user_id']))
{
$form->addRule('poster_name', '
'.get_lang('ThisFieldIsRequired'), 'required');
}
@@ -1709,7 +1708,7 @@ function store_reply($values)
{
global $table_threads;
global $table_posts;
- global $_uid;
+ global $_user;
global $_course;
global $current_forum;
@@ -1729,7 +1728,7 @@ function store_reply($values)
'".mysql_real_escape_string($values['post_text'])."',
'".mysql_real_escape_string($values['thread_id'])."',
'".mysql_real_escape_string($values['forum_id'])."',
- '".mysql_real_escape_string($_uid)."',
+ '".mysql_real_escape_string($_user['user_id'])."',
'".mysql_real_escape_string($post_date)."',
'".mysql_real_escape_string($values['post_notification'])."',
'".mysql_real_escape_string($values['post_parent_id'])."',
@@ -1745,7 +1744,7 @@ function store_reply($values)
update_thread($values['thread_id'], $new_post_id,$post_date);
// update the forum
- api_item_property_update($_course, TOOL_FORUM, $values['forum_id'],"NewMessageInForum", $_uid);
+ api_item_property_update($_course, TOOL_FORUM, $values['forum_id'],"NewMessageInForum", $_user['user_id']);
$message=get_lang('ReplyAdded').'
';
if ($current_forum['approval_direct_post']=='1' AND !api_is_allowed_to_edit())
@@ -1987,7 +1986,7 @@ function forum_not_allowed_here()
*/
function get_whats_new()
{
- global $_uid;
+ global $_user;
global $_course;
global $table_posts;
@@ -2001,7 +2000,7 @@ function get_whats_new()
if (!$_SESSION['last_forum_access'])
{
$tracking_last_tool_access=Database::get_statistic_table(STATISTIC_TRACK_E_LASTACCESS_TABLE);
- $sql="SELECT * FROM ".$tracking_last_tool_access." WHERE access_user_id='".mysql_real_escape_string($_uid)."' AND access_cours_code='".mysql_real_escape_string($_course['sysCode'])."' AND access_tool='".mysql_real_escape_string($tool)."'";
+ $sql="SELECT * FROM ".$tracking_last_tool_access." WHERE access_user_id='".mysql_real_escape_string($_user['user_id'])."' AND access_cours_code='".mysql_real_escape_string($_course['sysCode'])."' AND access_tool='".mysql_real_escape_string($tool)."'";
$result=api_sql_query($sql,__FILE__,__LINE__);
$row=mysql_fetch_array($result);
$_SESSION['last_forum_access']=$row['access_date'];
@@ -2316,7 +2315,7 @@ function handle_mail_cue($content, $id)
function send_mail($user_info=array(), $thread_information=array())
{
global $_course;
- global $_uid;
+ global $_user;
$email_subject = get_lang('NewForumPost')." - ".$_course['official_code'];
@@ -2336,7 +2335,7 @@ function send_mail($user_info=array(), $thread_information=array())
if(empty($charset)){$charset='ISO-8859-1';}
$encoding = 'Content-Type: text/html; charset='. $charset;
- if ($user_info['user_id']<>$_uid)
+ if ($user_info['user_id']<>$_user['user_id'])
{
$newmail = api_mail($user_info["lastname"].' '.$user_info["firstname"], $user_info["email"], $email_subject, $email_body, $_SESSION['_user']['lastName'].' '.$_SESSION['_user']['firstName'], $_SESSION['_user']['mail'],$encoding);
}
diff --git a/main/forum/index.php b/main/forum/index.php
index df99912eb6..d6b9b87f7a 100644
--- a/main/forum/index.php
+++ b/main/forum/index.php
@@ -138,7 +138,7 @@ $forum_list=get_forums();
*/
// the groups of the user
$groups_of_user=array();
-$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_uid);
+$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_user['user_id']);
// all groups in the course (and sorting them as the id of the group = the key of the array
$all_groups=GroupManager::get_group_list();
if(is_array($all_groups))
diff --git a/main/forum/newthread.php b/main/forum/newthread.php
index 6a0164c677..934d3237a4 100644
--- a/main/forum/newthread.php
+++ b/main/forum/newthread.php
@@ -151,7 +151,7 @@ if (!api_is_allowed_to_edit() AND $current_forum['allow_new_threads']<>1)
forum_not_allowed_here();
}
// 4. anonymous posts are not allowed and the user is not logged in
-if (!$_uid AND $current_forum['allow_anonymous']<>1)
+if (!$_user['user_id'] AND $current_forum['allow_anonymous']<>1)
{
forum_not_allowed_here();
}
diff --git a/main/forum/reply.php b/main/forum/reply.php
index a09dac26ec..fc4aec3ba4 100644
--- a/main/forum/reply.php
+++ b/main/forum/reply.php
@@ -148,7 +148,7 @@ if (!api_is_allowed_to_edit() AND ($current_forum_category['locked']<>0 OR $curr
{
forum_not_allowed_here();
}
-if (!$_uid AND $current_forum['allow_anonymous']==0)
+if (!$_user['user_id'] AND $current_forum['allow_anonymous']==0)
{
forum_not_allowed_here();
}
diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php
index 8a69b6c629..a13c76a14e 100644
--- a/main/forum/viewforum.php
+++ b/main/forum/viewforum.php
@@ -168,7 +168,7 @@ if (isset($message))
// 1. the course admin is here
// 2. the course member is here and new threads are allowed
// 3. a visitor is here and new threads AND allowed AND anonymous posts are allowed
-if (api_is_allowed_to_edit() OR ($current_forum['allow_new_threads']==1 AND isset($_uid)) OR ($current_forum['allow_new_threads']==1 AND !isset($_uid) AND $current_forum['allow_anonymous']==1))
+if (api_is_allowed_to_edit() OR ($current_forum['allow_new_threads']==1 AND isset($_user['user_id'])) OR ($current_forum['allow_new_threads']==1 AND !isset($_user['user_id']) AND $current_forum['allow_anonymous']==1))
{
echo '
'.get_lang('NewTopic').'';
}
diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php
index d6f1972a82..1e048f9623 100644
--- a/main/forum/viewforumcategory.php
+++ b/main/forum/viewforumcategory.php
@@ -146,7 +146,7 @@ $forum_list=get_forums();
------------------------------------------------------------------------------------------------------
*/
$groups_of_user=array();
-$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_uid);
+$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_user['user_id']);
//my_print_r($groups_of_user);
diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php
index 4f66cf7f8b..0f096cc5ea 100644
--- a/main/forum/viewthread.php
+++ b/main/forum/viewthread.php
@@ -179,7 +179,7 @@ if ($message<>'PostDeletedSpecial') // in this case the first and only post of t
if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit())
{
// The link should only appear when the user is logged in or when anonymous posts are allowed.
- if ($_uid OR ($current_forum['allow_anonymous']==1 AND !$_uid))
+ if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id']))
{
echo '
'.get_lang('ReplyToThread').'';
}
diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php
index 8f17b24cf9..12a43c2eef 100644
--- a/main/forum/viewthread_flat.inc.php
+++ b/main/forum/viewthread_flat.inc.php
@@ -88,7 +88,7 @@ foreach ($rows as $row)
echo $row['post_date'].'
';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
- if (($current_forum['allow_edit']==1 AND $row['user_id']==$_uid) or api_is_allowed_to_edit())
+ if (($current_forum['allow_edit']==1 AND $row['user_id']==$_user['user_id']) or api_is_allowed_to_edit())
{
echo "
".icon('../img/edit.gif',get_lang('Edit'))."\n";
}
@@ -103,7 +103,7 @@ foreach ($rows as $row)
//if (($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0) OR api_is_allowed_to_edit())
if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit())
{
- if ($_uid OR ($current_forum['allow_anonymous']==1 AND !$_uid))
+ if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id']))
{
echo '
'.get_lang('ReplyToMessage').'';
echo '
'.get_lang('QuoteMessage').'';
@@ -134,7 +134,7 @@ foreach ($rows as $row)
{
$post_image=icon('../img/forumpost.gif');
}
- if ($row['post_notification']=='1' AND $row['poster_id']==$_uid)
+ if ($row['post_notification']=='1' AND $row['poster_id']==$_user['user_id'])
{
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
}
diff --git a/main/forum/viewthread_nested.inc.php b/main/forum/viewthread_nested.inc.php
index 5dadc54a6f..ec3885993f 100644
--- a/main/forum/viewthread_nested.inc.php
+++ b/main/forum/viewthread_nested.inc.php
@@ -93,7 +93,7 @@ foreach ($rows as $post)
echo $post['post_date'].'
';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
- if (($current_forum['allow_edit']==1 AND $post['user_id']==$_uid) or api_is_allowed_to_edit())
+ if (($current_forum['allow_edit']==1 AND $post['user_id']==$_user['user_id']) or api_is_allowed_to_edit())
{
echo "
".icon('../img/edit.gif',get_lang('Edit'))."\n";
}
@@ -108,7 +108,7 @@ foreach ($rows as $post)
//if (($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0) OR api_is_allowed_to_edit())
if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit())
{
- if ($_uid OR ($current_forum['allow_anonymous']==1 AND !$_uid))
+ if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id']))
{
echo '
'.get_lang('ReplyToMessage').'';
echo '
'.get_lang('QuoteMessage').'';
@@ -139,7 +139,7 @@ foreach ($rows as $post)
{
$post_image=icon('../img/forumpost.gif');
}
- if ($post['post_notification']=='1' AND $post['poster_id']==$_uid)
+ if ($post['post_notification']=='1' AND $post['poster_id']==$_user['user_id'])
{
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
}
diff --git a/main/forum/viewthread_threaded.inc.php b/main/forum/viewthread_threaded.inc.php
index f93be7550c..2b91f6cb3f 100644
--- a/main/forum/viewthread_threaded.inc.php
+++ b/main/forum/viewthread_threaded.inc.php
@@ -104,7 +104,7 @@ echo display_user_link($rows[$display_post_id]['user_id'], $name).'
';
echo $rows[$display_post_id]['post_date'].'
';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
-if (($current_forum['allow_edit']==1 AND $rows[$display_post_id]['user_id']==$_uid) or api_is_allowed_to_edit())
+if (($current_forum['allow_edit']==1 AND $rows[$display_post_id]['user_id']==$_user['user_id']) or api_is_allowed_to_edit())
{
echo "
".icon('../img/edit.gif',get_lang('Edit'))."\n";
}
@@ -119,7 +119,7 @@ echo '
';
//if (($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0) OR api_is_allowed_to_edit())
if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit())
{
- if ($_uid OR ($current_forum['allow_anonymous']==1 AND !$_uid))
+ if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id']))
{
echo '
'.get_lang('ReplyToMessage').'';
echo '
'.get_lang('QuoteMessage').'';
@@ -150,7 +150,7 @@ else
{
$post_image=icon('../img/forumpost.gif');
}
-if ($rows[$display_post_id]['post_notification']=='1' AND $rows[$display_post_id]['poster_id']==$_uid)
+if ($rows[$display_post_id]['post_notification']=='1' AND $rows[$display_post_id]['poster_id']==$_user['user_id'])
{
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified'));
}
diff --git a/main/group/group.php b/main/group/group.php
index afb0dae88e..452a806524 100644
--- a/main/group/group.php
+++ b/main/group/group.php
@@ -252,7 +252,7 @@ foreach ($group_cats as $index => $category)
{
$totalRegistered = 0;
// Determine wether current user is tutor for this course
- $user_is_tutor = GroupManager :: is_tutor($_uid);
+ $user_is_tutor = GroupManager :: is_tutor($_user['user_id']);
$group_data = array ();
foreach ($group_list as $index => $this_group)
{
@@ -268,7 +268,7 @@ foreach ($group_cats as $index => $category)
}
// group name
- if (api_is_allowed_to_edit() || in_array($_uid,$tutorsids_of_group) || $this_group['is_member'] || GroupManager::user_has_access($_uid,$this_group['id'],GROUP_TOOL_FORUM) || GroupManager::user_has_access($_uid,$this_group['id'],GROUP_TOOL_DOCUMENTS))
+ if (api_is_allowed_to_edit() || in_array($_user['user_id'],$tutorsids_of_group) || $this_group['is_member'] || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_FORUM) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_DOCUMENTS))
{
$group_name = '
'.$this_group['name'].'';
if ($_SESSION['_uid'] && $_SESSION['_uid'] == $this_group['id_tutor'])
@@ -288,11 +288,11 @@ foreach ($group_cats as $index => $category)
// self-registration / unregistration
if (!api_is_allowed_to_edit())
{
- if (GroupManager :: is_self_registration_allowed($_uid, $this_group['id']))
+ if (GroupManager :: is_self_registration_allowed($_user['user_id'], $this_group['id']))
{
$row[] = '
'.get_lang("GroupSelfRegInf").'';
}
- elseif (GroupManager :: is_self_unregistration_allowed($_uid, $this_group['id']))
+ elseif (GroupManager :: is_self_unregistration_allowed($_user['user_id'], $this_group['id']))
{
$row[] = '
'.get_lang("GroupSelfUnRegInf").'';
}
diff --git a/main/group/group_space.php b/main/group/group_space.php
index 960cdb0163..fc35ffd75e 100644
--- a/main/group/group_space.php
+++ b/main/group/group_space.php
@@ -91,7 +91,7 @@ if ($_GET['selfUnReg'] && GroupManager :: is_self_unregistration_allowed($_SESSI
/*
* Edit the group
*/
-if (api_is_allowed_to_edit() or GroupManager :: is_tutor($_uid))
+if (api_is_allowed_to_edit() or GroupManager :: is_tutor($_user['user_id']))
{
echo "
".get_lang("EditGroup")."";
}
diff --git a/main/inc/lib/events.lib.inc.php b/main/inc/lib/events.lib.inc.php
index 5df4306af7..6ae8d2533a 100644
--- a/main/inc/lib/events.lib.inc.php
+++ b/main/inc/lib/events.lib.inc.php
@@ -111,7 +111,7 @@ function event_login()
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $TABLETRACK_LOGIN;
$reallyNow = time();
$sql = "INSERT INTO `".$TABLETRACK_LOGIN."`
@@ -121,7 +121,7 @@ function event_login()
`login_date`)
VALUES
- ('".$_uid."',
+ ('".$_user['user_id']."',
'".$_SERVER['REMOTE_ADDR']."',
FROM_UNIXTIME(".$reallyNow."))";
$res = api_sql_query($sql,__FILE__,__LINE__);
@@ -140,7 +140,7 @@ function event_access_course()
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_ACCESS;
global $TABLETRACK_LASTACCESS; //for "what's new" notification
@@ -155,9 +155,9 @@ function event_access_course()
}
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
@@ -211,7 +211,7 @@ function event_access_tool($tool, $id_session=0)
global $is_trackingEnabled;
// if tracking is disabled record nothing
// if( ! $is_trackingEnabled ) return 0; //commented because "what's new" notification must always occur
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_ACCESS;
global $rootWeb;
@@ -228,7 +228,7 @@ function event_access_tool($tool, $id_session=0)
}
$reallyNow = time();
- $user_id = $_uid ? "'".$_uid."'" : "NULL"; // "NULL" is anonymous
+ $user_id = $_user['user_id'] ? "'".$_user['user_id']."'" : "NULL"; // "NULL" is anonymous
// record information
// only if user comes from the course $_cid
//if( eregi($rootWeb.$_cid,$_SERVER['HTTP_REFERER'] ) )
@@ -288,13 +288,13 @@ function event_download($doc_url)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_DOWNLOADS;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
@@ -333,13 +333,13 @@ function event_upload($doc_id)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_UPLOADS;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
@@ -377,13 +377,13 @@ function event_link($link_id)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_LINKS;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
@@ -422,14 +422,14 @@ function event_exercice($exo_id, $score, $weighting)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_EXERCICES;
global $origin, $learnpath_id, $learnpath_item_id;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
@@ -482,14 +482,14 @@ function event_subscription($cours_id, $action)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $TABLETRACK_SUBSCRIPTIONS;
$sql = "INSERT INTO `$TABLETRACK_SUBSCRIPTIONS`
(`sub_user_id`,
`sub_cours_id`,
`sub_action`)
VALUES
- ('".$_uid."',
+ ('".$_user['user_id']."',
'".$cours_id."',
'".$action."')";
$res = api_sql_query($sql,__FILE__,__LINE__);
@@ -511,19 +511,19 @@ function event_default($type_event, $values)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_DEFAULT;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
$user_id = "NULL";
}
- if ($_uid)
+ if ($_user['user_id'])
{
$cours_id = "'".$_cid."'";
}
@@ -555,14 +555,14 @@ function exercise_attempt($score,$answer,$quesId,$exeId,$j)
// if tracking is disabled record nothing
if (!$is_trackingEnabled)
return 0;
- global $_uid;
+ global $_user;
global $_cid;
global $TABLETRACK_ATTEMPT;
global $origin, $learnpath_id, $learnpath_item_id;
$reallyNow = time();
- if ($_uid)
+ if ($_user['user_id'])
{
- $user_id = "'".$_uid."'";
+ $user_id = "'".$_user['user_id']."'";
}
else // anonymous
{
diff --git a/main/inc/lib/fckeditor/editor/plugins/Attachment/fck_Attachment.php b/main/inc/lib/fckeditor/editor/plugins/Attachment/fck_Attachment.php
index 1957fceff5..ec73b8e60d 100644
--- a/main/inc/lib/fckeditor/editor/plugins/Attachment/fck_Attachment.php
+++ b/main/inc/lib/fckeditor/editor/plugins/Attachment/fck_Attachment.php
@@ -23,7 +23,7 @@ if(isset($_SESSION['_gid']) && $_SESSION['_gid']!='') //if the group id is set,
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
$noPHP_SELF=true;
- if($is_allowed_to_edit || GroupManager::is_user_in_group($_uid,$_SESSION['_gid'])) //only courseadmin or group members allowed
+ if($is_allowed_to_edit || GroupManager::is_user_in_group($_user['user_id'],$_SESSION['_gid'])) //only courseadmin or group members allowed
{
$to_group_id = $_SESSION['_gid'];
$req_gid = '&gidReq='.$_SESSION['_gid'];
@@ -72,7 +72,7 @@ if($_POST['fileupload']=="Attach File"){
if($upload_ok)
{
//file got on the server without problems, now process it
- $new_path = handle_uploaded_document($_course, $_FILES['uploadedfile'],$base_work_dir,$path,$_uid,$to_group_id,$to_user_id,$max_filled_space,0,'overwrite');
+ $new_path = handle_uploaded_document($_course, $_FILES['uploadedfile'],$base_work_dir,$path,$_user['user_id'],$to_group_id,$to_user_id,$max_filled_space,0,'overwrite');
$new_comment = isset($_POST['comment']) ? trim($_POST['comment']) : '';
$new_title = isset($_POST['title']) ? trim($_POST['title']) : '';
diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php
index 9996ae0c65..9fcab65741 100644
--- a/main/inc/lib/fileUpload.lib.php
+++ b/main/inc/lib/fileUpload.lib.php
@@ -889,7 +889,7 @@ function unzip_uploaded_file($uploadedFile, $uploadPath, $baseWorkDir, $maxFille
function unzip_uploaded_document($uploaded_file, $upload_path, $base_work_dir, $max_filled_space, $output = true)
{
global $_course;
- global $_uid;
+ global $_user;
global $to_user_id;
global $to_group_id;
@@ -966,7 +966,7 @@ function unzip_uploaded_document($uploaded_file, $upload_path, $base_work_dir, $
$folder_id = add_document($_course,$upload_path.dirname($cleaned_up_filename),'folder',0,basename(dirname($cleaned_up_filename)));
if($folder_id)
{
- api_item_property_update($_course,TOOL_DOCUMENT,$folder_id,'FolderAdded',$_uid,$to_group_id,$to_user_id);
+ api_item_property_update($_course,TOOL_DOCUMENT,$folder_id,'FolderAdded',$_user['user_id'],$to_group_id,$to_user_id);
//echo('folder '.$upload_path.dirname($cleaned_up_filename)." added
\n");
}
}
@@ -988,7 +988,7 @@ function unzip_uploaded_document($uploaded_file, $upload_path, $base_work_dir, $
{
$lastedit_type = ($filetype=='folder')?'FolderAdded':'DocumentAdded';
//update item property for document
- api_item_property_update($_course,TOOL_DOCUMENT,$document_id,$lastedit_type,$_uid,$to_group_id,$to_user_id);
+ api_item_property_update($_course,TOOL_DOCUMENT,$document_id,$lastedit_type,$_user['user_id'],$to_group_id,$to_user_id);
}
}
//file/dir exists -> update
@@ -996,14 +996,14 @@ function unzip_uploaded_document($uploaded_file, $upload_path, $base_work_dir, $
{
$lastedit_type = ($filetype=='folder')?'FolderUpdated':'DocumentUpdated';
//update the document in item_property
- api_item_property_update($_course,TOOL_DOCUMENT,$document_id,$lastedit_type,$_uid,$to_group_id,$to_user_id);
+ api_item_property_update($_course,TOOL_DOCUMENT,$document_id,$lastedit_type,$_user['user_id'],$to_group_id,$to_user_id);
}
}
}
//print_r_pre($zip_content_array);
//if the file is in a folder, we need to update all parent folders
- item_property_update_on_folder($_course,$upload_path,$_uid);
+ item_property_update_on_folder($_course,$upload_path,$_user['user_id']);
//display success message to user
chdir($save_dir); //return to previous dir position
if($output){
@@ -1757,7 +1757,7 @@ function build_missing_files_form($missing_files,$upload_path,$file_name)
* @param string $base_work_dir
* @param string $current_path, needed for recursivity
*/
-function add_all_documents_in_folder_to_database($_course,$_uid,$base_work_dir,$current_path='')
+function add_all_documents_in_folder_to_database($_course,$user_id,$base_work_dir,$current_path='')
{
$path = $base_work_dir.$current_path;
@@ -1779,12 +1779,12 @@ $handle=opendir($path);
if(!DocumentManager::get_document_id($_course, $current_path.'/'.$safe_file))
{
$document_id=add_document($_course,$current_path.'/'.$safe_file,'folder',0,$title);
- api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$_uid);
+ api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$user_id);
//echo $current_path.'/'.$safe_file." added!
";
}
//recursive
- add_all_documents_in_folder_to_database($_course,$_uid,$base_work_dir,$current_path.'/'.$safe_file);
+ add_all_documents_in_folder_to_database($_course,$user_id,$base_work_dir,$current_path.'/'.$safe_file);
}
//file!
else
@@ -1797,7 +1797,7 @@ $handle=opendir($path);
$title=get_document_title($file);
$size = filesize($base_work_dir.$current_path.'/'.$safe_file);
$document_id = add_document($_course,$current_path.'/'.$safe_file,'file',$size,$title);
- api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$_uid);
+ api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$user_id);
//echo $current_path.'/'.$safe_file." added!
";
}
}
diff --git a/main/inc/lib/groupmanager.lib.php b/main/inc/lib/groupmanager.lib.php
index a778a9f500..10162921ee 100644
--- a/main/inc/lib/groupmanager.lib.php
+++ b/main/inc/lib/groupmanager.lib.php
@@ -93,7 +93,7 @@ class GroupManager
*/
function get_group_list($category = null, $course_code = null)
{
- global $_uid;
+ global $_user;
$course_db = '';
if ($course_code != null)
{
@@ -116,7 +116,7 @@ class GroupManager
COUNT(ug2.id) number_of_members
FROM ".$table_group." `g`
LEFT JOIN ".$table_group_user." `ug`
- ON `ug`.`group_id` = `g`.`id` AND `ug`.`user_id` = '".$_uid."'
+ ON `ug`.`group_id` = `g`.`id` AND `ug`.`user_id` = '".$_user['user_id']."'
LEFT JOIN ".$table_group_user." `ug2`
ON `ug2`.`group_id` = `g`.`id`";
if ($category != null)
@@ -144,7 +144,7 @@ class GroupManager
*/
function create_group($name, $category_id, $tutor, $places)
{
- global $_course,$_uid;
+ global $_course,$_user;
$currentCourseRepository = $_course['path'];
$coursesRepositorySys = api_get_path(SYS_COURSE_PATH);
$table_group = Database :: get_course_table(GROUP_TABLE);
@@ -165,7 +165,7 @@ class GroupManager
FileManager :: mkdirs($coursesRepositorySys.$currentCourseRepository."/group/".$secret_directory, 0777);
*/
$desired_dir_name= '/'.replace_dangerous_char($name,'strict').'_groupdocs';
- $dir_name = create_unexisting_directory($_course,$_uid,$lastId,NULL,$coursesRepositorySys.$currentCourseRepository.'/document',$desired_dir_name);
+ $dir_name = create_unexisting_directory($_course,$_user['user_id'],$lastId,NULL,$coursesRepositorySys.$currentCourseRepository.'/document',$desired_dir_name);
/* Stores the directory path into the group table */
$sql = "UPDATE ".$table_group." SET name = '".mysql_real_escape_string($name)."', secret_directory = '".$dir_name."' WHERE id ='".$lastId."'";
api_sql_query($sql,__FILE__,__LINE__);
@@ -821,7 +821,7 @@ class GroupManager
global $_course;
$course_code = $_course['sysCode'];
$category = GroupManager :: get_category_from_group($group_id);
- $result = CourseManager :: is_user_subscribed_in_real_or_linked_course($_uid, $course_code);
+ $result = CourseManager :: is_user_subscribed_in_real_or_linked_course($user_id, $course_code);
$result = !GroupManager :: is_subscribed($user_id, $group_id);
$result &= (GroupManager :: number_of_students($group_id) < GroupManager :: maximum_number_of_students($group_id));
if ($category['groups_per_user'] == GROUP_PER_MEMBER_NO_LIMIT)
@@ -1141,14 +1141,14 @@ class GroupManager
*/
function get_complete_list_of_users_that_can_be_added_to_group($course_code, $group_id)
{
- global $_course, $_uid;
+ global $_course, $_user;
$category = GroupManager :: get_category_from_group($group_id, $course_code);
$number_of_groups_limit = $category['groups_per_user'] == GROUP_PER_MEMBER_NO_LIMIT ? INFINITE : $category['groups_per_user'];
$real_course_code = $_course['sysCode'];
$real_course_info = Database :: get_course_info($real_course_code);
$real_course_user_list = CourseManager :: get_user_list_from_course_code($virtual_course_code);
//get list of all virtual courses
- $user_subscribed_course_list = CourseManager :: get_list_of_virtual_courses_for_specific_user_and_real_course($_uid, $real_course_code);
+ $user_subscribed_course_list = CourseManager :: get_list_of_virtual_courses_for_specific_user_and_real_course($_user['user_id'], $real_course_code);
//add real course to the list
$user_subscribed_course_list[] = $real_course_info;
if (!is_array($user_subscribed_course_list))
diff --git a/main/inc/lib/javascript/email_links.lib.js.php b/main/inc/lib/javascript/email_links.lib.js.php
index 01f881e8cf..f82a28575b 100644
--- a/main/inc/lib/javascript/email_links.lib.js.php
+++ b/main/inc/lib/javascript/email_links.lib.js.php
@@ -9,7 +9,7 @@
* If the user is not logged in, don't define anything, so the normal
* handling of mailto link can proceed
*/
-if(!empty($_uid) AND string_2_boolean(api_get_setting('allow_email_editor'))){
+if(!empty($_user['user_id']) AND string_2_boolean(api_get_setting('allow_email_editor'))){
?>