YaWK  24.1
Yet another WebKit
webmail-message.php
Go to the documentation of this file.
1 <script src="../system/engines/jquery/dropzone/dropzone.js"></script>
2 <link href="../system/engines/jquery/dropzone/dropzone.css" rel="stylesheet">
3 <script src="../system/engines/jquery/lightbox2/js/lightbox.min.js"></script>
4 <link rel="stylesheet" href="../system/engines/jquery/lightbox2/css/lightbox.min.css" type="text/css" media="all">
5 <?php
6 
7 use YAWK\alert;
8 use YAWK\backend;
9 use YAWK\db;
10 use YAWK\editor;
12 use YAWK\language;
13 use YAWK\settings;
14 
15 /** @var $db db */
16 /** @var $lang language */
17 
18 // import editor class + load editor settings
19 require_once '../system/classes/editor.php';
20 $editorSettings = settings::getEditorSettings($db, 14);
21 $editorSettings['editorHeight'] = "180";
22 editor::loadJavascript($editorSettings);
23 editor::setEditorSettings($editorSettings);
24 
25  // require_once "../system/engines/imapClient/AdapterForOutgoingMessage.php";
26  // require_once "../system/engines/imapClient/Helper.php";
27  require_once "../system/engines/imapClient/ImapClient.php";
28  require_once "../system/engines/imapClient/ImapClientException.php";
29  require_once "../system/engines/imapClient/ImapConnect.php";
30  require_once "../system/engines/imapClient/IncomingMessage.php";
31  require_once "../system/engines/imapClient/IncomingMessageAttachment.php";
32  // require_once "../system/engines/imapClient/OutgoingMessage.php";
33  require_once "../system/engines/imapClient/Section.php";
34  require_once "../system/engines/imapClient/SubtypeBody.php";
35  require_once "../system/engines/imapClient/TypeAttachments.php";
36  require_once "../system/engines/imapClient/TypeBody.php";
37 
38  // let php know we need these classes:
39  use SSilence\ImapClient\ImapClientException;
40  use SSilence\ImapClient\ImapClient as Imap;
41 use YAWK\sys;
42 use YAWK\webmail;
43 
44 // get all webmail setting values into an array
45  $webmailSettings = settings::getValueSettingsArray($db, "webmail_");
46 
47 if ($webmailSettings['webmail_active'] == true)
48 {
49  // mailbox server (imap.server.com)
50  $server = $webmailSettings['webmail_imap_server'];
51  // mailbox user ([email protected])
52  $username = $webmailSettings['webmail_imap_username'];
53  // mailbox password
54  $password = $webmailSettings['webmail_imap_password'];
55  // encryption type (ssl, tsl, null)
56  $encryption = "/" . $webmailSettings['webmail_imap_encrypt'];
57  // port (default: 993)
58  $port = ":" . $webmailSettings['webmail_imap_port'];
59 
60  // include webmail class
61  require_once "../system/classes/webmail.php";
62  // create new webmail object
63  $webmail = new webmail();
64 
65  try // open connection to imap server
66  { // create new imap object
67  $imap = new Imap($server.$port.$encryption, $username, $password, $encryption);
68  // store the connection
69  $imap->connection = $imap->getImapConnection();
70 
71  // webmail page called with parameter - user requested a folder
72  if (isset($_GET['folder']) && (!empty($_GET['folder']) && (is_string($_GET['folder']))))
73  { // select requested folder
74  $imap->selectFolder($_GET['folder']);
75  // set current folder string
76  $imap->currentFolder = $_GET['folder'];
77  }
78  else // webmail page called w/o any parameters
79  { // select default folder
80  $imap->selectFolder('INBOX');
81  $imap->currentFolder = "INBOX";
82  }
83  }
84 
85  // open imap connection failed...
86  catch (ImapClientException $error)
87  { // no errors in production
88  $webmail->connectionInfo = $error->getMessage() . PHP_EOL;
89  // exit with error
90  die('oh no! verbindung mit ' . $server . ' als ' . $username . ' nicht moeglich!');
91  }
92 
93  $msgno = (int)$_GET['msgno'];
94  // retrieve message
95  $email = $imap->getMessage($msgno);
96 
97  // MARK AS UNREAD: set unseen message
98  if (isset($_GET['markAsUnread']) && ($_GET['markAsUnread'] == true))
99  {
100  // mark as unseen
101  if ($imap->setUnseenMessage($msgno) == true)
102  { // email marked as unseen
103  alert::draw("success", "Marked as unread", "The email was marked as unseen", "", 1200);
104  }
105  else
106  { // set unseen failed
107  alert::draw("warning", "ERROR:", "Unable to mark email as read", "", 2800);
108  }
109  }
110  else // mark email as seen
111  { // check if mail has been seen
112  if ($imap->incomingMessage->header->seen == 0)
113  { // if not, set seen (mark as read)
114  $imap->setSeenMessage($msgno);
115  }
116  }
117 }
118 else // webmail is not activated...
119 { // leave vars empty
120  $webmail = "";
121  $imap = "";
126 }
127 
128 ?>
129 <script type="text/javascript">
130  // DROPZONE
131  Dropzone.options.myDropzone = { // The camelized version of the ID of the form element
132  // ajax form action
133  url: "js/email-send.php",
134  // dropzone options
135  autoProcessQueue: false,
136  uploadMultiple: true,
137  parallelUploads: 100,
138  maxFilesize: 64, // MB
139  maxFiles: 100,
140  addRemoveLinks: true,
141  paramName: "files",
142  acceptedFiles: ".jpg, .jpeg, .png, .gif, .pdf, .doc, .xls, .wav, .mp3, .mp4, .mpg",
143  clickable: ".fileinput-button", // Define the element that should be used as click trigger to select files.
144  // Language Strings
145  dictFileTooBig: "File is to big ({{filesize}}mb). Max allowed file size is {{maxFilesize}}mb",
146  dictInvalidFileType: "Invalid File Type",
147  dictCancelUpload: "Cancel",
148  dictRemoveFile: "Remove",
149  dictMaxFilesExceeded: "Only {{maxFiles}} files are allowed",
150  dictDefaultMessage: "Drop files here to upload",
151 
152  // The setting up of the dropzone
153  init: function() {
154  var myDropzone = this;
155  var dropzoneFormElement = $('#my-dropzone');
156 
157  $(".dz-message").hide();
158  // First change the button to actually tell Dropzone to process the queue.
159  this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
160  // Make sure that the form isn't actually being sent.
161  e.preventDefault();
162  e.stopPropagation();
163 
164  // process only, if there are any attachments
165  if (myDropzone.getQueuedFiles().length > 0) {
166  myDropzone.processQueue();
167  }
168  else
169  { // process w/o attachments
170  // add form action & methods, call submit event
171  $(dropzoneFormElement).attr('action', 'js/email-send.php');
172  $(dropzoneFormElement).attr('method', 'post');
173  $(dropzoneFormElement).submit();
174  }
175  });
176 
177  // Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
178  // of the sending event because uploadMultiple is set to true.
179  this.on("sendingmultiple", function(file) {
180  // Gets triggered when the form is actually being sent.
181  // Indicate loading button
182  $("#submitIcon").removeClass().addClass("fa fa-spinner fa-spin");
183  $("#submitBtn").removeClass().addClass("btn btn-danger disabled pull-right");
184  $("#draftBtn").removeClass().addClass("btn btn-default disabled");
185  $("#addBtn").removeClass().addClass("btn btn-success disabled");
186  });
187 
188  this.on("successmultiple", function(files, response) {
189  // Gets triggered when files + form have successfully been sent.
190  // redirect to webmail start page
191  window.location.replace("index.php?page=webmail");
192  });
193  this.on("errormultiple", function(files, response) {
194  // Gets triggered when there was an error sending the files.
195  // Maybe show form again, and notify user of error
196  });
197  }
198  };
199 
200  $(document).ready(function() {
201  $('#table-sort').dataTable({
202  "bPaginate": true,
203  "bLengthChange": false,
204  "bFilter": true,
205  "bSort": true,
206  "bInfo": true,
207  "bAutoWidth": false
208  });
209 
210  // vars that will be used outside of functions
211  let markAsUnseenIcon = $('#icon-markAsUnseen');
212  let replyBtn = $('#replyBtn');
213  let replyIcon = $('#icon-reply');
214  let forwardIcon = $('#icon-forward');
215  let replyTextArea = $('#summernote');
216  let form = $('#my-dropzone');
217  let toFormGroup = $('#toFormGroup');
218  let boxFooter = $('#box-footer');
219  let replyTo = $('#replyTo');
220 
221  // OPEN REPLY BOX toggled by footer button
222  $(replyBtn).click(function() {
223  openReplyBox();
224  boxFooter.hide();
225  toFormGroup.removeClass();
226  $('.note-editable').focus();
227  });
228 
229  // OPEN REPLY BOX toggled by reply icon
230  $(replyIcon).click(function() {
231  openReplyBox();
232  boxFooter.hide();
233  toFormGroup.removeClass();
234  $('.note-editable').focus();
235  });
236 
237  // forward: OPEN REPLY BOX and add forward email
238  $(forwardIcon).click(function() {
239  let toField = $('#toField');
240  openReplyBox();
241  boxFooter.hide();
242  toFormGroup.removeClass();
243  $('.note-editable').focus();
244  // $(toField).fadeIn();
245  });
246 
247  // SEEN / UNSEEN icon
248  $("#btn-markAsUnseen").hover(
249  function() {
250  $(markAsUnseenIcon).removeClass("fa fa-envelope-open-o");
251  $(markAsUnseenIcon).addClass("fa fa-envelope");
252  }, function() {
253  $(markAsUnseenIcon).removeClass("fa fa-envelope");
254  $(markAsUnseenIcon).addClass("fa fa-envelope-open-o");
255  }
256  );
257 
258  // PRINT BUTTON
259  $("#printButton").click(
260  function () {
261  $("#emailMessageContent").printThis();
262  });
263 
264  // PRINT ICON
265  $("#icon-print").click(
266  function () {
267  $("#emailMessageContent").printThis();
268  });
269 
270  // CC button handling (toggle fadeIn/out on demand)
271  $( "#addCCBtn" ).click(function() {
272  // alert( "Add CC Field Btn clicked!" );
273  var ccField = $('#ccField');
274  var ccFieldClass = $(ccField).attr('class');
275  if (ccFieldClass === 'form-control hidden')
276  {
277  $(ccField).removeClass().addClass('form-control animated fadeIn');
278  }
279  else if (ccFieldClass === 'form-control animated fadeIn')
280  {
281  $(ccField).removeClass().addClass('form-control animated fadeOut hidden');
282  }
283  else if (ccFieldClass === 'form-control animated fadeOut hidden')
284  {
285  $(ccField).removeClass().addClass('form-control animated fadeIn');
286  }
287  });
288 
289  // BCC button handling (toggle fadeIn/out on demand)
290  $( "#addBCCBtn" ).click(function() {
291  // alert( "Add BCC Field Btn clicked!" );
292  var bccField = $('#bccField');
293  var bccFieldClass = $(bccField).attr('class');
294  if (bccFieldClass === 'form-control hidden')
295  {
296  $(bccField).removeClass().addClass('form-control animated fadeIn');
297  }
298  else if (bccFieldClass === 'form-control animated fadeIn')
299  {
300  $(bccField).removeClass().addClass('form-control animated fadeOut hidden');
301  }
302  else if (bccFieldClass === 'form-control animated fadeOut hidden')
303  {
304  $(bccField).removeClass().addClass('form-control animated fadeIn');
305  }
306  });
307  });
308 
309  /**
310  * Reaction to click on reply button: add html markup to open the reply box
311  *
312  */
313  function openReplyBox()
314  {
315  // html elements
316  let replyBox = $('#replyBox');
317  let sendBtn = $('#sendBtn');
318  let submitBtn = $('#submitBtn');
319  let replyBtn = $('#replyBtn');
320  let deleteBtn = $('#deleteBtn');
321  let printBtn = $('#printBtn');
322  let forwardBtn = $('#forwardBtn');
323  let actions = $('#actions');
324  // open reply box
325  $(actions).removeClass().addClass('animated fadeIn');
326  $(replyBox).removeClass().addClass('box-footer hidden-print animated fadeIn');
327  $(replyBtn).hide();
328  $(forwardBtn).hide();
329  $(deleteBtn).hide();
330  $(printBtn).hide();
331  $(submitBtn).removeClass().addClass('btn btn-success hidden-print animated flipInX');
332  }
333 
334  /**
335  * Move a specific email (uid) from folder to targetFolder
336  * @param uid the affected mail uid
337  * @param folder source folder
338  * @param targetFolder target folder
339  */
340  function moveMessage(uid, folder, targetFolder){
341  $.ajax({
342  type: "POST",
343  url: 'js/webmail-moveMessage.php',
344  data: {uid: uid, folder:folder, targetFolder:targetFolder},
345  success: function(data){
346  // alert(data);
347  // var messageBox = $('#messageBox');
348  // fadeOut message box
349  // $(messageBox).removeClass().addClass('animated fadeOut');
350  window.location.replace('index.php?page=webmail');
351 
352  }
353  });
354  }
355 </script>
356 <script src="../system/engines/jquery/printThis/printThis.js" type="text/javascript"></script>
357 <?php
358 // TEMPLATE WRAPPER - HEADER & breadcrumbs
359 echo "
360  <!-- Content Wrapper. Contains page content -->
361  <div class=\"content-wrapper\" id=\"content-FX\">
362  <!-- Content Header (Page header) -->
363  <section class=\"content-header\">";
364 /* draw Title on top */
365 echo backend::getTitle($lang['WEBMAIL'], $lang['WEBMAIL_SUBTEXT']);
366 echo"<ol class=\"breadcrumb\">
367  <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
368  <li class=\"active\"><a href=\"index.php?page=webmail\" title=\"$lang[WEBMAIL]\"> $lang[WEBMAIL]</a></li>
369  </ol>
370  </section>
371  <!-- Main content -->
372  <section class=\"content\">";
373 /* page content start here */
374 
375 // check if webmail is enabled
376 if ($webmailSettings['webmail_active'] == true) {
377  ?>
378  <div class="row">
379  <div class="col-md-3">
380  <!-- left col -->
381  <a href="index.php?page=webmail" class="btn btn-success btn-large" style="width: 100%;"><i class="fa fa-reply-all"></i> &nbsp;Back to
382  Inbox</a><br><br>
383  <div class="box box-default">
384  <div class="box-header with-border">
385  <h3 class="box-title">Folders</h3>
386 
387  <div class="box-tools">
388  <button type="button" class="btn btn-box-tool" data-widget="collapse">
389  <i class="fa fa-minus"></i>
390  </button>
391  </div>
392  </div>
393  <div class="box-body no-padding animated fadeIn" style="">
394  <ul class="nav nav-pills nav-stacked">
395  <?php
396  $webmail->drawFolders($imap, $imap->getFolders());
397  ?>
398  </ul>
399  </div>
400  <!-- /.box-body -->
401  </div>
402 
403  </div>
404 
405  <div id="messageBox" class="col-md-9 animated fadeIn">
406 
407  <form id="my-dropzone" class="dropzone" enctype="multipart/form-data">
408  <!-- right col -->
409  <div class="box box-secondary" id="emailMessageContent">
410  <div class="box-header with-border">
411 
412  <?php
413  // check if this message is a reply and adapt subject
414  // count replies
415  $replies = substr_count($imap->incomingMessage->header->subject , 'Re:');
416  // message must got a reply
417  if ($replies > 0)
418  { // adapt subject for better readability
419  $subject = str_replace("Re:","",$imap->incomingMessage->header->subject);
420  $subject = "Re:(".$replies.") ".$subject;
421  }
422  else
423  { // no reply, leave subject as it is
424  $subject = $imap->incomingMessage->header->subject;
425  }
426  ?>
427  <h3><?php echo $subject; ?></h3>
428 
429  <h4>From: <?php echo $imap->incomingMessage->header->details->from[0]->mailbox . "@" . $imap->incomingMessage->header->details->from[0]->host ?></h4>
430  <h4 style="margin-top:-10px;"><small>To: <?php echo $imap->incomingMessage->header->details->to[0]->mailbox . "@" . $imap->incomingMessage->header->details->to[0]->host ?></small>
431  <span style="margin-top:-15px;" class="mailbox-read-time pull-right"><?php echo substr($imap->incomingMessage->header->date, 0, -6); ?>
432  <br>
433  <span class="pull-right">
434  <?php echo sys::time_ago($imap->incomingMessage->header->date, $lang); ?></span>
435  </span></h4>
436 
437  <?php $webmail->drawMailboxControls($imap, "message", $imap->incomingMessage->header->uid, $imap->currentFolder, $lang); ?>
438 
439  <div class="box-tools pull-right">
440  <a href="index.php?page=webmail&folder=INBOX" class="btn btn-box-tool" data-toggle="tooltip" title="<?php echo $lang['CLOSE'];?>"
441  data-original-title="<?php echo $lang['CLOSE'];?>"><i class="fa fa-close text-light"></i>
442  </a>
443  </div>
444  </div>
445  <!-- /.box-header -->
446  <div class="box-body no-padding">
447  <!--
448  <div class="mailbox-read-info">
449  ...
450  </div> -->
451  <!-- /.mailbox-read-info -->
452  <!-- <div class="mailbox-controls with-border text-center"> -->
453  <!-- </div> -->
454  <!-- /.mailbox-controls -->
455  <div class="mailbox-read-message">
456 
457  <?php
458  // set message body
459  echo $imap->incomingMessage->message->html;
460 
461  // if there are any attachments...
462  if (count($imap->incomingMessage->attachments) > 0)
463  {
464  // set download path
465  $downloadPath = "../media/mailbox";
466 
467  // check if download path is writeable
468  if (is_writeable($downloadPath) === false)
469  { // it is not - throw error msg
470  alert::draw("warning", $lang['ERROR'], $lang['ATTACH_DIR_NOT_WRITEABLE'], "", 3800);
471  }
472 
473  // set attachment options
474  $attachmentOptions = array('dir' => $downloadPath, 'incomingMessage' => $imap->incomingMessage);
475 
476  // set markup for attachments - start list
477  echo "<ul class=\"mailbox-attachments clearfix\">";
478 
479  // walk through each attachment
480  foreach ($imap->incomingMessage->attachments as $key => $attachment)
481  {
482  // save attachments to media/mailbox folder
483  $imap->saveAttachments($attachmentOptions);
484  // set download path
485  $downloadPath = sys::addTrailingSlash($downloadPath);
486  // set current file
487  $attachment->currentFile = $downloadPath.$attachment->name;
488  // will be set to true, if attachment is an image (used by attachment preview)
489  $attachment->isImage = '';
490 
491  // check if attachment of this email was saved and is there
492  if (is_file($attachment->currentFile))
493  { // get filesize of current attachment
494  $attachment->size = filesize($attachment->currentFile);
495  // round filesize to make it more human-friendly readable
496  $attachment->size = filemanager::sizeFilter($attachment->size, 0);
497 
498  // check if attachment filename is too long for the box
499  if (strlen($attachment->name) >= 20)
500  { // limit preview filename to 20 chars
501  $attachment->namePreview = substr($attachment->name, 0, 20);
502  // add dots to improve visibility that filename was cutted
503  $attachment->namePreview = $attachment->namePreview."...";
504  }
505  else
506  { // filename is short enough - display full filename
507  $attachment->namePreview = $attachment->name;
508  }
509 
510  // set current attachment mime type
511  $attachment->currentMimeType = mime_content_type($attachment->currentFile);
512 
513  // CHECK MIME TYPES AND SET MARKUP
514  // :IMAGE
515  if(strpos($attachment->currentMimeType, "image") !== false)
516  { // image markup
517  $attachment->isImage = true;
518  // echo "Attachment must be an image";
519  }
520 
521  // :ZIP
522  else if(strpos($attachment->currentMimeType, "zip") !== false)
523  { // seems to be a zip file";
524  $attachmentIcon = "fa fa-file-archive-o";
525  }
526 
527  // :PDF
528  else if(strpos($attachment->currentMimeType, "pdf") !== false)
529  { // seems to be a pdf file";
530  $attachmentIcon = "fa fa-file-pdf-o";
531  }
532 
533  // :TEXT
534  else if(strpos($attachment->currentMimeType, "text") !== false)
535  { // seems to be an text file";
536  $attachmentIcon = "fa fa-file-text-o";
537  }
538 
539  // :AUDIO
540  else if(strpos($attachment->currentMimeType, "audio") !== false)
541  { // seems to be a audio file";
542  $attachmentIcon = "fa fa-file-audio-o";
543  }
544 
545  // :VIDEO
546  else if(strpos($attachment->currentMimeType, "video") !== false)
547  { // seems to be a video file
548  echo "Attachment must be a video";
549  $attachmentIcon = "fa fa-file-video-o";
550  }
551 
552  // :WORD
553  else if(strpos($attachment->currentMimeType, "word") !== false)
554  { // seems to be a word file
555  $attachmentIcon = "fa fa-file-word-o";
556  }
557 
558  // :EXCEL
559  else if(strpos($attachment->currentMimeType, "excel") !== false)
560  { // seems to be a excel file
561  $attachmentIcon = "fa fa-file-excel-o";
562  }
563 
564  // :EXCEL
565  else if(strpos($attachment->currentMimeType, "powerpoint") !== false)
566  { // seems to be a powerpoint file
567  $attachmentIcon = "fa fa-file-powerpoint-o";
568  }
569 
570  // unknown mime type
571  else
572  { // cannot determine mime type
573  // block? or set default icon!
574  $attachmentIcon = "fa fa-file-o";
575  }
576 
577  // check file extension to create proper markup
578  // $attachment->ext = pathinfo($downloadPath.$attachment->name, PATHINFO_EXTENSION);
579  if ($attachment->isImage === true)
580  {
581  // attachment is an image
582  echo "
583 
584  <li>
585  <!-- <span class=\"mailbox-attachment-icon\"><i class=\"fa fa-file-image-o\"></i></span> -->
586 
587  <div class=\"mailbox-attachment-info\" style=\"min-height:180px; overflow: hidden;\">
588  <a href=\"".$downloadPath.$attachment->name."\" data-lightbox=\"attachment-set\" data-title=\"".$attachment->name."\" class=\"mailbox-attachment-name\">
589  <img src=\"".$downloadPath.$attachment->name."\" class=\"img-responsive\" alt=\"attachment\"> ".$attachment->namePreview."
590  </a>
591  <span class=\"mailbox-attachment-size\">
592  ".$attachment->size."
593  <a href=\"".$downloadPath.$attachment->name."\" class=\"btn btn-default btn-xs pull-right\"><i class=\"fa fa-cloud-download\"></i></a>
594  </span>
595  </div>
596  </li>";
597  }
598  else
599  { // attachment is not an image
600  echo "
601  <li>
602  <span class=\"mailbox-attachment-icon\"><a href=\"".$attachment->currentFile."\" target=\"_blank\"><i class=\"".$attachmentIcon."\"></i></a></span>
603 
604  <div class=\"mailbox-attachment-info\">
605  <i class=\"fa fa-paperclip\"></i>&nbsp;&nbsp;<a href=\"".$downloadPath.$attachment->name."\">".$attachment->namePreview."</a>
606  <span class=\"mailbox-attachment-size\">
607  ".$attachment->size."
608  <a href=\"".$downloadPath.$attachment->name."\" class=\"btn btn-default btn-xs pull-right\"><i class=\"fa fa-cloud-download\"></i></a>
609  </span>
610  </div>
611  </li>";
612  // echo "<br><p><b><i class=\"fa fa-paperclip\"></i>&nbsp;&nbsp;<a href=\"../media/mailbox/".$attachment->name."\">" . $attachment->name . "</a></b></p>";
613  }
614  }
615  else
616  {
617  echo "The email got attachments, but no files were found. <a href=\"#\">Try to download</a>";
618  }
619  }
620  echo "</ul>";
621  }
622  ?>
623  <!-- /.mailbox-read-message -->
624  </div>
625 
626  </div>
627 
628  <div id="toFormGroup" class="form-group hidden">
629  <input id="toField" class="form-control hidden" name="to" placeholder="<?php echo $imap->incomingMessage->header->details->from[0]->mailbox . "@" . $imap->incomingMessage->header->details->from[0]->host ?>" value="<?php echo $imap->incomingMessage->header->details->from[0]->mailbox . "@" . $imap->incomingMessage->header->details->from[0]->host ?>">
630  <input id="ccField" class="form-control hidden" name="ccField" placeholder="CC:">
631  <input id="bccField" class="form-control hidden" name="bccField" placeholder="BCC:">
632  </div>
633  <div id="subjectFormGroup" class="form-group hidden">
634  <input class="form-control" name="subject" placeholder="Subject:" value="<?php "Re: ".$imap->incomingMessage->header->subject; ?>">
635  </div>
636  <div id="replyBox" class="form-group hidden">
637  <small class="text-muted"><?php echo $lang['REPLY']." ".$lang['TO'].": ".$imap->incomingMessage->header->details->from[0]->mailbox . "@" . $imap->incomingMessage->header->details->from[0]->host; ?>
638  <span id="addBCCBtn" class="pull-right" style="cursor:pointer;">&nbsp;BCC</span>
639  <span id="addCCBtn" class="pull-right" style="cursor: pointer;">CC&nbsp;</span>
640  </small>
641  <label for="summernote" class="hidden"></label>
642  <!-- summernote editor -->
643  <textarea id="summernote" name="body" class="form-control">
644  <?php echo "
645  <br><br>
646  <h4>".$lang['SENT'].": ".substr($imap->incomingMessage->header->date, 0, -6)." ".$lang['FROM']." ".$imap->incomingMessage->header->details->from[0]->mailbox . "@" . $imap->incomingMessage->header->details->from[0]->host."</h4>";
647  echo "<br>".$imap->incomingMessage->message->html; ?>
648  </textarea>
649  </div>
650 
651  <!-- start dropzone -->
652  <div id="actions" class="hidden">
653  <!-- this is were the previews should be shown. -->
654  <div class="dropzone-previews"></div>
655  <!-- The fileinput-button span is used to style the file input field as button -->
656  <span id="addBtn" class="btn btn-success fileinput-button">
657  <i class="fa fa-plus"></i>
658  <span>Add files...</span>
659  </span>
660 
661  <div class="pull-right">
662  <a id="draftBtn" href="index.php?page=webmail-compose&draft=1" type="button" class="btn btn-default"><i class="fa fa-pencil"></i>&nbsp; Draft</a>
663  &nbsp;
664  <button id="submitBtn" type="submit" class="btn btn-success pull-right"><i id="submitIcon" class="fa fa-paper-plane-o"></i> &nbsp;&nbsp;Send Email</button>
665  <!-- <button type="submit" id="submitBtn" class="btn btn-success start"><i class="fa fa-paper-plane-o"></i>&nbsp; Send</button> -->
666  <input type="hidden" name="sendEmail" value="true">
667  <input type="hidden" name="subject" value="<?php echo "Re: ".$imap->incomingMessage->header->subject;?>">
668  </div>
669 
670  <p class="help-block">Max. <?php echo filemanager::getPostMaxSize(); ?></p>
671  </div>
672  <!-- /. bootstrap dropzone -->
673  </div>
674 
675  <!-- /.box-footer -->
676  <div id="box-footer" class="box-footer hidden-print">
677  <div class="pull-right hidden-print">
678  <!-- <a href="http://raspi/web/clone/admin/index.php?page=webmail&moveMessage=true&folder=INBOX&targetFolder=Trash&uid=<?php echo $imap->incomingMessage->header->uid; ?>" class="btn btn-default hidden-print"><i class="fa fa-trash-o"></i> <?php // echo $lang['DELETE']; ?></a> -->
679  <button type="button" id="deleteBtn" class="btn btn-default hidden-print"><i class="fa fa-trash-o"></i> <?php echo $lang['DELETE']; ?></button>
680  <button type="button" id="printBtn" class="btn btn-default hidden-print"><i class="fa fa-print"></i> <?php echo $lang['PRINT']; ?></button>
681  </div>
682 
683  <button id="sendBtn" class="btn btn-default hidden-print hidden"><i class="fa fa-send"></i> &nbsp;<?php echo $lang['SUBMIT']; ?></button>
684  <a id="replyBtn" href="#summernote" class="btn btn-default hidden-print"><i class="fa fa-reply"></i> &nbsp;<?php echo $lang['REPLY']; ?></a>
685  <!-- <button id="forwardBtn" class="btn btn-default hidden-print"><i class="fa fa-mail-forward"></i> &nbsp;<?php // echo $lang['FORWARD']; ?></button> -->
686 
687  </div>
688 
689  </form>
690  <!-- /.box-footer -->
691  <?php
692  // echo "<pre>";
693  // print_r($imap->incomingMessage);
694  // echo "</pre>";
695  ?>
696 
697  </div>
698  </div>
699  <?php
700  $imap->close();
701 }
702 else
703 {
704  echo "<h4>Webmail is not enabled! Go to <a href=\"index.php?page=settings-webmail\">Settings / Webmail</a> and enable it.</a></h4>";
705 }
706 ?>
print $lang['FILEMAN_UPLOAD']
die
Definition: block-user.php:27
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Definition: alert.php:19
Backend class serves a few useful functions for the admin backend.
Definition: backend.php:27
Mysqli database class; returns db connection object.
Definition: db.php:16
Load editor settings, required javascript and html markup.
Definition: editor.php:12
Basic File Manager (Backend)
Definition: filemanager.php:17
The language class - support multilingual backend.
Definition: language.php:17
Settings class: get and set YaWK system settings.
Definition: settings.php:9
The sys class - handles yawk's system core functions.
Definition: sys.php:17
Integrated IMAP Webmail.
Definition: webmail.php:25
$server
Definition: email-send.php:133
function window
Definition: fuckAdBlock.js:8
FuckAdBlock prototype on
Definition: fuckAdBlock.js:227
function a
Definition: browser.js:14
type
Definition: menu-new.php:35
print $page title
Definition: page-edit.php:377
print $_GET['id']
Definition: page-edit.php:357
function e
Definition: plyr.js:1
function i(e, t)
Definition: plyr.js:1
function p(e)
Definition: plyr.js:1
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
$template name
$email
Definition: user-new.php:94
$imapMsgTypes
$imapStart
$editorSettings
$imapAmount
$imapSortation
$webmailSettings
document ready(function() { $('a[data-confirm]').click(function(ev) { modal='#dataConfirmModal';var href=$(this).attr('href');var title=$(this).attr('title');var icon=$(this).attr('data-icon');if(!icon) { icon='fa fa-trash-o';} if(!$(modal).length) { $('body').append('< div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true">< div class="modal-dialog">< div class="modal-content">< div class="modal-header">< button type="button" class="close" data-dismiss="modal" aria-hidden="true">< i class="fa fa-times"></i ></button >< br >< div class="col-md-1">< h3 class="modal-title">< i class="'+icon+'"></i ></h3 ></div >< div class="col-md-11">< h3 class="modal-title" id="dataConfirmLabel">'+title+'</h3 ></div ></h3 ></div >< div class="modal-body"></div >< div class="modal-footer">< button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Abbrechen</button >< a type="button" class="btn btn-danger" id="dataConfirmOK">< i class="'+icon+'"></i > L &ouml;schen</a ></div ></div ></div ></div >');} $(modal).find('.modal-body').text($(this).attr('data-confirm'));$('#dataConfirmOK').attr('href', href);$(modal).modal({show:true});return false;});$('#terminateUser').click(function() { var terminate=window.confirm("ACHTUNG!\nDas wird Deinen Account permanent deaktivieren.\n"+"Bist Du Dir sicher, dass Du das tun willst?");if(terminate===true) { var terminateUser=window.confirm("Bist Du Dir wirklich ganz sicher?\n"+"Diese Aktion kann nicht rueckgaengig gemacht werden.");if(terminateUser===true) { $.get('system/templates/YaWK-bootstrap3/js/terminate-user.php', function(data) { if(data==="true") { setTimeout("window.location='logout.html'", 0);} else { alert("Fehler: "+data);} });} } });function dismissNotifications() { $.ajax({ url:'js/dismiss-notifications.php', type:'POST', success:function(data) { if(!data) { alert('Something went wrong!');return false;} } });$("#bell-label").fadeOut();$('#notification-header').html('You have 0 notifications');$('#notification-menu').fadeOut();} $("#dismiss").click(function() { dismissNotifications();});function disableButtons(delay) { $('#loginButton').removeClass().addClass('btn btn-success disabled').attr('id', 'LOGIN_FORBIDDEN');$('#resetPasswordButton').removeClass().addClass('btn btn-danger disabled');setTimeout(function() { $('#LOGIN_FORBIDDEN').attr('id', 'loginButton').removeClass().addClass('btn btn-success');$('#resetPasswordButton').removeClass().addClass('btn btn-danger');}, delay);} $("#loginButton").click(function(){ if($('#loginButton').length > 0) { if($('#loginButton').hasClass('btn') &&$('#loginButton').hasClass('btn-success') &&$('#loginButton').hasClass('disabled')) { } else { $("#loginForm").submit();disableButtons(10000);} } else if($('#LOGIN_FORBIDDEN').length > 0) { if($('#LOGIN_FORBIDDEN').hasClass('btn') &&$('#LOGIN_FORBIDDEN').hasClass('btn-success') &&$('#LOGIN_FORBIDDEN').hasClass('disabled')) { } else { } } });$("#blockedBtn").hover(function() { $("#blockedBtn").hide();$("#askBtn").fadeIn(820);});})