pagenotworking.php 2.49 KB
Newer Older
1 2
<?php
#
3
# Copyright (c) 2007-2012 University of Utah and the Flux Group.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
23 24 25
#
include("defs.php3");

26 27 28
$optargs = OptionalPageArguments("confirmed",   PAGEARG_BOOLEAN,
				 "description", PAGEARG_STRING, 
				 "referrer",    PAGEARG_STRING);
29
$this_user = CheckLogin($check_status);
30
$referrer  = (isset($referrer) ? $referrer : $_SERVER['HTTP_REFERER']);
31
$referrer  = urlencode($referrer);
32

33 34 35 36 37
#
# Standard Testbed Header
#
PAGEHEADER("Page Not Working Properly!");

38
if ($this_user) {
39
    if (!isset($confirmed)) {
40 41
	echo "<center>";
	echo "Are you sure you want to report a problem with:<br>
42 43 44
              <b>$referrer</b><br><br>";

 	echo "<form action='pagenotworking.php' method=get>";
45 46 47 48

	echo "<b>Please tell us briefly what is wrong ...</b>\n";
	echo "<br>\n";
	echo "<textarea name=description rows=10 cols=80></textarea><br>\n";
49 50 51 52 53 54 55 56 57 58 59
	echo "<b><input type=hidden name=confirmed value=1></b>";
	echo "<b><input type=hidden name=referrer value='$referrer'></b>";
	echo "<b><input type=submit name=tag value='Submit'></b>";
	echo "</form>";
	echo "</center>\n";
    }
    else {
	$uid_name  = $this_user->name();
	$uid_email = $this_user->email();
	$uid_uid   = $this_user->uid();

60 61 62
	if (! isset($description))
	    $description = "";

63 64 65 66
	TBMAIL($TBMAIL_OPS,
	       "Page Not Working Properly",
	       "$uid_name ($uid_uid) is reporting that page:\n\n".
	       "    $referrer\n\n".
67 68
	       "is not working properly:\n\n".
	       "$description\n",
69 70 71 72
	       "From: $uid_name <$uid_email>\n".
	       "Errors-To: $TBMAIL_WWW");

	echo "<br>
73
         Thanks! A message has been sent to $TBMAILADDR to let us know
74
         something is wrong with <b>$referrer</b>";
75
    }
76
}
77 78

echo "<br><br><br>\n";
79 80 81 82 83 84 85 86
echo "Back to <a href='$referrer'>previous page</a>\n";
echo "<br>\n";

#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>