| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /* QGIS- reverse inginiering:
- ?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0
- */
- require_once dirname(__FILE__) . '/se-lib/bootstrap.php';
- if (!Request::isHttps()) {
- header("Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
- exit();
- }
- date_default_timezone_set('Europe/Warsaw');// PHP 5 >= 5.1.0 required by date functions
- $errorReportingLevel = E_ALL & ~E_NOTICE;
- error_reporting($errorReportingLevel);
- ini_set('error_reporting', $errorReportingLevel);
- if (file_exists(APP_PATH_ROOT . "/config/.config_{$_SERVER['SERVER_NAME']}.php")) {
- require APP_PATH_ROOT . "/config/.config_{$_SERVER['SERVER_NAME']}.php";
- }
- if (file_exists(APP_PATH_ROOT . "/.config.php")) include APP_PATH_ROOT . "/.config.php";
- require_once APP_PATH_ROOT . "/superedit-SEF.php";
- SEF('DEBUG_S');
- Lib::loadClass('ApiUser');
- Lib::loadClass('Api');
- session_start();
- session_write_close();
- $apiUser = new ApiUser();
- // ?LOGIN=LOGOUT
- if ('LOGOUT' == V::get('LOGIN', '', $_GET)) {
- $apiUser->logout();
- } else {
- $apiUser->auth();
- }
- set_time_limit(5 * 60);
- $taskPath = Request::getRewriteTaskPath();
- IF(V::get('DBG','',$_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">taskPath (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($taskPath);echo'</pre>';}
- if ('/xml/wfs' == substr($taskPath, 0, 8)) {
- $taskPath = "/xml/wfsQgis/" . substr($taskPath, 9);
- }
- $api = new Api();
- $api->setUser($apiUser);
- $apiBaseUri = Request::getScriptUri();
- $api->setBaseUri($apiBaseUri);
- try {
- $api->execute($taskPath);
- }
- catch (HttpException $e) {
- Http::sendHeaderByCode($e->getCode());
- echo $e->getMessage();
- }
- catch (Exception $e) {
- Http::sendHeaderByCode(500);
- echo $e->getMessage();
- }
- ?>
|