Skip to content
Snippets Groups Projects
Commit a35fd594 authored by Brett Bieber's avatar Brett Bieber
Browse files

Update the index file, remove alert creation capabilities. This all goes through warn now.

parent ee0132ae
No related branches found
No related tags found
No related merge requests found
...@@ -2,24 +2,13 @@ ...@@ -2,24 +2,13 @@
ini_set('display_errors', false); ini_set('display_errors', false);
if ($_SERVER['SERVER_NAME'] != 'ucommbieber.unl.edu'
&& $_SERVER['SERVER_PORT'] != 443) {
$url = 'https://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header('Location: '.$url);
exit();
}
require_once 'UNL/Templates.php'; require_once 'UNL/Templates.php';
require_once 'MDB2.php';
require_once dirname(__FILE__).'/../admin_auth.php';
UNL_Templates::$options['version'] = 3; UNL_Templates::$options['version'] = 3;
$p = UNL_Templates::factory('Secure'); $p = UNL_Templates::factory('Secure');
$p->doctitle = '<title>UNL | Up To Date Alerts</title>'; $p->doctitle = '<title>UNL | Up To Date Alerts</title>';
$p->head .= '<link rel="stylesheet" type="text/css" href="cap.css" />';
$p->breadcrumbs = <<<BC $p->breadcrumbs = <<<BC
<ul> <ul>
<li><a href="http://www.unl.edu/">UNL</a></li> <li><a href="http://www.unl.edu/">UNL</a></li>
...@@ -29,67 +18,14 @@ BC; ...@@ -29,67 +18,14 @@ BC;
$p->titlegraphic = '<h1>UNL Alerts</h1>'; $p->titlegraphic = '<h1>UNL Alerts</h1>';
$p->maincontentarea = ''; $p->maincontentarea = '';
$db =& MDB2::factory($dsn);
if (MDB2::isError($db)) {
die($db->getMessage());
}
$p->navlinks = ' $p->navlinks = '
<ul> <ul>
<li class="first"><a href="http://alert1.unl.edu/">UNL Alert Server 1</a> <li class="first"><a href="http://alert1.unl.edu/">UNL Alert Server 1</a></li>
<!-- s1 --> <li><a href="http://alert2.unl.edu/">UNL Alert Server 2</a></li>
</li>
<li><a href="http://alert2.unl.edu/">UNL Alert Server 2</a>
<!-- s2 -->
</li>
<li><a href="'.$_SERVER['PHP_SELF'].'?action=logout" title="Logout">Logout '.$a->getUser().'</a></li> <li><a href="'.$_SERVER['PHP_SELF'].'?action=logout" title="Logout">Logout '.$a->getUser().'</a></li>
</ul>'; </ul>';
if (isset($_GET['expire'])) { $p->maincontentarea .= 'This service replicates UNL Alerts for on campus monitoring.';
$del = &DB_DataObject::factory('cap_info');
if ($del->get($_GET['expire'])) {
if($del->expire()) {
$p->maincontentarea .= '<h3>The alert has expired as of '.$del->expires.'</h3>';
}
}
unset($del);
}
$p->navlinks = str_replace('<!-- s1 -->','<ul><li><a href="./">Create New Alert</a></li></ul>', $p->navlinks);
$p->navlinks = str_replace('<!-- s2 -->','<ul><li><a href="http://alert2.unl.edu/">Create New Alert</a></li></ul>', $p->navlinks);
$cap =& DB_DataObject::factory('cap_info');
if (isset($_GET['detail'])) {
$cap->get($_GET['detail']);
}
$fb =& DB_DataObject_FormBuilder::create($cap);
$form =& $fb->getForm();
$form->setDefaults(array('contact'=>$a->getUser()));
if ($form->validate()) {
$result = $form->process(array(&$fb, 'processForm'), false);
if ($result==1) {
$p->maincontentarea .= "<span class='sserifstoryhead'>The alert was successfully added.</span>";
// Update file on both servers.
file_get_contents('http://alert1.unl.edu/exportCAPAlert.php');
file_get_contents('http://alert2.unl.edu/exportCAPAlert.php');
// Old way
//include('exportCAPAlert.php');
header('Location: ./?detail='.$cap->recKey);
exit();
}
}
if (isset($cap->recKey)) {
$form->removeElement('__submit__');
$form->freeze();
$content = $form->toHtml();
$content .= '<h4 style="float:right;"><a href="./">New Alert</a></h4>';
} else {
$content = $form->toHtml();
}
$p->maincontentarea .= displayAlerts($db, $a);
$p->maincontentarea .= $content;
$p->footercontent = '&copy '.date('Y').' University of Nebraska&ndash;Lincoln'; $p->footercontent = '&copy '.date('Y').' University of Nebraska&ndash;Lincoln';
echo $p; echo $p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment