Skip to content

Commit

Permalink
more reverse-proxy-friendly urls
Browse files Browse the repository at this point in the history
many links used to begin with / which was uneasy to expose through a
reverse proxy
  • Loading branch information
g76r committed May 17, 2013
1 parent 8655625 commit 48310f6
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$graph->store();

fMessaging::create('affected', fURL::get(), $graph->getName());
fMessaging::create('success', fURL::getWithQueryString(),
fMessaging::create('success', '?'.fURL::getQueryString(),
'The Graph ' . $graph->getName(). ' was successfully updated');
fURL::redirect(Dashboard::makeUrl('edit',$dashboard));
}
Expand Down
2 changes: 1 addition & 1 deletion inc/views/add_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
?>
<div class="row">
<div class="span4">
<form class="form-stacked" action="<?=fURL::get(); ?>?action=<?=$action; ?>&type=<?=$check_type; ?>&check_id=<?=$check_id; ?>" method="post">
<form class="form-stacked" action="?action=<?=$action; ?>&type=<?=$check_type; ?>&check_id=<?=$check_id; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_dashboard.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?
$page_title = $action == 'add' ? 'Add a Dashboard' : 'Edit Dashboard';
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => $page_title,'url' => fURL::getWithQueryString(),'active'=> true);
$breadcrumbs[] = array('name' => $page_title,'url' => '?'.fURL::getQueryString(),'active'=> true);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
if (isset($dashboard_id)) {
Expand All @@ -12,7 +12,7 @@
?>
<div class="row">
<div class="span4">
<form class="form-stacked" action="<?=fURL::get(); ?>?action=<?=$action.$query_string; ?>" method="post">
<form class="form-stacked" action="?action=<?=$action.$query_string; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => 'Dashboard', 'url' => Dashboard::makeURL('list'),'active' => false);
$breadcrumbs[] = array('name' => $dashboard->encodeName(), 'url' => Dashboard::makeUrl('edit',$graph),'active' => false);
$breadcrumbs[] = array('name' => $page_title, 'url' => fURL::getWithQueryString(),'active' => true);
$breadcrumbs[] = array('name' => $page_title, 'url' => '?'.fURL::getQueryString(),'active' => true);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
if (!is_null($dashboard_id)) {
Expand All @@ -16,7 +16,7 @@
?>
<div class="row">
<div class="span4">
<form action="<?=fURL::get(); ?>?action=<?=$action.$query_string; ?>" method="post" class="form-stacked">
<form action="?action=<?=$action.$query_string; ?>" method="post" class="form-stacked">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_line.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$breadcrumbs[] = array('name' => 'Dashboard', 'url' => Dashboard::makeURL('list'),'active' => false);
//$breadcrumbs[] = array('name' => 'Edit Dashboard', 'url' => Dashboard::makeURL('edit',$graph),'active' => false);
$breadcrumbs[] = array('name' => $graph->prepareName(), 'url' => Graph::makeURL('edit',$graph),'active'=> false);
$breadcrumbs[] = array('name' => $page_title, 'url' => fURL::getWithQueryString(),'active'=> true);
$breadcrumbs[] = array('name' => $page_title, 'url' => '?'.fURL::getQueryString(),'active'=> true);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
$query_string = '';
Expand All @@ -19,7 +19,7 @@
?>
<div class="row">
<div class="span6">
<form action="<?=fURL::get(); ?>?action=<?=$action.$query_string; ?>" method="post">
<form action="?action=<?=$action.$query_string; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
2 changes: 1 addition & 1 deletion inc/views/add_edit_predictive_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
?>
<div class="row">
<div class="span4">
<form class="form-stacked" action="<?=fURL::get(); ?>?action=<?=$action; ?>&type=<?=$check_type; ?>&check_id=<?=$check_id; ?>" method="post">
<form class="form-stacked" action="?action=<?=$action; ?>&type=<?=$check_type; ?>&check_id=<?=$check_id; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$page_title = ($action == 'add' ? 'Override setting' : 'Edit Setting');
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => 'Settings', 'url' => Setting::makeURL('list'),'active' => false);
$breadcrumbs[] = array('name' => $page_title, 'url' => fURL::getWithQueryString(),'active'=> true);
$breadcrumbs[] = array('name' => $page_title, 'url' => '?'.fURL::getQueryString(),'active'=> true);
//$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
$query_string = '';
Expand All @@ -18,7 +18,7 @@
?>
<div class="row">
<div class="span6">
<form action="<?=fURL::get(); ?>?action=<?=$action.$query_string; ?>" method="post">
<form action="?action=<?=$action.$query_string; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => ucfirst($check->getType()) . ' Checks', 'url' => Check::makeURL('list', $check->prepareType()),'active' => false);
$breadcrumbs[] = array('name' => $check->getName(),'url'=> Check::makeURL('edit', $check->prepareType(), $check),'active' => false);
$breadcrumbs[] = array('name' => $page_title , 'url' => fURL::getWithQueryString(),'active' => false);
$breadcrumbs[] = array('name' => $page_title , 'url' => '?'.fURL::getQueryString(),'active' => false);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');

Expand Down Expand Up @@ -42,7 +42,7 @@ function reloadGraphiteGraph() {
</script>
<div class="row">
<div class="span4">
<form class="form-stacked" action="<?=fURL::get(); ?>?action=<?=$action.$query_string; ?>" method="post">
<form class="form-stacked" action="?action=<?=$action.$query_string; ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
2 changes: 1 addition & 1 deletion inc/views/add_edit_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
?>
<div class="row">
<div class="span6">
<form action="<?=fURL::getWithQueryString(); ?>" method="post">
<form action="?<?=fURL::getQueryString(); ?>" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
4 changes: 2 additions & 2 deletions inc/views/add_edit_user_settings.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?
$page_title = ($action == 'add' ? 'User Settings' : 'Edit Settings');
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => $page_title, 'url' => fURL::getWithQueryString(),'active'=> true);
$breadcrumbs[] = array('name' => $page_title, 'url' => '?'.fURL::getQueryString(),'active'=> true);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
$plugin = fRequest::get('plugin');
Expand All @@ -14,7 +14,7 @@
?>
<div class="row">
<div class="span6">
<form action="<?=fURL::get(); ?>" method="post">
<form action="?" method="post">
<div class="main" id="main">
<ul class="tabs">
<?php foreach($plugin_settings as $plugin_name => $plugin_config) {
Expand Down
2 changes: 1 addition & 1 deletion inc/views/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<ul class="nav">
<?

$current_url = fURL::getWithQueryString();
$current_url = '?'.fURL::getQueryString();
echo '<li' . ($current_url == '' ? ' class="active"' : '') . '><a href="index.php">Alerts</a></li>'. "\n";
$threshold_check_list = Check::makeURL('list', 'threshold');
echo '<li' . ($current_url == $threshold_check_list ? ' class="active"' : '') . '><a href="' . $threshold_check_list . '" >Threshold Checks</a></li>' . "\n";
Expand Down
2 changes: 1 addition & 1 deletion inc/views/list_check_results.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
$total_pages = ceil($check_results->count(TRUE) / $GLOBALS['PAGE_SIZE']);
if ($total_pages > 1) {
$prev_class = 'previous';
$current_link = fURL::get() . "?action=$action&check_id=$check_id";
$current_link = "?action=$action&check_id=$check_id";
$prev_link = $current_link . '&page=' . ($page_num - 1);
$next_class = 'next';
$next_link = $current_link . '&page=' . ($page_num + 1);
Expand Down
2 changes: 1 addition & 1 deletion inc/views/log_in.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$tmpl->set('no-nav', true);
$tmpl->place('header');
?>
<form action="<?=fURL::get() . '?action=log_in'; ?>" method="post">
<form action="?action=log_in" method="post">
<div class="main" id="main">
<fieldset>
<div class="clearfix">
Expand Down
2 changes: 1 addition & 1 deletion inc/views/view_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</center>
<?php
if (!$full_screen) {
echo '<a href="' . Dashboard::makeUrl('edit',$dashboard) . '">Edit Dashboard</a> | <a href="' . Graph::makeUrl('add',$dashboard) .'">Add Graph</a> | <a href="' . fUrl::getWithQueryString() . '&full_screen=true">Full Screen</a>';
echo '<a href="' . Dashboard::makeUrl('edit',$dashboard) . '">Edit Dashboard</a> | <a href="' . Graph::makeUrl('add',$dashboard) .'">Add Graph</a> | <a href="?' . fURL::getQueryString() . '&full_screen=true">Full Screen</a>';
$tmpl->set('show_bubbles',true);
$tmpl->place('footer') ;
}
Expand Down
2 changes: 1 addition & 1 deletion lines.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$line->store();

fMessaging::create('affected', fURL::get(), $graph->getName());
fMessaging::create('success', fURL::getWithQueryString(),
fMessaging::create('success', '?'.fURL::getQueryString(),
'The Line ' . $line->getAlias(). ' was successfully updated');
}
} catch (fNotFoundException $e) {
Expand Down

0 comments on commit 48310f6

Please sign in to comment.