예제 #1
0
/**
 * Return the timestamp of the cabinet's last audit.
 *
 * @param Cabinet $cab
 * @param string|null $emptyVal
 * @return string|null
 */
function getAuditTimestamp($cab, $emptyVal = null)
{
    $auditTimestamp = $emptyVal;
    $cab_audit = new CabinetAudit();
    $cab_audit->CabinetID = $cab->CabinetID;
    $cab_audit->GetLastAudit();
    if ($cab_audit->AuditStamp) {
        $auditTimestamp = $cab_audit->AuditStamp;
    }
    return $auditTimestamp;
}
예제 #2
0
// Check to see if this user is allowed to see anything in ihere
if (!$person->SiteAdmin && !$person->ReadAccess && $cab->Rights == 'None' && !array_intersect($person->isMemberOf(), Cabinet::GetOccupants($cab->CabinetID))) {
    // This cabinet belongs to a department you don't have affiliation with, so no viewing at all
    header('Location: ' . redirect());
    exit;
}
// If you're deleting the cabinet, no need to pull in the rest of the information, so get it out of the way
// Only a site administrator can create or delete a cabinet
if (isset($_POST["delete"]) && $_POST["delete"] == "yes" && $person->SiteAdmin) {
    $cab->DeleteCabinet();
    header('Content-Type: application/json');
    echo json_encode(array('url' => redirect("dc_stats.php?dc={$cab->DataCenterID}")));
    exit;
}
$head = $legend = $zeroheight = $body = $deptcolor = $AuditorName = "";
$audit = new CabinetAudit();
$dev = new Device();
$pdu = new PowerDistribution();
$pan = new PowerPanel();
$templ = new DeviceTemplate();
$tempPDU = new PowerDistribution();
$tempDept = new Department();
$dc = new DataCenter();
$dcID = $cab->DataCenterID;
$dc->DataCenterID = $dcID;
$dc->GetDataCenterbyID();
$audit->CabinetID = $cab->CabinetID;
// You just have WriteAccess in order to perform/certify a rack audit
if (isset($_POST["audit"]) && $_POST["audit"] == "yes" && $person->CanWrite($cab->AssignedTo)) {
    $audit->Comments = sanitize($_POST["comments"]);
    // Log the response
예제 #3
0
<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
define('FPDF_FONTPATH', 'font/');
require 'fpdf.php';
$dept = new Department();
$device = new Device();
$cab = new Cabinet();
$dc = new DataCenter();
$pdu = new PowerDistribution();
$panel = new PowerPanel();
$mfg = new Manufacturer();
$templ = new DeviceTemplate();
$pport = new PowerPorts();
$audit = new CabinetAudit();
$audit->CabinetID = $_REQUEST['cabinetid'];
$audit->AuditStamp = "Never";
$audit->GetLastAudit();
if ($audit->UserID != "") {
    $tmpPerson = new People();
    $tmpPerson->UserID = $audit->UserID;
    $tmpPerson->GetUserRights();
    $AuditorName = $tmpPerson->LastName . ", " . $tmpPerson->FirstName;
} else {
    //If no audit has been completed $AuditorName will return an error
    $AuditorName = "";
}
$_SESSION['AuditorName'] = $AuditorName;
$_SESSION['AuditStamp'] = $audit->AuditStamp;
class PDF extends FPDF