- Timestamp:
- 04/13/10 17:48:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/inc/WebService.php
r2471 r2511 12 12 class WebService 13 13 { 14 function __construct() 15 { 16 require_once("../../header.session.inc.php"); 17 } 18 19 public final function getPhoto($pUid) 20 { 21 require_once("class.LdapIM.inc.php"); 22 23 $ldap = new LdapIM(); 24 25 $uid = $pUid; 26 if( strpos($pUid, "/") ) 27 $uid = substr($pUid, 0, strpos($pUid, "/")); 28 29 $photo = $ldap->getPhotoUser($uid, true); 30 31 if ( !$photo ) 32 $photo = $ldap->getPhotoUser($uid, false); 33 34 if( $photo ) 35 $photo = imagecreatefromstring($photo); 36 else 37 $photo = imagecreatefrompng("../templates/default/images/photo.png"); 38 39 header("Content-Type: image/jpeg"); 40 $width = imagesx($photo); 41 $height = imagesy($photo); 42 $twidth = 60; 43 $theight = 80; 44 $small_photo = imagecreatetruecolor ($twidth, $theight); 45 imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 46 imagejpeg($small_photo,'',100); 47 48 return; 49 } 50 14 51 public final function getPhotoSession($pUid, $pOu) 15 52 { … … 17 54 if( strpos($pUid, "@") ) 18 55 $uid = substr($pUid, 0, strpos($pUid, "@")); 19 20 require_once("../../header.session.inc.php");21 56 22 57 if( isset($_SESSION['phpgw_info']['jabberit_messenger']['photo'][$pOu][$uid]) ) … … 40 75 } 41 76 42 // Ph p - fotos pelo php;43 if(trim($_REQUEST['ph pPhoto']) != "")77 // Photo in Session 78 if(trim($_REQUEST['photo_session']) != "") 44 79 { 45 80 $obj = new WebService(); 46 $ou = $_REQUEST[' phpOu'];47 $jid = $_REQUEST['ph pPhoto'];81 $ou = $_REQUEST['ou']; 82 $jid = $_REQUEST['photo_session']; 48 83 49 84 $obj->getPhotoSession($jid, $ou); 50 85 } 51 86 87 // Photo Ldap 88 if(trim($_REQUEST['photo_ldap'])) 89 { 90 $obj = new WebService(); 91 $jid = $_REQUEST['photo_ldap']; 92 $obj->getPhoto($jid); 93 } 52 94 53 95 ?>
Note: See TracChangeset
for help on using the changeset viewer.