Changeset 7855 for sandbox


Ignore:
Timestamp:
02/05/13 15:03:49 (11 years ago)
Author:
alexandrecorreia
Message:

Ticket #2507 - Correções dentro da API do webservice do expresso

Location:
sandbox/webservice/api/rest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/rest/availableServers/AvailableServersResource.php

    r7463 r7855  
    1414                parse_str($request->data, &$data); 
    1515                                 
    16                 if( file_exists(__DIR__ . '/../../config/REST.ini') ) 
     16                if( file_exists(API_DIRECTORY.'/../../config/REST.ini') ) 
    1717                { 
    18                         $restServers = parse_ini_file( __DIR__ . '/../../config/REST.ini', true ); 
     18                        $restServers = parse_ini_file(API_DIRECTORY.'/../../config/REST.ini', true ); 
    1919                         
    2020                        foreach( $restServers as $key => $value) 
  • sandbox/webservice/api/rest/catalog/ContactPictureResource.php

    r6274 r7855  
    1010                        $contact = array(); 
    1111                        $contactID = $this->getParam('contactID'); 
     12 
    1213                        // User Contact 
    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(); 
    15                                 if (!$this->getDb()->query($query)) 
    16                                         return false; 
    17                                 if($this->getDb()->next_record()) { 
    18                                         $row = $this->getDb()->row(); 
    19                                         if($row['photo'] != null) { 
    20                                                 $contact[] = array( 
    21                                                                 'contactID'             => $row['id_contact'], 
    22                                                                 'contactImagePicture'   => ($row['photo'] != null ? base64_encode($row['photo']) : "") 
    23                                                 ); 
    24                                         } 
    25                                 } 
    26                         } 
     14            if($this->getParam('contactType') == 1 && $contactID != null){ 
     15 
     16                $query = "select A.id_contact, A.photo from phpgw_cc_contact A where A.id_contact= ? and A.id_owner = ? "; 
     17 
     18                $result = $this->getDb()->Link_ID->query($query, array($contactID,$this->getUserId())); 
     19 
     20                if ($result) { 
     21 
     22                    while($row = $result->fetchRow()) { 
     23                        if($row['photo'] != null) { 
     24                            $contact[] = array( 
     25                                'contactID'     => $row['id_contact'], 
     26                                'contactImagePicture'   => ($row['photo'] != null ? base64_encode($row['photo']) : "") 
     27                            ); 
     28                        } 
     29                    } 
     30    
     31                } 
     32            } 
     33 
    2734                        // Global Catalog 
    2835                        elseif($this->getParam('contactType') == 2){ 
  • sandbox/webservice/api/rest/dispatch.php

    r7811 r7855  
    11<?php 
    22 
    3 $dir = $_SERVER['DOCUMENT_ROOT']; 
    4  
    5 if (substr($dir,strlen($dir)-1,strlen($dir)) != "/") { 
    6         $dir = $dir . "/"; 
    7 } 
    8  
    9 define( API_DIRECTORY , $dir . "expresso_22/api/rest" ); 
     3define('API_DIRECTORY','/var/www/expresso/api/rest', True); 
    104 
    115// load libraries 
Note: See TracChangeset for help on using the changeset viewer.