changelog.html: degraded bugs to "to do"s
[iserv-mod-room-reservation.git] / includes / mod_roomReservationBookingsManager.inc
old mode 100755 (executable)
new mode 100644 (file)
index a7065ed..124068d
@@ -144,7 +144,12 @@ class mod_roomReservationBookingsManager {
       ($ob->getUid() == null and !$this->oCfg->userCanBook())) {
       throw new AccessException(MOD_ROOM_RESERVATION_ERROR_ACCESS_DENIED);
     }
       ($ob->getUid() == null and !$this->oCfg->userCanBook())) {
       throw new AccessException(MOD_ROOM_RESERVATION_ERROR_ACCESS_DENIED);
     }
-      
+    
+    // test if room is whitelisted
+    if(!$this->oCfg->isRoomWhitelisted($ob->getRoom())) {
+      throw new Exception(MOD_ROOM_RESERVATION_ERROR_ROOM_NOT_WHITELISTED);
+    }
+    
     $strWhere = null;
     $strLog = "";
 
     $strWhere = null;
     $strLog = "";
 
@@ -177,6 +182,7 @@ class mod_roomReservationBookingsManager {
     // Update or insert?
     if($ob->getUid() == null) {
       // No UID yet, insert new booking
     // Update or insert?
     if($ob->getUid() == null) {
       // No UID yet, insert new booking
+      // @todo write interval and user if interval > 0
       $strLog = sprintf("Raum „%s“ am %s von %s bis %s gebucht ".
        "(Begründung: %s)", $ob->getRoom(), date("d\.m\.Y", $ob->getDate()),
         gmdate("G:i", $oTsB[$ob->getTsFirst()]), gmdate("G:i",
       $strLog = sprintf("Raum „%s“ am %s von %s bis %s gebucht ".
        "(Begründung: %s)", $ob->getRoom(), date("d\.m\.Y", $ob->getDate()),
         gmdate("G:i", $oTsB[$ob->getTsFirst()]), gmdate("G:i",
@@ -204,10 +210,6 @@ class mod_roomReservationBookingsManager {
     
     $hQuery = db_query("SELECT currval('mod_roomreservation_bookings_rrb_uid_seq');");
     $nNewUid = pg_fetch_result($hQuery, 0, "currval");
     
     $hQuery = db_query("SELECT currval('mod_roomreservation_bookings_rrb_uid_seq');");
     $nNewUid = pg_fetch_result($hQuery, 0, "currval");
-    ##############
-    #FIXME remove this
-    echo "inserted new UID: $nNewUid<br />";
-    #####
     
     rrInsertLog($strLog);
     
     
     rrInsertLog($strLog);
     
This page took 0.025171 seconds and 4 git commands to generate.