Permalink
Browse files

Merge pull request #3 from gvsulib/develop

changed script to detect url rather than have it hardcoded for portabili...
  • Loading branch information...
2 parents 11f12f2 + 9ec7351 commit 1082a279cc37dbf2eaa4f1b5b1307e31e0a34ab9 @K-Felk K-Felk committed May 10, 2012
Showing with 10 additions and 3 deletions.
  1. +7 −2 display.php
  2. +3 −1 login.php
View
@@ -1,13 +1,17 @@
<?
session_start();
if (!isset($_SESSION['username'])) {
- header("Location: https://login.ezproxy.gvsu.edu/login?url=https://login.ezproxy.gvsu.edu/userObject?service=getToken&returnURL=http://gvsulib.com/felkerk/360Link_Reset/login.php");
+
+ $path_parts = pathinfo($_SERVER['SCRIPT_NAME']);
+
+ $header = "Location: https://login.ezproxy.gvsu.edu/login?url=https://login.ezproxy.gvsu.edu/userObject?service=getToken&returnURL=http://" . $_SERVER['SERVER_NAME'] . $path_parts['dirname'] . "/login.php";
+ header($header);
} else {
$user = trim($_SESSION['username']);
if ($user != 'felkerk' && $user != 'simons') {
- echo "You suck";
+ echo "<P color='red'>You are not authorized, sucka.</P>";
@mreidsma

mreidsma Sep 27, 2012

Owner

Ha! Excellent microcopy, sir.

die;
}
@@ -170,6 +174,7 @@
<h2>Dodgy Link Display</h2>
View Enties From:
+
<P>
<form action="" method="GET">
<label for="start_date">Start Date</label>
View
@@ -27,7 +27,9 @@
session_write_close(); // Make sure the session variable is written before the redirect
-$new_url = "http://gvsulib.com/felkerk/360Link_Reset/display.php"; // URL of the app you are signing into
+$path_parts = pathinfo($_SERVER['SCRIPT_NAME']);
+
+$new_url = "http://" . $_SERVER['SERVER_NAME'] . $path_parts['dirname'] . "/display.php"; // URL of the app you are signing into
header('Location: ' . $new_url);

0 comments on commit 1082a27

Please sign in to comment.