Changeset 1710

Show
Ignore:
Timestamp:
08/29/08 22:09:51 (3 months ago)
Author:
vollmerk
Message:

sync to branch

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/3.4/server/xml.server.php

    r1518 r1710  
    4949 * login via this interface so we do have an exception for action=login 
    5050 */ 
    51 if (!Access::check_network('init-api',$_SERVER['REMOTE_ADDR'],$_REQUEST['user'],'5')) {  
    52         debug_event('Access Denied','Unathorized access attempt to API [' . $_SERVER['REMOTE_ADDR'] . ']', '3'); 
    53         ob_end_clean();  
    54         echo xmlData::error('403','ACL Error'); 
    55         exit();  
    56 } 
    57  
    5851if ((!vauth::session_exists('api', $_REQUEST['auth']) AND $_REQUEST['action'] != 'handshake')) {  
    5952        debug_event('Access Denied','Invalid Session attempt to API [' . $_REQUEST['action'] . ']','3');  
     
    6356} 
    6457 
    65 // If we make it past the check and we're not a hand-shaking then we should extend the session 
    66 if ($_REQUEST['action'] != 'handshake') {  
     58// If the session exists then let's try to pull some data from it to see if we're still allowed to do this 
     59$session = vauth::get_session_data($_REQUEST['auth']); 
     60$username = ($_REQUEST['action'] == 'handshake') ? $_REQUEST['user'] : $session['username'];  
     61 
     62if (!Access::check_network('init-api',$_SERVER['REMOTE_ADDR'],$username,'5')) {  
     63        debug_event('Access Denied','Unathorized access attempt to API [' . $_SERVER['REMOTE_ADDR'] . ']', '3'); 
     64        ob_end_clean();  
     65        echo xmlData::error('403','ACL Error'); 
     66        exit();  
     67} 
     68 
     69if (!$_REQUEST['action'] != 'handshake') {  
    6770        vauth::session_extend($_REQUEST['auth']);  
    68         $session = vauth::get_session_data($_REQUEST['auth']); 
    6971        $GLOBALS['user'] = User::get_from_username($session['username']); 
    7072}  
     73 
    7174 
    7275switch ($_REQUEST['action']) {