function ew_WriteAuditTrailOnLogInOut($logtype) { $table = $logtype; $sKey = ""; // Write Audit Trail $filePfx = "log"; $curDate = date("Y/m/d"); $curTime = date("H:i:s"); $id = ew_ScriptName(); $user = CurrentUserName(); $action = $logtype; ew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $user, $action, $table, "", "", "", ""); }
function CurrentUserInfo($fldname) { global $Security; if (isset($Security)) { return $Security->CurrentUserInfo($fldname); } elseif (defined("EW_USER_TABLE") && !IsSysAdmin()) { $user = CurrentUserName(); if (strval($user) != "") { return ew_ExecuteScalar("SELECT " . ew_QuotedName($fldname) . " FROM " . EW_USER_TABLE . " WHERE " . str_replace("%u", ew_AdjustSql($user), EW_USER_NAME_FILTER)); } } return NULL; }
function WriteAuditTrailOnDelete(&$rs) { if (!$this->AuditTrailOnDelete) { return; } $table = 'montos'; // Get key value $key = ""; if ($key != "") { $key .= $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"]; } $key .= $rs['id']; // Write Audit Trail $dt = ew_StdCurrentDateTime(); $id = ew_ScriptName(); $curUser = CurrentUserName(); foreach (array_keys($rs) as $fldname) { if (array_key_exists($fldname, $this->fields) && $this->fields[$fldname]->FldDataType != EW_DATATYPE_BLOB) { // Ignore BLOB fields if ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { if (EW_AUDIT_TRAIL_TO_DATABASE) { $oldvalue = $rs[$fldname]; } else { $oldvalue = "[MEMO]"; } // Memo field } elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) { $oldvalue = "[XML]"; // XML field } else { $oldvalue = $rs[$fldname]; } ew_WriteAuditTrail("log", $dt, $id, $curUser, "D", $table, $fldname, $key, $oldvalue, ""); } } }