Example #1
0
    $loginID = $util->getLoginCookie();
    //load user and verify they have a valid open session
    $user = new User(new NamedArguments(array('primaryKey' => $loginID)));
    //if the user has an open session
    if ($loginID && $user->hasOpenSession()) {
        session_start();
        $_SESSION['loginID'] = $loginID;
        //no open session
    } else {
        //redirect to auth page
        if (isset($user->loginID)) {
            $addURL = '?timeout&service=';
        } else {
            $addURL = '?service=';
        }
        $authURL = $util->getCORALURL() . "auth/" . $addURL . htmlentities($_SERVER['REQUEST_URI']);
        header('Location: ' . $authURL, true);
    }
    //otherwise plug into apache server variable
} else {
    //get login id from server
    if (!isset($_SESSION['loginID']) || $_SESSION['loginID'] == '') {
        $varName = $config->settings->remoteAuthVariableName;
        //the following code takes the remote auth variable name from the config settings and evaluates it to get the actual value from web server
        //if the first character is a $ it needs to be stripped off for the eval to work
        $theVarStem = ltrim($varName, "\$");
        //evaluate the remote variable
        $remoteAuth = eval("return \${$theVarStem};");
        //use the split in case the remote login is supplied as an email address
        list($loginID, $restofAddr) = explode("@", $remoteAuth);
        session_start();
Example #2
0
** CORAL 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License along with CORAL.  If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************************************************************
*/
include_once 'directory.php';
include_once 'user.php';
$util = new Utility();
$config = new Configuration();
//get the current page to determine which menu button should be depressed
$currentPage = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentPage);
$currentPage = $parts[count($parts) - 1];
//get CORAL URL for 'Change Module' and logout link
$coralURL = $util->getCORALURL();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CORAL Usage Statistics - <?php 
echo $pageTitle;
?>
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/jquery.tooltip.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css" media="screen" />
<link rel="SHORTCUT ICON" href="images/seahorsefavicon.ico" />
        ?>
				</span>
				</th>
				</tr>

				<?php 
        if (isset($contact['organizationName'])) {
            ?>

				<tr>
				<td style='vertical-align:top;width:110px;'><?php 
            echo _("Organization:");
            ?>
</td>
				<td><?php 
            echo $contact['organizationName'] . "&nbsp;&nbsp;<a href='" . $util->getCORALURL() . "organizations/orgDetail.php?showTab=contacts&organizationID=" . $contact['organizationID'] . "' target='_blank'><img src='images/arrow-up-right.gif' alt='" . _("Visit Contact in Organizations Module") . "' title='" . _("Visit Contact in Organizations Module") . "' style='vertical-align:top;'></a>";
            ?>
</td>
				</tr>

				<?php 
        }
        if ($contact['archiveDate'] != '0000-00-00' && $contact['archiveDate']) {
            ?>
				<tr>
				<td style='vertical-align:top;background-color:#ebebeb; width:110px;'><?php 
            echo _("No longer valid:");
            ?>
</td>
				<td style='background-color:#ebebeb'><i><?php 
            echo format_date($contact['archiveDate']);
Example #4
0
**
** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
**
** CORAL 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License along with CORAL.  If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************************************************************
*/
session_start();
include_once 'directory.php';
$util = new Utility();
if (isset($_GET['service'])) {
    $service = $_GET['service'];
} else {
    $service = $util->getCORALURL();
}
$errorMessage = '';
$message = '&nbsp;';
$inputLoginID = '';
$rememberChecked = '';
if (isset($_SESSION['loginID'])) {
    $loginID = $_SESSION['loginID'];
    $user = new User(new NamedArguments(array('primaryKey' => $loginID)));
}
//user is trying to log out
if (array_key_exists('logout', $_GET)) {
    $user->processLogout();
    $message = _('You are successfully logged out of the system.');
    $user = new User();
    //get login, if set
Example #5
0
fwrite($fp, "<?php header(\"Content-type: application/vnd.ms-excel\");\nheader(\"Content-Disposition: attachment; filename=" . $excelfile . "\"); ?>");
fwrite($fp, "<html><head></head><body>");
fwrite($fp, $topLogOutput);
//for major errors
fwrite($fp, "<br />");
fwrite($fp, $logOutput);
fwrite($fp, "</body></html>");
fclose($fp);
//send email to email addresses listed in DB
$logEmailAddress = new LogEmailAddress();
$emailAddresses = array();
foreach ($logEmailAddress->allAsArray() as $emailAddress) {
    $emailAddresses[] = $emailAddress['emailAddress'];
}
$util = new Utility();
$Base_URL = $util->getCORALURL() . "usage/";
$mailOutput = '';
if (count($emailAddresses) > 0) {
    $email = new Email();
    $email->to = implode(", ", $emailAddresses);
    $email->subject = _("Log Output for ") . $uploadedFile;
    $email->message = _("Usage Statistics File Import Run!") . "\n\n" . _("Please find log file: ") . "\n\n" . $Base_URL . $logfile;
    if ($email->send()) {
        $mailOutput = _("Log has been emailed to ") . implode(", ", $emailAddresses);
    } else {
        $mailOutput = _("Email to ") . implode(", ", $emailAddresses) . _(" Failed!");
    }
}
if ($multYear) {
    $logSummary .= date("F Y", mktime(0, 0, 0, $startMonth, 10, $startYear)) . " - " . date("F Y", mktime(0, 0, 0, $holdEndMonth, 10, $endYear));
} else {