Пример #1
0
function ewUploadPathEx($PhyPath, $DestPath)
{
    global $ewPathDelimiter;
    if ($PhyPath) {
        $Path = ewAppRoot();
        $Path .= str_replace("/", $ewPathDelimiter, $DestPath);
    } else {
        $Path = EW_RootRelativePath;
        $Path = str_replace("\\\\", "/", $Path);
        $Path = str_replace("\\", "/", $Path);
        $Path = ewIncludeTrailingDelimiter($Path, false) . $DestPath;
    }
    return ewIncludeTrailingDelimiter($Path, $PhyPath);
}
Пример #2
0
function ewWriteAuditTrail($pfx, $curDate, $curTime, $id, $user, $action, $table, $field, $keyvalue, $oldvalue, $newvalue)
{
    global $ewPathDelimiter;
    $sFolder = "audit/";
    $sFolder = str_replace("/", $ewPathDelimiter, $sFolder);
    $ewFilePath = ewAppRoot() . $sFolder;
    $sTab = "\t";
    $sHeader = "date" . $sTab . "time" . $sTab . "id" . $sTab . "user" . $sTab . "action" . $sTab . "table" . $sTab . "field" . $sTab . "key value" . $sTab . "old value" . $sTab . "new value";
    $sMsg = $curDate . $sTab . $curTime . $sTab . $id . $sTab . $user . $sTab . $action . $sTab . $table . $sTab . $field . $sTab . $keyvalue . $sTab . $oldvalue . $sTab . $newvalue;
    $sFn = $pfx . "_" . date("Ymd") . ".txt";
    $filename = $ewFilePath . $sFn;
    if (file_exists($filename)) {
        $fileHandler = fopen($filename, "a+b");
    } else {
        $fileHandler = fopen($filename, "a+b");
        fwrite($fileHandler, $sHeader . "\r\n");
    }
    fwrite($fileHandler, $sMsg . "\r\n");
    fclose($fileHandler);
}