Internal: API: Fix condition to check access for student - refs BT#21633

pull/5515/head
Angel Fernando Quiroz Campos 6 months ago
parent 41fa80b970
commit 398a1aef80
  1. 8
      src/CoreBundle/Entity/Session.php

@ -1245,12 +1245,12 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
{
$now = new DateTime('now');
if (!empty($start) && !empty($end) && ($now >= $start && $now <= $end)) {
return true;
if (!empty($start) && !empty($end)) {
return $now >= $start && $now <= $end;
}
if (!empty($start) && $now >= $start) {
return true;
if (!empty($start)) {
return $now >= $start;
}
return !empty($end) && $now <= $end;

Loading…
Cancel
Save