| @@ 866-896 (lines=31) @@ | ||
| 863 | $allowed_time = 0; |
|
| 864 | $allowedEndTime = true; |
|
| 865 | ||
| 866 | if (!empty($date_session_start)) { |
|
| 867 | if ($is_coach_course) { |
|
| 868 | $allowed_time = api_strtotime($coachAccessStartDate); |
|
| 869 | } else { |
|
| 870 | $allowed_time = api_strtotime($date_session_start); |
|
| 871 | } |
|
| 872 | ||
| 873 | if (!isset($_GET['history'])) { |
|
| 874 | if (!empty($date_session_end)) { |
|
| 875 | if ($is_coach_course) { |
|
| 876 | // if coach end date is empty we use the default end date |
|
| 877 | if (empty($coachAccessEndDate)) { |
|
| 878 | $endSessionToTms = api_strtotime($date_session_end); |
|
| 879 | if ($session_now > $endSessionToTms) { |
|
| 880 | $allowedEndTime = false; |
|
| 881 | } |
|
| 882 | } else { |
|
| 883 | $endSessionToTms = api_strtotime($coachAccessEndDate); |
|
| 884 | if ($session_now > $endSessionToTms) { |
|
| 885 | $allowedEndTime = false; |
|
| 886 | } |
|
| 887 | } |
|
| 888 | } else { |
|
| 889 | $endSessionToTms = api_strtotime($date_session_end); |
|
| 890 | if ($session_now > $endSessionToTms) { |
|
| 891 | $allowedEndTime = false; |
|
| 892 | } |
|
| 893 | } |
|
| 894 | } |
|
| 895 | } |
|
| 896 | } |
|
| 897 | ||
| 898 | if ($session_now >= $allowed_time && $allowedEndTime) { |
|
| 899 | // Read only and accessible. |
|
| @@ 1000-1030 (lines=31) @@ | ||
| 997 | $allowed_time = 0; |
|
| 998 | $allowedEndTime = true; |
|
| 999 | ||
| 1000 | if (!empty($date_session_start)) { |
|
| 1001 | if ($is_coach_course) { |
|
| 1002 | $allowed_time = api_strtotime($coachAccessStartDate); |
|
| 1003 | } else { |
|
| 1004 | $allowed_time = api_strtotime($date_session_start); |
|
| 1005 | } |
|
| 1006 | ||
| 1007 | if (!isset($_GET['history'])) { |
|
| 1008 | if (!empty($date_session_end)) { |
|
| 1009 | if ($is_coach_course) { |
|
| 1010 | // if coach end date is empty we use the default end date |
|
| 1011 | if (empty($coachAccessEndDate)) { |
|
| 1012 | $endSessionToTms = api_strtotime($date_session_end); |
|
| 1013 | if ($session_now > $endSessionToTms) { |
|
| 1014 | $allowedEndTime = false; |
|
| 1015 | } |
|
| 1016 | } else { |
|
| 1017 | $endSessionToTms = api_strtotime($coachAccessEndDate); |
|
| 1018 | if ($session_now > $endSessionToTms) { |
|
| 1019 | $allowedEndTime = false; |
|
| 1020 | } |
|
| 1021 | } |
|
| 1022 | } else { |
|
| 1023 | $endSessionToTms = api_strtotime($date_session_end); |
|
| 1024 | if ($session_now > $endSessionToTms) { |
|
| 1025 | $allowedEndTime = false; |
|
| 1026 | } |
|
| 1027 | } |
|
| 1028 | } |
|
| 1029 | } |
|
| 1030 | } |
|
| 1031 | ||
| 1032 | if ($session_now >= $allowed_time && $allowedEndTime) { |
|
| 1033 | if (api_get_setting('hide_courses_in_sessions') === 'false') { |
|