Changeset 7324 for sandbox


Ignore:
Timestamp:
09/28/12 11:28:02 (12 years ago)
Author:
alexandrecorreia
Message:

Ticket #3093 - Criando o resource AvailableServers?( Servidores disponíveis com o recurso REST).

Location:
sandbox/2.4.3-expresso-rest/prototype
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.3-expresso-rest/prototype/adapters/ExpressoAdapter.php

    r7316 r7324  
    129129                if($this->getParam('auth') != null) { 
    130130                        list($sessionid, $kp3) = explode(":", $this->getParam('auth')); 
    131                         if($GLOBALS['phpgw']->session->verify($sessionid, $kp3)){                                                                        
     131                        if(!$GLOBALS['phpgw']->session->verify() && $GLOBALS['phpgw']->session->verify($sessionid, $kp3)){                                                                       
    132132                                return $sessionid; 
    133133                        } 
  • sandbox/2.4.3-expresso-rest/prototype/config/Tonic.srv

    r7313 r7324  
     1[/AvailableServers] 
     2AvailableServersResource = /availableServers/AvailableServersResource.php 
     3 
    14[/Catalog/Contacts] 
    25ContactsResource = /catalog/ContactsResource.php 
  • sandbox/2.4.3-expresso-rest/prototype/rest/availableServers/AvailableServersResource.php

    r7306 r7324  
    1111        function get($request){ 
    1212                $error = null;           
    13                 parse_str($request->data, &$data);               
    14                 $handle = fopen('../config/rest_servers.conf', "r"); 
    15                 $servers= array();       
    16                 if($handle) { 
    17                         while (!feof ($handle)) { 
    18                                 $line = fgets($handle,1024); 
    19                                 if($line == null) 
    20                                         continue; 
    21                                 list($id, $name, $description, $url, $context, $status) = explode(";",$line); 
    22                                 $servers[] = array( 
    23                                                 'serverID' => $id, 
    24                                                 'serverName' => $name, 
    25                                                 'serverDescription' => utf8_encode($description), 
    26                                                 'serverUrl' => $url, 
    27                                                 'serverContext' => $context, 
    28                                                 'serverStatus' => ($status ? "1" : "0") 
    29                                 ); 
     13                parse_str($request->data, &$data); 
     14                                 
     15                if( file_exists(__DIR__ . '/../../config/REST.ini') ) 
     16                { 
     17                        $restServers = parse_ini_file( __DIR__ . '/../../config/REST.ini', true ); 
     18                         
     19                        foreach( $restServers as $key => $value) 
     20                        { 
     21                                if(substr( $key, 0, 11 ) == "ServersRest") 
     22                                { 
     23                                        $servers[] = $value; 
     24                                } 
    3025                        } 
    31                         fclose($handle); 
    3226                } 
    3327                else{ 
  • sandbox/2.4.3-expresso-rest/prototype/rest/dispatch.php

    r7322 r7324  
    1111require_once(__DIR__."/../adapters/CatalogAdapter.php"); 
    1212require_once(__DIR__."/../adapters/CalendarAdapter.php"); 
    13 //require_once(__DIR__."/../adapters/testeAdapter.php"); 
    1413 
    1514//Retrieveing the mapping of the URIs and his respectives classNames and classPath 
Note: See TracChangeset for help on using the changeset viewer.