Commit cacaf858 authored by anarcat's avatar anarcat Committed by anarcat

use the ssl flag to build the proper url

parent 1e353b5b
......@@ -8,18 +8,21 @@ $GLOBALS['url'] = drush_get_option('site_url');
$GLOBALS['profile'] = drush_get_option('profile');
$GLOBALS['install_locale'] = drush_get_option('language');
$GLOBALS['client_email'] = drush_get_option('client_email');
switch(drush_get_option('site_port')) {
case 80:
$base_url = 'http://' . $GLOBALS['url'];
break;
case 443:
$base_url = 'https://' . $GLOBALS['url'];
break;
default:
$base_url = 'http://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
break;
// url generation code, should be factored out
$proto = drush_get_option('ssl') ? 'https' : 'http';
if (drush_get_option('site_port') == 80) {
if (drush_get_option('ssl')) {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':80';
}
}
elseif (drush_get_option('site_port') == 443) {
if (!drush_get_option('ssl')) {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':443';
}
} else {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
}
$GLOBALS['base_url'] = $base_url;
require_once 'includes/install.inc';
......
......@@ -8,18 +8,20 @@ $GLOBALS['url'] = drush_get_option('site_url');
$GLOBALS['profile'] = drush_get_option('profile');
$GLOBALS['install_locale'] = drush_get_option('language');
$GLOBALS['client_email'] = drush_get_option('client_email');
switch(drush_get_option('site_port')) {
case 80:
$base_url = 'http://' . $GLOBALS['url'];
break;
case 443:
$base_url = 'https://' . $GLOBALS['url'];
break;
default:
$base_url = 'http://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
break;
// url generation code, should be factored out
$proto = drush_get_option('ssl') ? 'https' : 'http';
if (drush_get_option('site_port') == 80) {
if (drush_get_option('ssl')) {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':80';
}
}
elseif (drush_get_option('site_port') == 443) {
if (!drush_get_option('ssl')) {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':443';
}
} else {
$GLOBALS['base_url'] = $proto . '://' . $GLOBALS['url'] . ':' . drush_get_option('site_port');
}
$GLOBALS['base_url'] = $base_url;
require_once 'includes/install.inc';
define('MAINTENANCE_MODE', 'install');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment