Proyectos de Subversion LeadersLinked - Services

Rev

Rev 294 | Rev 296 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 294 Rev 295
Línea 26... Línea 26...
26
use LeadersLinked\Model\AbuseReport;
26
use LeadersLinked\Model\AbuseReport;
27
use LeadersLinked\Library\ExternalCredentials;
27
use LeadersLinked\Library\ExternalCredentials;
28
use LeadersLinked\Library\Storage;
28
use LeadersLinked\Library\Storage;
29
use LeadersLinked\Form\InMail\SendForm;
29
use LeadersLinked\Form\InMail\SendForm;
30
use PHPMailer\PHPMailer\PHPMailer;
30
use PHPMailer\PHPMailer\PHPMailer;
-
 
31
use LeadersLinked\Library\S3Files;
Línea 31... Línea 32...
31
 
32
 
32
 
33
 
33
class InMailController extends AbstractActionController
34
class InMailController extends AbstractActionController
Línea 563... Línea 564...
563
                    }
564
                    }
Línea 564... Línea 565...
564
                    
565
                    
565
                    $extensions = ['mov', 'webm','mp4','mpeg','jpg','jpeg','png', 'pdf'];
566
                    $extensions = ['mov', 'webm','mp4','mpeg','jpg','jpeg','png', 'pdf'];
Línea 566... Línea -...
566
                    $contentTypes =  ['video/quicktime', 'video/webm', 'video/mp4', 'video/mpeg', 'image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
-
 
567
                    
-
 
-
 
567
                    $contentTypes =  ['video/quicktime', 'video/webm', 'video/mp4', 'video/mpeg', 'image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
-
 
568
                    
-
 
569
                    $storage = Storage::getInstance($this->config);
Línea 568... Línea 570...
568
                    
570
                    $path = $storage->getPathMessage();
569
                    
571
                    $code = $currentUser->uuid;
570
                    
572
                    
571
                    $attachments = [];
573
                    $attachments = [];
Línea 582... Línea 584...
582
                               {
584
                               {
583
                                   if($extension == $extensions[$j]) {
585
                                   if($extension == $extensions[$j]) {
584
                                       $contentType = $contentTypes[$j];
586
                                       $contentType = $contentTypes[$j];
585
                                   }
587
                                   }
586
                               }
588
                               }
-
 
589
                               
-
 
590
                               $remoteFilename = $email['uid'] . '-' . $filename;
-
 
591
                              
-
 
592
                               
-
 
593
                               $url = $storage->getGenericFile($path, $code,  $remoteFilename) ;
-
 
594
                               if(!$url) {
-
 
595
                                   
-
 
596
                                   $tmp_file = sys_get_temp_dir() . '/' .  $remoteFilename;
-
 
597
                                   file_put_contents($tmp_file, $value);
-
 
598
                                   
-
 
599
                                   if($storage->putFile($path, $code, $tmp_file)) {
-
 
600
                                       $url = $storage->getGenericFile($path, $code, $tmp_file) ;
-
 
601
                                   } else {
-
 
602
                                       $url = '';
-
 
603
                                   }
-
 
604
                                   
-
 
605
                               } 
-
 
606
                               
Línea 587... Línea -...
587
                                
-
 
-
 
607
                                
Línea 588... Línea 608...
588
                                
608
                                
589
                                
609
                               // $this->url()->fromRoute('inmail/message/attachment',[ 'id' => $email['uid'], 'attachment' => $i ], ['force_canonical' => true]),
590
                                
610
                                
591
                                array_push($attachments, [
611
                                array_push($attachments, [
592
                                    'filename' => $filename,
612
                                    'filename' =>  $remoteFilename,
593
                                    'content-type' => $contentType,
613
                                    'content-type' => $contentType,
594
                                    'attachment_link' =>  $this->url()->fromRoute('inmail/message/attachment',[ 'id' => $email['uid'], 'attachment' => $i ], ['force_canonical' => true]),
614
                                    'attachment_link' => $url,
595
                                ]);
615
                                ]);
596
                                $i++;
616
                                $i++;
Línea 676... Línea 696...
676
                    $port,
696
                    $port,
677
                    false);
697
                    false);
Línea 678... Línea 698...
678
                
698
                
Línea -... Línea 699...
-
 
699
                $client->setActiveMailbox($mailbox);
-
 
700
                
-
 
701
                
-
 
702
                $storage = Storage::getInstance($this->config);
-
 
703
                $path = $storage->getPathMessage();
-
 
704
                $code = $currentUser->uuid;
-
 
705
                $storage->deleteDirectory($path, $code);
-
 
706
                
679
                $client->setActiveMailbox($mailbox);
707
                
680
                
708
                
Línea 681... Línea 709...
681
                $response = $client->remove($id, true); 
709
                $response = $client->remove($id, true); 
682
                $client->disconnect();
710
                $client->disconnect();