query($sql_q); $file_d = $file_q->fetch_assoc(); if ($file_q->num_rows > 0) { $file_loc = REPOBS.str_ireplace('/', DS, $file_d['file_dir']).DS.$file_d['file_name']; if (file_exists($file_loc)) { if ($file_d['access_limit']) { if (utility::isMemberLogin()) { $allowed_mem_types = @unserialize($file_d['access_limit']); if (!in_array($_SESSION['m_member_type_id'], $allowed_mem_types)) { # Access to file restricted # Member logged in but doesnt have privilege to download header("location:index.php"); exit(); } else { # Access to file restricted # Member logged in but doesnt have privilege to download header("location:index.php"); exit(); } } } if ($file_d['mime_type'] == 'application/pdf') { $swf = basename($file_loc); $swf = sha1($swf); $swf = $swf.'.swf'; ?>