| @@ 3754-3761 (lines=8) @@ | ||
| 3751 | access_session_id = '$session_id' |
|
| 3752 | ORDER BY access_date DESC limit 1"; |
|
| 3753 | $rs = Database::query($sql); |
|
| 3754 | if (Database::num_rows($rs) > 0) { |
|
| 3755 | $row = Database::fetch_array($rs); |
|
| 3756 | $date_time = api_convert_and_format_date( |
|
| 3757 | $row['access_date'], |
|
| 3758 | null, |
|
| 3759 | date_default_timezone_get() |
|
| 3760 | ); |
|
| 3761 | } |
|
| 3762 | return $date_time; |
|
| 3763 | } |
|
| 3764 | ||
| @@ 962-967 (lines=6) @@ | ||
| 959 | $sql = 'SELECT name FROM '.$tbl_session . ' |
|
| 960 | WHERE id="'.intval($_GET['id_session']) . '"'; |
|
| 961 | $rs = Database::query($sql); |
|
| 962 | if (Database::num_rows($rs)) { |
|
| 963 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
|
| 964 | $_SESSION['id_session'] = intval($_GET['id_session']); |
|
| 965 | } else { |
|
| 966 | api_not_allowed(true); |
|
| 967 | } |
|
| 968 | ||
| 969 | } else { |
|
| 970 | Session::erase('session_name'); |
|
| @@ 1049-1054 (lines=6) @@ | ||
| 1046 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
| 1047 | $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"'; |
|
| 1048 | $rs = Database::query($sql); |
|
| 1049 | if (Database::num_rows($rs)) { |
|
| 1050 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
|
| 1051 | $_SESSION['id_session'] = intval($_GET['id_session']); |
|
| 1052 | } else { |
|
| 1053 | api_not_allowed(true); |
|
| 1054 | } |
|
| 1055 | } |
|
| 1056 | ||
| 1057 | if (!empty($_REQUEST['gidReq'])) { |
|
| @@ 1637-1642 (lines=6) @@ | ||
| 1634 | ||
| 1635 | $result = Database::query($sql); |
|
| 1636 | $is_visible = false; |
|
| 1637 | if (Database::num_rows($result) > 0) { |
|
| 1638 | $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1639 | if ($row['visibility'] == 1) { |
|
| 1640 | $is_visible = api_is_allowed_in_course() || api_is_platform_admin(); |
|
| 1641 | } |
|
| 1642 | } |
|
| 1643 | ||
| 1644 | /* improved protection of documents viewable directly through the url: |
|
| 1645 | incorporates the same protections of the course at the url of |
|