if($group_properties['doc_state']==2) //documents are private
{
if($is_allowed_to_edit || GroupManager :: is_user_in_group($_uid,$_SESSION['_gid'])) //only courseadmin or group members (members + tutors) allowed
if($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'],$_SESSION['_gid'])) //only courseadmin or group members (members + tutors) allowed
// Check if the user has sent or received the file.
$sql="SELECT * FROM `".$dropbox_cnf["personTbl"]."` WHERE file_id='".mysql_real_escape_string($_GET['id'])."' AND user_id='".mysql_real_escape_string($_uid)."'";
$sql="SELECT * FROM `".$dropbox_cnf["personTbl"]."` WHERE file_id='".mysql_real_escape_string($_GET['id'])."' AND user_id='".mysql_real_escape_string($_user['user_id'])."'";
@ -202,7 +202,7 @@ function display_move_form($part, $id, $target=array())
*/
function store_move($id, $target, $part)
{
global $_uid;
global $_user;
global $dropbox_cnf;
if ((isset($id) AND $id<>'') AND (isset($target) AND $target<>'') AND (isset($part) AND $part<>''))
@ -210,7 +210,7 @@ function store_move($id, $target, $part)
if ($part=='received')
{
$sql="UPDATE `".$dropbox_cnf["postTbl"]."` SET cat_id='".mysql_real_escape_string($target)."'
WHERE dest_user_id='".mysql_real_escape_string($_uid)."'
WHERE dest_user_id='".mysql_real_escape_string($_user['user_id'])."'
AND file_id='".mysql_real_escape_string($id)."'
";
api_sql_query($sql,__FILE__,__LINE__);
@ -219,7 +219,7 @@ function store_move($id, $target, $part)
if ($part=='sent')
{
$sql="UPDATE `".$dropbox_cnf["fileTbl"]."` SET cat_id='".mysql_real_escape_string($target)."'
WHERE uploader_id='".mysql_real_escape_string($_uid)."'
WHERE uploader_id='".mysql_real_escape_string($_user['user_id'])."'
AND id='".mysql_real_escape_string($id)."'
";
api_sql_query($sql,__FILE__,__LINE__);
@ -302,14 +302,14 @@ function display_file_checkbox($id, $part)
*/
function get_dropbox_categories($filter='')
{
global $_uid;
global $_user;
global $dropbox_cnf;
echo '<h1>'.$filter.'</h1>';
$return_array=array();
$sql="SELECT * FROM `".$dropbox_cnf['tbl_category']."` WHERE user_id='".$_uid."'";
$sql="SELECT * FROM `".$dropbox_cnf['tbl_category']."` WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($sql);
while ($row=mysql_fetch_array($result))
@ -339,7 +339,7 @@ function get_dropbox_categories($filter='')
*/
function store_addcategory()
{
global $_uid;
global $_user;
global $dropbox_cnf;
// check if the target is valid
@ -367,7 +367,7 @@ function store_addcategory()
if (!$_POST['edit_id'])
{
// step 3a, we check if the category doesn't already exist
$sql="SELECT * FROM `".$dropbox_cnf['tbl_category']."` WHERE user_id='".$_uid."' AND cat_name='".mysql_real_escape_string($_POST['category_name'])."' AND received='".$received."' AND sent='".$sent."'";
$sql="SELECT * FROM `".$dropbox_cnf['tbl_category']."` WHERE user_id='".$_user['user_id']."' AND cat_name='".mysql_real_escape_string($_POST['category_name'])."' AND received='".$received."' AND sent='".$sent."'";
$result=api_sql_query($sql);
@ -375,7 +375,7 @@ function store_addcategory()
if (mysql_num_rows($result)==0)
{
$sql="INSERT INTO `".$dropbox_cnf['tbl_category']."` (cat_name, received, sent, user_id)
@ -309,7 +309,7 @@ if (!$_GET['view'] OR $_GET['view']=='received' OR $dropbox_cnf['sent_received_t
// object initialisation
$dropbox_person = new Dropbox_Person( $_uid, $is_courseAdmin, $is_courseTutor); // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
$dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
// constructing the array that contains the total number of feedback messages per document.
$number_feedback=get_total_number_feedback();
@ -456,7 +456,7 @@ if ($_GET['view']=='sent' OR $dropbox_cnf['sent_received_tabs']==false)