fix setSenderFake
This commit is contained in:
parent
1f2bfec83a
commit
77c1bb84bd
@ -152,8 +152,9 @@ function rmSenderTrack ($sender) {
|
||||
}
|
||||
function getSenderTrack ($sender) {
|
||||
if (!$sender)
|
||||
return;
|
||||
return file_exists (VAR_TRACKS.$sender);
|
||||
return false;
|
||||
return false;
|
||||
//return file_exists (VAR_TRACKS.$sender);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
@ -210,12 +211,21 @@ function period2seconds ($periodName) {
|
||||
}
|
||||
|
||||
// ========================================
|
||||
function setSenderFake ($sender, $dirLink, $dirTime) {
|
||||
function setSenderFake ($error, $sender, $owner, $dirLink, $dirTime, $fileName, $fileTime) {
|
||||
if (!$sender)
|
||||
return;
|
||||
if (!file_exists (VAR_FAKE))
|
||||
mkdir (VAR_FAKE, 0755);
|
||||
file_put_contents (VAR_FAKE.$sender, "time: ".$dirTime.NL."sender: ".$sender.NL);
|
||||
file_put_contents (VAR_FAKE.$sender,
|
||||
"time: ".time ().NL.
|
||||
"date: ".date ("Y-m-d H:i:s").NL.
|
||||
"error: ".$error.NL.
|
||||
"sender: ".$sender.NL.
|
||||
"owner: ".$owner.NL.
|
||||
"dirLink: ".$dirLink.NL.
|
||||
"dirTime: ".$dirTime.NL.
|
||||
"fileTime: ".$fileTime.NL);
|
||||
"fileName: ".$fileName.NL.
|
||||
rmToken ($sender);
|
||||
}
|
||||
function getSenderFake ($sender) {
|
||||
@ -245,12 +255,12 @@ function readArchiveFromLines ($lines) {
|
||||
switch (true) {
|
||||
case preg_match ("/^\s*id:\s*(\d++)\s*$/", $line, $matches):
|
||||
$archive [T_ID] = $matches [1];
|
||||
case preg_match ("/^\s*sender:\s*(([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6})\s*$/i", $line, $matches):
|
||||
$archive [T_SENDER] = $matches [1];
|
||||
break;
|
||||
case preg_match ("/^\s*time:\s*(\d{4}([:-]\d{2}){5})\s*$/i", $line, $matches):
|
||||
$archive [T_TIME] = $matches [1];
|
||||
break;
|
||||
case preg_match ("/^\s*sender:\s*(([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6})\s*$/i", $line, $matches):
|
||||
$archive [T_SENDER] = $matches [1];
|
||||
break;
|
||||
case preg_match ("/^\s*new:\s*([0-9a-zA-Z_-]+)\s+([0-9a-zA-Z_-]+)\s*$/", $line, $matches):
|
||||
$archive [T_NEW][] = [$matches [1], $matches [2]];
|
||||
break;
|
||||
@ -729,8 +739,8 @@ function deleteAction ($linkName) {
|
||||
if (! count ($archiveInfo))
|
||||
return;
|
||||
if ($sender != $archiveInfo [T_SENDER]) {
|
||||
setSenderFake ($sender, $dirLink, $dirTime);
|
||||
$message .= "Tentative de supprimer un envoi dont vous n'êtes pas le propriétaire. (".$sender." != ".$archiveInfo [T_SENDER].")";
|
||||
setSenderFake ("rmdir: not owner", $sender, $archiveInfo [T_SENDER], $dirLink, $dirTime, null, null);
|
||||
$message .= "Tentative de supprimer un envoi dont vous n'êtes pas le propriétaire";
|
||||
$doLogout = true;
|
||||
return;
|
||||
}
|
||||
@ -742,11 +752,11 @@ function deleteAction ($linkName) {
|
||||
continue;
|
||||
$fileTime = $fileLink ['upload_date'];
|
||||
if (! valideTime ($dirTime, $fileTime)) {
|
||||
setSenderFake ($sender, $dirLink, $dirTime);
|
||||
setSenderFake ("rmdir: newfile not same time", $sender, null, $dirLink, $dirTime, $fileLink ['file_name'], $fileTime);
|
||||
$message .= "Cet envoi a été forgée".
|
||||
str_replace (["___FILENAME___", "___DIRTIME___", "___FILETIME___"],
|
||||
[$fileLink ['file_name'], $dirTime , $fileTime], M_INCONSISTENT_DATES);
|
||||
$doLogout = true;
|
||||
//$doLogout = true;
|
||||
return;
|
||||
}
|
||||
$fileToDelete = true;
|
||||
@ -817,22 +827,22 @@ function deleteAction ($linkName) {
|
||||
$message .= ".";
|
||||
break;
|
||||
}
|
||||
setSenderFake ($sender, $dirLink, $dirTime);
|
||||
setSenderFake ("rm: dir not same time", $sender, null, $dirLink, $dirTime, $fileLink ['file_name'], $fileTime);
|
||||
$message .= "Cet envoi a été forgée. ".
|
||||
str_replace (["___FILENAME___", "___DIRTIME___", "___FILETIME___"],
|
||||
[$fileLink ['file_name'], $dirTime , $fileTime], M_INCONSISTENT_DATES);
|
||||
$dologout = true;
|
||||
//$dologout = true;
|
||||
break;
|
||||
}
|
||||
if (valideTime ($dirTime, $fileTime)) {
|
||||
setSenderFake ($sender, $dirLink, $dirTime);
|
||||
setSenderFake ("rm: not owner", $sender, $archiveInfo [T_SENDER], $dirLink, $dirTime, $fileLink ['file_name'], $fileTime);
|
||||
$message .= "Tentative de supprimer un envoi dont vous n'êtes pas le propriétaire.".
|
||||
str_replace (["___FILENAME___", "___DIRTIME___", "___FILETIME___"],
|
||||
[$fileLink ['file_name'], $dirTime , $fileTime], M_INCONSISTENT_DATES);
|
||||
$doLogout = true;
|
||||
//$doLogout = true;
|
||||
break;
|
||||
}
|
||||
setSenderFake ($archiveInfo [T_SENDER], $dirLink, $dirTime);
|
||||
setSenderFake ("rm: find not owner", $archiveInfo [T_SENDER], $sender, $dirLink, $dirTime, $fileLink ['file_name'], $fileTime);
|
||||
$message .= "Quelqu'un avétait revandiqué cet envoi. (".$sender." != ".$archiveInfo [T_SENDER].")";
|
||||
break;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ mkdir -p "${REP_PIECE_JOINTE}/"
|
||||
>"${ARCHIVE_CONTENT}"
|
||||
|
||||
# Etape de rafraichissement des anciens fichiers inclus
|
||||
echo "time: ${DATE_TEMPS}" > "${ARCHIVE_CONTENT}"
|
||||
echo -e "time: ${DATE_TEMPS}\nid: $(date +%s)" > "${ARCHIVE_CONTENT}"
|
||||
[ -n "${TRACK}" ] && echo "sender: ${MAIL_SOURCE}" >> "${ARCHIVE_CONTENT}"
|
||||
|
||||
LOG_FIC "${SHRINK_CMD} -u \"${INSPECT_DIR}/in.$$\" 2>> \"${FIC_LOG}\" > \"${OLD_LINKS}\""
|
||||
|
Loading…
Reference in New Issue
Block a user