[svn r12581] Check if we are course coach in the function is_user_subscribed_in_course()

skala
Julian Prud'homme 18 years ago
parent be03c9c7e4
commit 54a26db709
  1. 9
      main/inc/lib/course.lib.php

@ -892,6 +892,15 @@ class CourseManager
{
return true;
}
else{
$sql = 'SELECT 1 FROM '.Database :: get_main_table(TABLE_MAIN_SESSION_COURSE).'
WHERE id_coach = '.$user_id.' AND course_code="'.$course_code.'"';
$rs = api_sql_query($sql, __FILE__, __LINE__);
if(mysql_num_rows($rs)>0)
{
return true;
}
}
}
else
return false; //user is not registered in course

Loading…
Cancel
Save