From c741d57c49d9ae7ccb28b5d8fa0d3dfaed897e1b Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Nov 2020 10:47:13 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20probl=C3=A8me=20UTF8=20dans=20la?= =?UTF-8?q?=20sauvegarde=20des=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + functions.php | 36 ++++++++++++++++++------------------ index.php | 4 ++++ templateTab/index.html | 14 +++++++------- 4 files changed, 30 insertions(+), 25 deletions(-) mode change 100755 => 100644 templateTab/index.html diff --git a/README.md b/README.md index dafc9b2..8d6190a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Pour le daemon, le script ini.d se trouve dans *init.d/lighten-mailbox* ## Changelog * Futur : + * Orientation "serveur dédier" limiter a une liste de @domaine et ou un serveur * BUG index.html si eml masque lien des archives ! * MAX usage... par IP et/ou cookies... ? (pour éviter que le service ne soit détourné) * Estimer temps/durée (avant validation) diff --git a/functions.php b/functions.php index d2f5c10..6ebb5ba 100644 --- a/functions.php +++ b/functions.php @@ -301,31 +301,31 @@ function jsonMessage($mod, $idClean, $parser, $header, $messageEML, $folder, $fo } $arrayTmp['senderaddress']=''; if (isset($header->senderaddress)) { - $arrayTmp['senderaddress']=$header->senderaddress; + $arrayTmp['senderaddress']=imap_utf8($header->senderaddress); } $arrayTmp['fromaddress']=''; if (isset($header->fromaddress)) { - $arrayTmp['fromaddress']=$header->fromaddress; + $arrayTmp['fromaddress']=imap_utf8($header->fromaddress); } $arrayTmp['toaddress']=''; if (isset($header->toaddress)) { - $arrayTmp['toaddress']=$header->toaddress; + $arrayTmp['toaddress']=imap_utf8($header->toaddress); } $arrayTmp['ccaddress']=''; if (isset($header->ccaddress)) { - $arrayTmp['ccaddress']=$header->ccaddress; + $arrayTmp['ccaddress']=imap_utf8($header->ccaddress); } $arrayTmp['bccaddress']=''; if (isset($header->bccaddress)) { - $arrayTmp['bccaddress']=$header->bccaddress; + $arrayTmp['bccaddress']=imap_utf8($header->bccaddress); } $arrayTmp['reply_toaddress']=''; if (isset($header->reply_toaddress)) { - $arrayTmp['reply_toaddress']=$header->reply_toaddress; + $arrayTmp['reply_toaddress']=imap_utf8($header->reply_toaddress); } $arrayTmp['return_pathaddress']=''; if (isset($header->return_pathaddress)) { - $arrayTmp['return_pathaddress']=$header->return_pathaddress; + $arrayTmp['return_pathaddress']=imap_utf8($header->return_pathaddress); } $arrayTmp['references']=''; if (isset($header->references)) { @@ -333,7 +333,7 @@ function jsonMessage($mod, $idClean, $parser, $header, $messageEML, $folder, $fo } $arrayTmp['in_reply_to']=''; if (isset($header->in_reply_to)) { - $arrayTmp['in_reply_to']=$header->in_reply_to; + $arrayTmp['in_reply_to']=imap_utf8($header->in_reply_to); } $arrayTmp['msgno']=''; if (isset($header->Msgno)) { @@ -422,29 +422,29 @@ function saveMessage($session_id, $idClean, $parser, $header, $messageEML, $fold $headerHtml.='

Date : '.$header->date.'

'; } if (isset($header->senderaddress)) { - $headerTxt.='Sender : '.$header->senderaddress.' + $headerTxt.='Sender : '.imap_utf8($header->senderaddress).' '; - $headerHtml.='

Sender : '.$header->senderaddress.'

'; + $headerHtml.='

Sender : '.imap_utf8($header->senderaddress).'

'; } if (isset($header->fromaddress)) { - $headerTxt.='From : '.$header->fromaddress.' + $headerTxt.='From : '.imap_utf8($header->fromaddress).' '; - $headerHtml.='

From : '.$header->fromaddress.'

'; + $headerHtml.='

From : '.imap_utf8($header->fromaddress).'

'; } if (isset($header->toaddress)) { - $headerTxt.='To : '.$header->toaddress.' + $headerTxt.='To : '.imap_utf8($header->toaddress).' '; - $headerHtml.='

To : '.$header->toaddress.'

'; + $headerHtml.='

To : '.imap_utf8($header->toaddress).'

'; } if (isset($header->ccaddress)) { - $headerTxt.='Cc : '.$header->ccaddress.' + $headerTxt.='Cc : '.imap_utf8($header->ccaddress).' '; - $headerHtml.='

Cc : '.$header->ccaddress.'

'; + $headerHtml.='

Cc : '.imap_utf8($header->ccaddress).'

'; } if (isset($header->subject)) { - $headerTxt.='Bcc : '.imap_utf8($header->subject).' + $headerTxt.='Subject : '.imap_utf8($header->subject).' '; - $headerHtml.='

Bcc : '.imap_utf8($header->subject).'

'; + $headerHtml.='

Subject : '.imap_utf8($header->subject).'

'; } if (count($attachments) != 0) { $headerTxt.='Attachments :'; diff --git a/index.php b/index.php index d0775b4..ef54b04 100644 --- a/index.php +++ b/index.php @@ -167,6 +167,10 @@ if (isset($_GET['DeleteApproval']) && isset($_GET['session_id'])) {

Maintenance mode ON

'; + } + if ($config['maintenance']['active'] == true && $_SERVER["REMOTE_ADDR"] != $config['maintenance']['ipForTest']) { echo '

'.$config['maintenance']['publicMsg'].'

'; } elseif (isset($_GET['session_id'])) { diff --git a/templateTab/index.html b/templateTab/index.html old mode 100755 new mode 100644 index c4df0d4..39a1592 --- a/templateTab/index.html +++ b/templateTab/index.html @@ -188,30 +188,30 @@ switch (value) { case 'msgno': case 'size': - table.addColumn({title:name, field:value, sorter:"number", align:"center", headerFilter:"number", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false); + table.addColumn({title:name, field:value, sorter:"number", align:"center", headerFilter:"number", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false); break; case 'udate': table.addColumn({title:name, field:value, align:"center", formatter:"datetime", formatterParams:{ inputFormat:"X", outputFormat:"DD/MM/YY HH:m", invalidPlaceholder:"(invalid date)", - }, headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false); + }, headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false); break; case 'date': - table.addColumn({title:name, field:value, align:"center", headerFilter:dateFilterEditor, headerFilterFunc:dateFilterFunction, headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false); + table.addColumn({title:name, field:value, align:"center", headerFilter:dateFilterEditor, headerFilterFunc:dateFilterFunction, headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false); break; case 'answered': case 'flagged': //case 'attachments': - table.addColumn({title:name, field:value, align:"center", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }, formatter:printIcon, headerFilter:"tickCross", headerFilterParams:{"tristate":true},headerFilterEmptyCheck:function(value){return value === null}}, false); + table.addColumn({title:name, field:value, align:"center", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }, formatter:printIcon, headerFilter:"tickCross", headerFilterParams:{"tristate":true},headerFilterEmptyCheck:function(value){return value === null}}, false); break; case 'subject': - table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }, responsive:2}, false); + table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }, responsive:2}, false); case 'fromaddress': - table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false); + table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false); break; default: - table.addColumn({title:name, field:value, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false); + table.addColumn({title:name, field:value, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false); } }