From 75662dd42483b9f8819999f6067aa5958b1291e3 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 29 Aug 2024 11:42:26 +0200 Subject: [PATCH] * Mail: show s/mime signed/encrypted icons in mail display popup (verification is only shown in preview!) --- api/src/Etemplate/Widget/Image.php | 4 ++-- api/src/Mail.php | 4 +++- mail/inc/class.mail_ui.inc.php | 6 ++++++ mail/js/app.js | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/api/src/Etemplate/Widget/Image.php b/api/src/Etemplate/Widget/Image.php index f77067f082..7375c4b44c 100644 --- a/api/src/Etemplate/Widget/Image.php +++ b/api/src/Etemplate/Widget/Image.php @@ -40,7 +40,7 @@ class Image extends Etemplate\Widget if (empty($app) || empty($img) || !is_dir(EGW_SERVER_ROOT.'/'.$app) || strpos($img,'/')!==false) { $img = $image; - list($app) = explode('.',$form_name); + list($app) = explode('.', self::$request->template['name']); } $src = Api\Image::find($app, $img); /*if(!$this->id) @@ -49,4 +49,4 @@ class Image extends Etemplate\Widget }*/ self::setElementAttribute($this->attrs['src'], 'src', $src); } -} +} \ No newline at end of file diff --git a/api/src/Mail.php b/api/src/Mail.php index 422de3e5b9..bdc0b3d8cc 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -5479,6 +5479,7 @@ class Mail else { $fquery->headerText(array('peek'=>$preserveUnSeen)); + $fquery->structure(); } $fquery->size(); @@ -5489,9 +5490,9 @@ class Mail foreach($headersNew as $_fetchObject) { $headers = $_fetchObject->getHeaderText(0,Horde_Imap_Client_Data_Fetch::HEADER_PARSE); + $mailStructureObject = $_fetchObject->getStructure(); if ($_partID != '') { - $mailStructureObject = $_fetchObject->getStructure(); foreach ($mailStructureObject->contentTypeMap() as $mime_id => $mime_type) { if ($mime_id==$_partID) @@ -5512,6 +5513,7 @@ class Mail } $retValue = is_object($headers) ? $headers->toArray():array(); if ($size) $retValue['size'] = $size; + $retValue['smimeType'] = Mail\Smime::getSmimeType($mailStructureObject); } $retValue = array_change_key_case($retValue,CASE_UPPER); //error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue)); diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index dc8982d3b2..745a90fba1 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2324,6 +2324,12 @@ $filter['before']= date("d-M-Y", $cutoffdate2); $content['mail_id']=$rowID; + if ($headers['SMIMETYPE']) + { + $content['smime'] = Mail\Smime::isSmimeSignatureOnly($headers['SMIMETYPE'])? + Mail\Smime::TYPE_SIGN : Mail\Smime::TYPE_ENCRYPT; + } + // DRAG attachments actions $etpl->setElementAttribute('mail_displayattachments', 'actions', array( 'file_drag' => array( diff --git a/mail/js/app.js b/mail/js/app.js index 3ac2ede022..58784597a3 100755 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2423,9 +2423,9 @@ app.classes.mail = AppJS.extend( // Check if this is a top level node and // change profile if server has changed var server = _folder.split('::'); - var previousServer = _previous.split('::'); + var previousServer = _previous?.split('::'); var profile_selected = (_folder.indexOf('::') === -1); - if (server[0] != previousServer[0] && profile_selected) + if ((!previousServer || server[0] != previousServer[0]) && profile_selected) { // mail_changeProfile triggers a refresh, no need to do any more return this.mail_changeProfile(_folder,_widget, _widget.getSelectedNode().childsCount == 0);