| @@ 1588-1593 (lines=6) @@ | ||
| 1585 | ||
| 1586 | $result = Database::query($sql); |
|
| 1587 | $is_visible = false; |
|
| 1588 | if (Database::num_rows($result) > 0) { |
|
| 1589 | $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1590 | if ($row['visibility'] == 1) { |
|
| 1591 | $is_visible = api_is_allowed_in_course() || api_is_platform_admin(); |
|
| 1592 | } |
|
| 1593 | } |
|
| 1594 | ||
| 1595 | /* improved protection of documents viewable directly through the url: |
|
| 1596 | incorporates the same protections of the course at the url of |
|
| @@ 3685-3692 (lines=8) @@ | ||
| 3682 | access_session_id = '$session_id' |
|
| 3683 | ORDER BY access_date DESC limit 1"; |
|
| 3684 | $rs = Database::query($sql); |
|
| 3685 | if (Database::num_rows($rs) > 0) { |
|
| 3686 | $row = Database::fetch_array($rs); |
|
| 3687 | $date_time = api_convert_and_format_date( |
|
| 3688 | $row['access_date'], |
|
| 3689 | null, |
|
| 3690 | date_default_timezone_get() |
|
| 3691 | ); |
|
| 3692 | } |
|
| 3693 | return $date_time; |
|
| 3694 | } |
|
| 3695 | ||