Changeset 6274
- Timestamp:
- 05/22/12 17:53:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/rest/catalog/ContactPictureResource.php
r6148 r6274 6 6 parent::post($request); 7 7 8 if($this-> isLoggedIn() && $this->getParam('contactID') != null)8 if($this-> isLoggedIn()) 9 9 { 10 10 $contact = array(); 11 $contactID = $this->getParam('contactID'); 11 12 // User Contact 12 if($this->getParam('contactType') == 1 ){13 $query = 'select A.id_contact, A.photo from phpgw_cc_contact A where A.id_contact='.$ this->getParam('contactID').' and A.id_owner='.$this -> getUserId();13 if($this->getParam('contactType') == 1 && $contactID != null){ 14 $query = 'select A.id_contact, A.photo from phpgw_cc_contact A where A.id_contact='.$contactID.' and A.id_owner='.$this -> getUserId(); 14 15 if (!$this->getDb()->query($query)) 15 16 return false; … … 26 27 // Global Catalog 27 28 elseif($this->getParam('contactType') == 2){ 28 $photo = $this->getUserLdapPhoto(urldecode($this->getParam('contactID'))); 29 if(!$contactID){ 30 $contactID = $GLOBALS['phpgw_info']['user']['account_dn']; 31 } 32 $photo = $this->getUserLdapPhoto(urldecode($contactID)); 29 33 $contact[] = array( 30 'contactID' => $ this->getParam('contactID'),34 'contactID' => $contactID, 31 35 'contactImagePicture' => ($photo != null ? base64_encode($photo[0]) : "") 32 36 );
Note: See TracChangeset
for help on using the changeset viewer.