$audit->GetLastAudit(); $tmpUser = new People(); $tmpUser->UserID = $audit->UserID; $tmpUser->GetUserRights(); $audit->UserID = $tmpUser->FirstName == "" && $tmpUser->LastName == "" ? $audit->UserID : $tmpUser->FirstName . " " . $tmpUser->LastName; // Give it back to the user to update the page header('Content-Type: application/json'); echo json_encode($audit); exit; } $audit->AuditStamp = __("Never"); $audit->GetLastAudit(); if ($audit->UserID != "") { $tmpUser = new People(); $tmpUser->UserID = $audit->UserID; $tmpUser->GetUserRights(); $AuditorName = $tmpUser->FirstName . " " . $tmpUser->LastName; } $pdu->CabinetID = $cab->CabinetID; $PDUList = $pdu->GetPDUbyCabinet(); $dev->Cabinet = $cab->CabinetID; $devList = $dev->ViewDevicesByCabinet(); $search = new Device(); $search->Cabinet = $cab->CabinetID; $search->DeviceType = "Sensor"; $SensorList = $search->Search(); $stats = $cab->getStats($cab->CabinetID); $totalWatts = $stats->Wattage; $totalWeight = $stats->Weight; $totalMoment = 0; if ($config->ParameterArray["ReservedColor"] != "#FFFFFF" || $config->ParameterArray["FreeSpaceColor"] != "#FFFFFF") {
static function Current() { $cperson = new People(); if (php_sapi_name() == "cli") { // If the script is being called from the command line, just give God priveleges and be done with it $cperson->UserID = "cli_admin"; $cperson->ReadAccess = true; $cperson->WriteAccess = true; $cperson->SiteAdmin = true; $cperson->Disabled = false; } elseif (AUTHENTICATION == "Apache") { if (!isset($_SERVER["REMOTE_USER"])) { return false; } $cperson->UserID = $_SERVER['REMOTE_USER']; $cperson->GetUserRights(); } elseif (AUTHENTICATION == "Oauth") { if (!isset($_SESSION['userid'])) { return false; } $cperson->UserID = $_SESSION['userid']; $cperson->GetUserRights(); } return $cperson; }
/** * Return the auditor's name. * * @param Cabinet $cab * @param string|null $emptyVal * @return string|null */ function getAuditorName($cab, $emptyVal = null) { $auditorName = $emptyVal; $cab_audit = new CabinetAudit(); $cab_audit->CabinetID = $cab->CabinetID; $cab_audit->GetLastAudit(); if ($cab_audit->UserID) { $tmpUser = new People(); $tmpUser->UserID = $cab_audit->UserID; $tmpUser->GetUserRights(); $auditorName = $tmpUser->LastName . ", " . $tmpUser->FirstName; } return $auditorName; }
$userRights->SiteAdmin = isset($_POST['SiteAdmin']) ? 1 : 0; $userRights->Disabled = isset($_POST['Disabled']) ? 1 : 0; if ($_POST['action'] == 'Create') { $userRights->CreatePerson(); // We've, hopefully, successfully created a new device. Force them to the new device page. header('Location: ' . redirect("usermgr.php?PersonID={$userRights->PersonID}")); exit; } else { $status = __("Updated"); $userRights->UpdatePerson(); } } else { //Should we ever add a delete user function it will go here } // Reload rights because actions like disable reset other rights $userRights->GetUserRights(); } $userList = $userRights->GetUserList(); $adminown = $userRights->AdminOwnDevices ? "checked" : ""; $read = $userRights->ReadAccess ? "checked" : ""; $write = $userRights->WriteAccess ? "checked" : ""; $delete = $userRights->DeleteAccess ? "checked" : ""; $contact = $userRights->ContactAdmin ? "checked" : ""; $request = $userRights->RackRequest ? "checked" : ""; $RackAdmin = $userRights->RackAdmin ? "checked" : ""; $admin = $userRights->SiteAdmin ? "checked" : ""; $Disabled = $userRights->Disabled ? "checked" : ""; ?> <!doctype html> <html> <head>
$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 { var $outlines = array(); var $OutlineRoot; var $pdfconfig; function PDF() { parent::FPDF('L');