diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php index d7c1b2f8b9ae10ebb3ea245ca98576f1c8fca260..548f86d52bc8bb60aed78a7149557944bc4e1628 100644 --- a/lib/models/resources/ResourceBooking.class.php +++ b/lib/models/resources/ResourceBooking.class.php @@ -445,13 +445,6 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen ); } - if ((!$this->booking_user_id) || !($this->booking_user instanceof User)) { - /*throw new InvalidArgumentException( - _('Die buchende Person wurde nicht gesetzt!') - );*/ - $this->booking_user = User::findCurrent(); - } - if ($this->begin >= $this->end) { throw new InvalidArgumentException( _('Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen!') @@ -471,6 +464,9 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen } } + // update the booking user + $this->booking_user = User::findCurrent(); + //Check if the user has booking rights on the resource. //The user must have either permanent permissions or they have to //have booking rights by a temporary permission in this moment