HomeHelpTrac

Changeset 12175 for trunk/xmlrpc


Ignore:
Timestamp:
08/19/09 04:11:25 (3 years ago)
Author:
Alexander Trofimov
Message:
 
Location:
trunk/xmlrpc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCUser.php

    r12090 r12175  
    99    } 
    1010     
     11    function getUserLocation ($sUser, $sPwd, $sNick)  
     12    { 
     13        if (!($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 
     14            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
     15        
     16        $iProfileId = getID($sNick, false); 
     17        $aLocation = BxDolService::call('map_profiles', 'get_location', array($iProfileId, $iId, true)); 
     18        if (-1 == $aLocation) // access denied 
     19            return new xmlrpcval("-1"); 
     20        if (!is_array($aLocation)) // location is undefined 
     21            return new xmlrpcval("0"); 
     22 
     23        return new xmlrpcval(array( 
     24            'lat' => new xmlrpcval($aLocation['lat']), 
     25            'lng' => new xmlrpcval($aLocation['lng']), 
     26            'zoom' => new xmlrpcval($aLocation['zoom']), 
     27            'type' => new xmlrpcval($aLocation['type']), 
     28            'address' => new xmlrpcval($aLocation['address']), 
     29            'country' => new xmlrpcval($aLocation['country']), 
     30        ), 'struct'); 
     31    } 
     32 
    1133    function getHomepageInfo($sUser, $sPwd) 
    1234    { 
  • trunk/xmlrpc/index.php

    r11963 r12175  
    7272            ),                         
    7373 
     74            "dolphin.getUserLocation" => array( 
     75                "function" => "BxDolXMLRPCUser::getUserLocation", 
     76                "signature" => array (array ($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 
     77                "docstring" => "get user location, returns struct on succees, 0 on error, -1 on access denied", 
     78            ),  
     79 
    7480            // messages 
    7581             
Note: See TracChangeset for help on using the changeset viewer.