-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
91 lines (77 loc) · 2.81 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header("Cache-Control: max-age=0, no-cache, no-store");
header("Pragma: no-cache");
header("x-outage: true");
$h1 = "Site under maintenance";
$host = (array_key_exists('HTTP_HOST', $_SERVER)) ? $_SERVER['HTTP_HOST'] : 'outage.pdx.edu';
$msg = "The web site you are trying to reach is currently down for maintenance. Please try again later.";
$pages = array(
'/dev\.banner\.pdx\.edu/' => 'devel-banner',
'/stage.*oam\.pdx\.edu/' => 'stage-oam',
'/^(access\.)?oam\.pdx\.edu/' => 'prod-oam',
'/banweb\.pdx\.edu/' => 'prod-ssb',
'/inb\.banner|wls\.banner/' => 'prod-inb',
'/outage\.pdx\.edu/' => 'outage'
);
$msgpath = "/var/www/html/messages/outage";
foreach ($pages as $expr => $filename) {
$ret = preg_match($expr, $host);
if ($ret === 1) {
$msgpath = "/var/www/html/messages/" . $filename;
break;
}
}
if (file_exists($msgpath)) {
$contents = file_get_contents($msgpath);
if ($contents != FALSE ) {
$lines = explode("\n", $contents);
$h1 = $lines[0];
$msg = '';
for($i=1;$i<count($lines); $i++) {
$msg .= $lines[$i] ."\n" ;
}
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>Site under maintenance | Office of Information Technology</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
<?php include "outage.css"; ?>
</style>
</head>
<body class="maintenance-page in-maintenance no-sidebars">
<div id="page">
<div id="header">
<div id="logo-title">
<a href="#" title="Home" rel="home" id="logo">
<img src="data:image/png;base64,<?php require 'logo.png.base64';?>" alt="Home" />
</a>
<div id="name-and-slogan">
<h1 id="site-name">
<a href="#" title="Home" rel="home"><span>Office of Information Technology</span></a>
</h1>
</div> <!-- /name-and-slogan -->
</div> <!-- /logo-title -->
</div> <!-- /header -->
<div id="container" class="clearfix">
<div id="main" class="column"><div id="main-squeeze">
<div id="content">
<h1 class="title" id="page-title"><?php echo $h1; ?></h1>
<div id="content-content" class="clearfix">
<?php echo $msg; ?>
</div> <!-- /content-content -->
</div> <!-- /content -->
</div>
</div> <!-- /main-squeeze /main -->
</div> <!-- /container -->
<div id="footer-wrapper">
<div id="footer">
</div> <!-- /footer -->
</div> <!-- /footer-wrapper -->
</div> <!-- /page -->
</body>
</html>