web: user secure URL base if available

This commit is contained in:
David Anderson 2017-02-12 01:03:16 -08:00
parent cd1f2f6176
commit 93c46ee5a8
3 changed files with 5 additions and 5 deletions

View File

@ -81,17 +81,17 @@ function navbar_right($user) {
if ($user) { if ($user) {
echo sprintf(' echo sprintf('
<li><a href=%shome.php>'.$user->name.'</a></li> <li><a href=%shome.php>'.$user->name.'</a></li>
', URL_BASE ', url_base()
); );
$url_tokens = url_tokens($user->authenticator); $url_tokens = url_tokens($user->authenticator);
echo sprintf('<li><a href="%slogout.php?%s">Log out</a></li>', echo sprintf('<li><a href="%slogout.php?%s">Log out</a></li>',
URL_BASE, $url_tokens url_base(), $url_tokens
); );
} else { } else {
echo sprintf(' echo sprintf('
<li><a href="%screate_account_form.php">Sign Up</a></li> <li><a href="%screate_account_form.php">Sign Up</a></li>
<li><a href="%slogin_form.php">Login</a></li> <li><a href="%slogin_form.php">Login</a></li>
', URL_BASE, URL_BASE ', url_base(), url_base()
); );
} }
} }

View File

@ -49,7 +49,7 @@ function show_notify_rss_item($notify) {
$news_date=gmdate('D, d M Y H:i:s',$notify->create_time) . ' GMT'; $news_date=gmdate('D, d M Y H:i:s',$notify->create_time) . ' GMT';
echo "<item> echo "<item>
<title><![CDATA[$title]]></title> <title><![CDATA[$title]]></title>
<guid>".URL_BASE."_notify_$notify->id</guid> <guid>".url_base()."_notify_$notify->id</guid>
<link>".htmlentities($url)."</link> <link>".htmlentities($url)."</link>
<description><![CDATA[$msg]]></description> <description><![CDATA[$msg]]></description>
<pubDate>$news_date</pubDate> <pubDate>$news_date</pubDate>

View File

@ -158,7 +158,7 @@ function get_logged_in_user($must_be_logged_in=true) {
} }
} }
$next_url = urlencode($next_url); $next_url = urlencode($next_url);
Header("Location: ".URL_BASE."login_form.php?next_url=$next_url"); Header("Location: ".url_base()."login_form.php?next_url=$next_url");
exit; exit;
} }
$got_logged_in_user = true; $got_logged_in_user = true;