Changeset 3163


Ignore:
Timestamp:
08/17/10 11:26:10 (14 years ago)
Author:
amuller
Message:

Ticket #1163 - Mudando data de expiração das fotos

Location:
branches/2.2/expressoMail1_2/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.ldap_functions.inc.php

    r1918 r3163  
    759759        function getUserByEmail($params) 
    760760        { 
     761                $expires = 60*60*24*30; /* 30 days */ 
     762                header("Cache-Control: maxage=".$expires); 
     763                header("Pragma: public"); 
     764                header("Expires: ".gmdate('D, d M Y H:i:s', time()+$expires));   
    761765                $filter="(&(phpgwAccountType=u)(mail=" . $params['email'] . "))"; 
    762766                $ldap_context = $_SESSION['phpgw_info']['expressomail']['ldap_server']['dn']; 
  • branches/2.2/expressoMail1_2/inc/show_img.php

    r3018 r3163  
    3030                echo $image;             
    3131        } 
    32         else if($_SESSION['phpgw_info']['expressomail']['contact_photo']){       
    33                 $data  = $_SESSION['phpgw_info']['expressomail']['contact_photo']; 
    34                                  
    35                 if($data) { 
    36                          
    37                         $photo = imagecreatefromstring($data[0]); 
    38                         if($photo){ 
    39                                 $width = imagesx($photo); 
    40                                 $height = imagesy($photo); 
    41                                 $twidth = 60; 
    42                                 $theight = 80; 
    43                                 $small_photo = imagecreatetruecolor ($twidth, $theight); 
    44                                 imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 
    45                                 imagejpeg($small_photo,'',100); 
    46                                 unset($_SESSION['phpgw_info']['expressomail']['contact_photo']); 
     32        else{ 
     33                $expires = 60*60*24*30; /* 30 days */ 
     34                header("Cache-Control: maxage=".$expires); 
     35                header("Pragma: public"); 
     36                header("Expires: ".gmdate('D, d M Y H:i:s', time()+$expires)); 
     37                if($_SESSION['phpgw_info']['expressomail']['contact_photo']){    
     38                        $data  = $_SESSION['phpgw_info']['expressomail']['contact_photo']; 
     39 
     40                        if($data) { 
     41 
     42                                $photo = imagecreatefromstring($data[0]); 
     43                                if($photo){ 
     44                                        $width = imagesx($photo); 
     45                                        $height = imagesy($photo); 
     46                                        $twidth = 60; 
     47                                        $theight = 80; 
     48                                        $small_photo = imagecreatetruecolor ($twidth, $theight); 
     49                                        imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 
     50                                        imagejpeg($small_photo,'',100); 
     51                                        unset($_SESSION['phpgw_info']['expressomail']['contact_photo']); 
     52                                } 
    4753                        } 
    4854                } 
     55                else 
     56                        readfile("./../../contactcenter/templates/default/images/photo_celepar.png"); 
    4957        } 
    50         else 
    51                 readfile("./../../contactcenter/templates/default/images/photo_celepar.png"); 
    5258?> 
Note: See TracChangeset for help on using the changeset viewer.