예제 #1
0
파일: events.php 프로젝트: kimblemj/server
 public static function updateEvent($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM events WHERE event_id = '{$pack->event_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE events SET " . (isset($pack->event) ? "event      = '" . addslashes($pack->event) . "', " : "") . (isset($pack->qty) ? "qty        = '" . addslashes($pack->qty) . "', " : "") . (isset($pack->content_id) ? "content_id = '" . addslashes($pack->content_id) . "', " : "") . (isset($pack->script) ? "script     = '" . addslashes($pack->script) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE event_id = '{$pack->event_id}'");
     games::bumpGameVersion($pack);
     return events::getEvent($pack);
 }