From bb1552be29fc443b3b08fc67e9ea921068735e18 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 17 Sep 2017 19:51:00 +0200 Subject: [PATCH] setup: error out when web site user does not exist User is needed to be able to grant rights. --- utils/setup.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/setup.php b/utils/setup.php index 44bdcdc7..1e1ec37b 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -130,6 +130,13 @@ if ($aCMDResult['setup-db'] || $aCMDResult['all']) { pgsqlRunScript('ALTER FUNCTION ST_Distance_Spheroid(geometry, geometry, spheroid) RENAME TO ST_DistanceSpheroid'); } + $i = chksql($oDB->getOne("select count(*) from pg_user where usename = '".CONST_Database_Web_User."'")); + if ($i == 0) { + echo "ERROR: Web user '".CONST_Database_Web_User."' does not exist. Create it with:\n"; + echo "\n createuser ".CONST_Database_Web_User."\n\n"; + exit(1); + } + if (!file_exists(CONST_ExtraDataPath.'/country_osm_grid.sql.gz')) { echo "Error: you need to download the country_osm_grid first:"; echo "\n wget -O ".CONST_ExtraDataPath."/country_osm_grid.sql.gz http://www.nominatim.org/data/country_grid.sql.gz\n"; -- 2.39.5