public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Check if a user can access the specified training course.
 *
 * @param integer $courseID The ID of the course to check.
 * @param integer $userID The ID of the user to check.
 *
 * @return boolean True if the user can access this course, false otherwise.
 */
Check if a user can access the specified training course.
@param integer $courseID The ID of the course to check.
@param integer $userID The ID of the user to check.

@return boolean True if the user can access this course, false otherwise.
Check if a user can access the specified training course . @param integer $courseID The ID of the course to check . @param integer $userID The ID of the user to check . @return boolean True if the user can access this course false otherwise .
function WPCW_courses_canUserAccessCourse( $courseID, $userID ) {
	global $wpcwdb, $wpdb;
	$wpdb->show_errors();
	$SQL = $wpdb->prepare( "
		SELECT *
		FROM $wpcwdb->user_courses
		WHERE user_id = %d AND course_id = %d
	", $userID, $courseID );
	return apply_filters( 'wpcw_courses_canuseraccesscourse', ( $wpdb->get_row( $SQL ) != false ), $courseID, $userID );
}
function WPCW_courses_canUserAccessCourse ( $ courseID , $ userID ) { global $ wpcwdb , $ wpdb ; $ wpdb -> show_errors ( ) ; $ SQL = $ wpdb -> prepare ( " 
		SELECT *
		FROM  $ wpcwdb -> user_courses 
		WHERE user_id = %d AND course_id = %d
	 " , $ userID , $ courseID ) ; return apply_filters ( 'wpcw_courses_canuseraccesscourse' , ( $ wpdb -> get_row ( $ SQL ) != false ) , $ courseID , $ userID ) ; }
Check if a user can access the specified training course.
Check if a user can access the specified training course .