本文整理汇总了PHP中LogActions::LogThis方法的典型用法代码示例。如果您正苦于以下问题:PHP LogActions::LogThis方法的具体用法?PHP LogActions::LogThis怎么用?PHP LogActions::LogThis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogActions
的用法示例。
在下文中一共展示了LogActions::LogThis方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Miscellaneous
function Miscellaneous()
{
$this->MakeSafe();
$tmpDCEventLog = new DCEventLog();
$tmpDCEventLog->DataCenterID = $this->DataCenterID;
class_exists('LogActions') ? LogActions::LogThis($this, $tmpDCEventLog) : '';
}
示例2: CreateDevice
function CreateDevice()
{
global $dbh;
$this->MakeSafe();
$this->Label = transform($this->Label);
$this->SerialNo = transform($this->SerialNo);
$this->AssetTag = transform($this->AssetTag);
$sql = "INSERT INTO fac_Device SET Label=\"{$this->Label}\", SerialNo=\"{$this->SerialNo}\", AssetTag=\"{$this->AssetTag}\", \n\t\t\t\t\tPrimaryIP=\"{$this->PrimaryIP}\", SNMPCommunity=\"{$this->SNMPCommunity}\", ESX={$this->ESX}, Owner={$this->Owner}, \n\t\t\t\t\tEscalationTimeID={$this->EscalationTimeID}, EscalationID={$this->EscalationID}, PrimaryContact={$this->PrimaryContact}, \n\t\t\t\t\tCabinet={$this->Cabinet}, Position={$this->Position}, Height={$this->Height}, Ports={$this->Ports}, \n\t\t\t\t\tFirstPortNum={$this->FirstPortNum}, TemplateID={$this->TemplateID}, NominalWatts={$this->NominalWatts}, \n\t\t\t\t\tPowerSupplyCount={$this->PowerSupplyCount}, DeviceType=\"{$this->DeviceType}\", ChassisSlots={$this->ChassisSlots}, \n\t\t\t\t\tRearChassisSlots={$this->RearChassisSlots},ParentDevice={$this->ParentDevice}, \n\t\t\t\t\tMfgDate=\"" . date("Y-m-d", strtotime($this->MfgDate)) . "\", \n\t\t\t\t\tInstallDate=\"" . date("Y-m-d", strtotime($this->InstallDate)) . "\", WarrantyCo=\"{$this->WarrantyCo}\", \n\t\t\t\t\tWarrantyExpire=\"" . date("Y-m-d", strtotime($this->WarrantyExpire)) . "\", Notes=\"{$this->Notes}\", \n\t\t\t\t\tReservation={$this->Reservation}, HalfDepth={$this->HalfDepth}, BackSide={$this->BackSide};";
if (!$dbh->exec($sql)) {
$info = $dbh->errorInfo();
error_log("PDO Error: {$info[2]} SQL={$sql}");
return false;
}
$this->DeviceID = $dbh->lastInsertId();
class_exists('LogActions') ? LogActions::LogThis($this) : '';
return $this->DeviceID;
}
示例3: RemoveFromTemplatesAndDevices
function RemoveFromTemplatesAndDevices()
{
global $dbh;
$this->AttributeID = intval($this->AttributeID);
$sql = "DELETE FROM fac_DeviceTemplateCustomValue WHERE AttributeID={$this->AttributeID};";
if (!$dbh->query($sql)) {
$info = $dbh->errorInfo();
error_log("RemoveDeviceCustomAttribute::PDO Error: {$info[2]} SQL={$sql}");
return false;
}
$sql = "DELETE FROM fac_DeviceCustomValue WHERE AttributeID={$this->AttributeID};";
if (!$dbh->query($sql)) {
$info = $dbh->errorInfo();
error_log("RemoveDeviceCustomAttribute::PDO Error: {$info[2]} SQL={$sql}");
return false;
}
class_exists('LogActions') ? LogActions::LogThis($this) : '';
return true;
}
示例4: MakeConnection
function MakeConnection()
{
global $dbh;
$this->MakeSafe();
$sql = "INSERT INTO fac_PanelSchedule SET PanelID={$this->PanelID}, \n\t\t\tPolePosition={$this->PolePosition}, NumPoles={$this->NumPoles}, \n\t\t\tLabel=\"{$this->Label}\" ON DUPLICATE KEY UPDATE Label=\"{$this->Label}\", \n\t\t\tNumPoles={$this->NumPoles};";
class_exists('LogActions') ? LogActions::LogThis($this) : '';
return $dbh->query($sql);
}
示例5: date
if (isset($_POST['audit'])) {
$dev->DeviceID = $_POST['audit'];
$dev->Audit();
$dev->AuditStamp = date('r', strtotime($dev->AuditStamp));
header('Content-Type: application/json');
echo json_encode($dev);
exit;
}
if (isset($_POST['olog'])) {
$dev->DeviceID = $_POST['devid'];
$dev->GetDevice();
$dev->OMessage = sanitize($_POST['olog']);
$tmpDev = new Device();
$tmpDev->DeviceID = $dev->DeviceID;
$tmpDev->GetDevice();
$return = class_exists('LogActions') && $tmpDev->Rights == "Write" ? LogActions::LogThis($dev, $tmpDev) : false;
header('Content-Type: application/json');
echo json_encode($return);
exit;
}
// Set all ports to the same Label pattern, media type or color code
if (isset($_POST['setall'])) {
$portnames = array();
if (isset($_POST['spn']) && strlen($_POST['spn']) > 0) {
// Special Condition to load ports from the device template and use those names
if ($_POST['spn'] == __("From Template") || $_POST['spn'] == __("Invert Port Labels")) {
$dev->DeviceID = $_POST['devid'];
$dev->GetDevice();
if ($_POST['spn'] == __("From Template")) {
$ports = isset($_POST['power']) ? new TemplatePowerPorts() : new TemplatePorts();
$ports->TemplateID = $dev->TemplateID;
示例6: UpdatePeriod
function UpdatePeriod()
{
$this->MakeSafe();
$oldperiod = new EscalationTimes();
$oldperiod->EscalationTimeID = $this->EscalationTimeID;
$oldperiod->GetEscalationTime();
$sql = "UPDATE fac_EscalationTimes SET TimePeriod=\"{$this->TimePeriod}\" WHERE \n\t\t\tEscalationTimeID={$this->EscalationTimeID};";
class_exists('LogActions') ? LogActions::LogThis($this, $oldperiod) : '';
return $this->query($sql);
}
示例7: removePort
function removePort()
{
/* Remove a single port from a template */
global $dbh;
if (!$this->getport()) {
return false;
}
$sql = "DELETE FROM fac_TemplatePowerPorts WHERE TemplateID={$this->TemplateID} AND PortNumber={$this->PortNumber};";
if (!$dbh->query($sql)) {
//delete failed, wtf
return false;
} else {
class_exists('LogActions') ? LogActions::LogThis($this) : '';
return true;
}
}
示例8: UpdateUser
function UpdateUser()
{
global $dbh;
$this->MakeSafe();
$olduser = new User();
$olduser->UserID = $this->UserID;
$olduser->GetUserRights();
/* Update a user record based upon the current object attribute values, with UserID as key. */
$sql = "UPDATE fac_User SET Name=\"{$this->Name}\", ReadAccess={$this->ReadAccess}, \n\t\t\tAdminOwnDevices={$this->AdminOwnDevices}, WriteAccess={$this->WriteAccess}, \n\t\t\tDeleteAccess={$this->DeleteAccess}, ContactAdmin={$this->ContactAdmin}, \n\t\t\tRackRequest={$this->RackRequest}, RackAdmin={$this->RackAdmin}, \n\t\t\tSiteAdmin={$this->SiteAdmin}, Disabled={$this->Disabled} \n\t\t\tWHERE UserID=\"{$this->UserID}\";";
$this->MakeDisplay();
class_exists('LogActions') ? LogActions::LogThis($this, $olduser) : '';
return $dbh->exec($sql);
}