function abortDb($errormsg) { header('HTTP/1.0 500 Error'); echo "<h1>500 Error</h1>"; echo $errormsg; cleanupDb(); exit; }
} else { $w = null; } } else { $newworlds[] = $w; } if ($w != null) { $mcnt = count($w->maps); $newmaps = array(); for ($j = 0; $j < $mcnt; $j++) { $m = $w->maps[$j]; if ($m->protected) { $ss = stristr($mapaccess[$w->name . '.' . $m->prefix], $uid); if ($ss !== false) { $newmaps[] = $m; } } else { $newmaps[] = $m; } } $w->maps = $newmaps; } } $json->worlds = $newworlds; echo json_encode($json); } } cleanupDb(); ?>