Commit ae04dbcb authored by Ruslan Kabalin's avatar Ruslan Kabalin

httpswwwroot removal (bug #646713)

Change-Id: Id7eae48294768b7192ac3921c316f2d8288de38f
Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
parent 4341cb09
......@@ -1023,18 +1023,13 @@ function auth_get_login_form() {
// remembers the GET and POST data sent to it and resends that on
// afterwards.
$action = '';
if (get_config('httpswwwroot')) {
$action = rtrim(get_config('httpswwwroot'), '/') . hsc(strip_querystring(get_relative_script_path()));
}
if ($_GET) {
if (isset($_GET['logout'])) {
// You can log the user out on any particular page by appending
// ?logout to the URL. In this case, we don't want the "action"
// of the url to include that, or be blank, else the next time
// the user logs in they will be logged out again.
if ($action == '') {
$action = hsc(substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?')));
}
$action = hsc(substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?')));
} else {
$action .= '?';
foreach ($_GET as $key => $value) {
......@@ -1301,19 +1296,6 @@ function login_submit(Pieform $form, $values) {
// User is allowed to log in
//$USER->login($userdata);
auth_check_required_fields();
if (get_config('httpswwwroot') && !defined('JSON')) {
// If we are using HTTPS for logins we need to go back to
// non-HTTPS URLs. Otherwise, Javascript (and possibly CSS)
// breaks. Don't use get_full_script_path(), as it doesn't
// work if someone sets httpswwwroot to something like
// 'https://x.y.z.w:443/...' (unlikely, but
// possible). get_full_script_path() doesn't gives us the
// ':443' part and things break horribly.
$parts = parse_url(get_config('httpswwwroot'));
$httpsrequest = rtrim($parts['path'], '/');
redirect(hsc(substr(get_script_path(), strlen($httpsrequest))));
}
}
/**
......@@ -1542,10 +1524,6 @@ function auth_generate_login_form() {
if (!get_config('installed')) {
return;
}
$action='';
if (get_config('httpswwwroot')) {
$action = rtrim(get_config('httpswwwroot'), '/') . strip_querystring(get_relative_script_path());
}
require_once('pieforms/pieform.php');
if (count_records('institution', 'registerallowed', 1, 'suspended', 0)) {
$registerlink = '<a href="' . get_config('wwwroot') . 'register.php" tabindex="2">' . get_string('register') . '</a><br>';
......@@ -1557,7 +1535,6 @@ function auth_generate_login_form() {
'name' => 'login',
'renderer' => 'div',
'submit' => false,
'action' => $action,
'plugintype' => 'auth',
'pluginname' => 'internal',
'autofocus' => false,
......
......@@ -54,15 +54,12 @@ $cfg->dbprefix = '';
// wwwroot - the web-visible path to your Mahara installation
// Normally, this is automatically detected - if it doesn't work for you
// then try specifying it here
// then try specifying it here.
// This value must end with a /
//$cfg->wwwroot = 'http://myhost.com/mahara/';
// You will only need to specify this if you want to use HTTPS for
// logins, but not for regular pages. If you want to serve all of your
// Mahara content via HTTPS, just set $cfg->wwwroot to use HTTPS instead.
// This value must end with a /
//$cfg->httpswwwroot = 'https://myhost.com/mahara/';
// If you want to serve all of your Mahara content via HTTPS, just set
// $cfg->wwwroot to use HTTPS.
//$cfg->wwwroot = 'https://myhost.com/mahara/';
// dataroot - uploaded files are stored here
// This is a ABSOLUTE FILESYSTEM PATH. This is NOT a URL.
......
......@@ -190,11 +190,6 @@ if (isset($CFG->wwwroot)) {
$CFG->wwwroot .= '/';
}
}
if (isset($CFG->httpswwwroot)) {
if (substr($CFG->httpswwwroot, -1, 1) != '/') {
$CFG->httpswwwroot .= '/';
}
}
if (!isset($CFG->noreplyaddress) && isset($_SERVER['HTTP_HOST'])) {
$noreplyaddress = 'noreply@';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
......
......@@ -70,7 +70,6 @@ class Dwoo_Mahara extends Dwoo {
'THEME' => $THEME,
'WWWROOT' => get_config('wwwroot'),
'THEMELIST' => json_encode($theme_list),
'HTTPSWWWROOT' => get_config('httpswwwroot'),
);
}
......
......@@ -2106,7 +2106,6 @@ function right_nav() {
$menu = array(
array(
'path' => 'settings',
'wwwroot' => get_config('httpswwwroot'),
'url' => 'account/',
'title' => get_string('settings'),
'icon' => $THEME->get_url('images/settings.png'),
......
......@@ -21,7 +21,7 @@
{if $SELECTEDSUBNAV}
<ul>{strip}
{foreach from=$SELECTEDSUBNAV item=item}
<li{if $item.selected} class="selected"{/if}><a href="{if get_config('httpswwwroot') && $item.url=='account/'}{$HTTPSWWWROOT}{else}{$WWWROOT}{/if}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a></li>
<li{if $item.selected} class="selected"{/if}><a href="{$WWWROOT}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a></li>
{/foreach}
{/strip}</ul>
{/if}
......
......@@ -25,7 +25,7 @@
<strong><a href="{$WWWROOT}user/view.php">{$USER|display_name:null:true|escape}</a>:</strong>
{foreach from=$MAINNAV item=item}
{if $item.path}
<a href="{if $item.url=='account/' && get_config('httpswwwroot')}{$HTTPSWWWROOT}{else}{$WWWROOT}{/if}{$item.url}">{$item.title}</a> |
<a href="{$WWWROOT}{$item.url}">{$item.title}</a> |
{/if}
{/foreach}
{if $USER->get('admin')}
......
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