Exemplo n.º 1
0
 public static function updateTab($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM tabs WHERE tab_id = '{$pack->tab_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE tabs SET " . (isset($pack->type) ? "type                        = '" . addslashes($pack->type) . "', " : "") . (isset($pack->name) ? "name                        = '" . addslashes($pack->name) . "', " : "") . (isset($pack->icon_media_id) ? "icon_media_id               = '" . addslashes($pack->icon_media_id) . "', " : "") . (isset($pack->content_id) ? "content_id                  = '" . addslashes($pack->content_id) . "', " : "") . (isset($pack->info) ? "info                        = '" . addslashes($pack->info) . "', " : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id = '" . addslashes($pack->requirement_root_package_id) . "', " : "") . (isset($pack->sort_index) ? "sort_index                  = '" . addslashes($pack->sort_index) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE tab_id = '{$pack->tab_id}'");
     games::bumpGameVersion($pack);
     return tabs::getTab($pack);
 }