From 383a9bab96051c9c1195ef8534f4e87270d8623a Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 16 May 2013 04:27:28 -0700 Subject: if somebody changes the site url during setup - check if we can connect to the new url e.g. it has a valid cert. --- mod/setup.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mod/setup.php b/mod/setup.php index b76fa7be1..3c0a133b7 100755 --- a/mod/setup.php +++ b/mod/setup.php @@ -80,6 +80,13 @@ function setup_post(&$a) { $siteurl = notags(trim($_POST['siteurl'])); + if($siteurl != z_root()) { + $test = z_fetch_url($siteurl."/setup/testrewrite"); + if((! $test['success']) || ($test['body'] != 'ok')) { + $a->data['url_fail'] = true; + return; + } + } // connect to db $db = dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, true); @@ -140,6 +147,11 @@ function setup_content(&$a) { $install_wizard_pass = 2; $wizard_status = t('Could not connect to database.'); } + if(x($a->data,'url_fail')) { + $install_wizard_pass = 3; + $wizard_status = t('Could not connect to specified site URL. Possible SSL certificate or DNS issue.'); + } + if(x($a->data,'db_create_failed')) { $install_wizard_pass = 2; $wizard_status = t('Could not create table.'); -- cgit v1.2.3