diff --git a/README.md b/README.md index 1affbd3..869461b 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,14 @@ git clone https://git.kaz.bzh/KAZ/depollueur.git make -j $(nproc) ``` + +##Astuces + + +Pour la mise au point dans Kaz, il faut bloquer la mise à jour automatique avec : + +``` bash +touch /kaz/git/depollueur/dontupdage +/kaz/bin/container.sh stop jirafeau postfix; docker system prune; /kaz/bin/install.sh jirafeau postfix +``` + diff --git a/src/Jirafeau/a.php b/src/Jirafeau/a.php index 736b1fa..26f4c72 100644 --- a/src/Jirafeau/a.php +++ b/src/Jirafeau/a.php @@ -12,6 +12,7 @@ a.php?s=mel@domain.org&t=password + [action] => manage account action: a=login a=logout a=r[on|off] a=p[minute|hour|day|week|month|quarter] */ + use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; @@ -748,10 +749,17 @@ if ($doDownload) { $modif = true; continue; } - $srcName = $dstName = ($link ['file_name'] ? $link ['file_name'] : M_NO_FILENAME); - if (in_array ($srcName, $singleName)) - for ($i = 0; $i < 10000; ++$i) { - $dstName = sprintf ("%s-%2d", $srcName, $i); + $dstName = ($link ['file_name'] ? $link ['file_name'] : M_NO_FILENAME); + if (in_array ($dstName, $singleName)) { + $dstFilename = $dstName; + $dstExtension = ""; + $dstExtensionPos = strrpos ($dstName, '.'); + if ($dstExtensionPos) { + $dstFilename = substr ($dstName, 0, $dstExtensionPos); + $dstExtension = substr ($dstName, $dstExtensionPos); + } + for ($i = 1; $i < 10000; ++$i) { + $dstName = sprintf ("%s-%02d%s", $dstFilename, $i, $dstExtension); if (!in_array ($dstName, $singleName)) { if (isset ($archiveContent [T_RENAME])) ++$archiveContent [T_RENAME]; @@ -761,6 +769,7 @@ if ($doDownload) { break; } } + } $singleName [] = $dstName; $archiveContent [$cat][T_ENTRIES][] = [T_HASH => $link ['hash'], T_FILENAME => $dstName, T_CRYPT_KEY => $cryptKey, T_CRYPTED => $link ['crypted']]; } @@ -1080,6 +1089,15 @@ echo ' '. + ''. + ''. + '