| @@ 2340-2351 (lines=12) @@ | ||
| 2337 | } |
|
| 2338 | ||
| 2339 | // If the end date was set. |
|
| 2340 | if (!empty($row['access_end_date'])) { |
|
| 2341 | // Only if date_start said that it was ok |
|
| 2342 | if ($visibility == SESSION_AVAILABLE) { |
|
| 2343 | if ($now < api_strtotime($row['access_end_date'], 'UTC')) { |
|
| 2344 | // Date still available |
|
| 2345 | $visibility = SESSION_AVAILABLE; |
|
| 2346 | } else { |
|
| 2347 | // Session ends |
|
| 2348 | $visibility = $row['visibility']; |
|
| 2349 | } |
|
| 2350 | } |
|
| 2351 | } |
|
| 2352 | } |
|
| 2353 | ||
| 2354 | /* If I'm a coach the visibility can change in my favor depending in |
|
| @@ 2360-2368 (lines=9) @@ | ||
| 2357 | ||
| 2358 | if ($is_coach) { |
|
| 2359 | // Test end date. |
|
| 2360 | if (!empty($row['coach_access_end_date'])) { |
|
| 2361 | $endDateCoach = api_strtotime($row['coach_access_end_date'], 'UTC'); |
|
| 2362 | ||
| 2363 | if ($endDateCoach >= $now) { |
|
| 2364 | $visibility = SESSION_AVAILABLE; |
|
| 2365 | } else { |
|
| 2366 | $visibility = SESSION_INVISIBLE; |
|
| 2367 | } |
|
| 2368 | } |
|
| 2369 | ||
| 2370 | // Test start date. |
|
| 2371 | if (!empty($row['coach_access_start_date'])) { |
|
| @@ 2371-2378 (lines=8) @@ | ||
| 2368 | } |
|
| 2369 | ||
| 2370 | // Test start date. |
|
| 2371 | if (!empty($row['coach_access_start_date'])) { |
|
| 2372 | $start = api_strtotime($row['coach_access_start_date'], 'UTC'); |
|
| 2373 | if ($start < $now) { |
|
| 2374 | $visibility = SESSION_AVAILABLE; |
|
| 2375 | } else { |
|
| 2376 | $visibility = SESSION_INVISIBLE; |
|
| 2377 | } |
|
| 2378 | } |
|
| 2379 | } |
|
| 2380 | } else { |
|
| 2381 | $visibility = SESSION_INVISIBLE; |
|