Ignore:
Timestamp:
05/31/12 16:52:19 (12 years ago)
Author:
cristiano
Message:

Ticket #2768 - Criação do modulo REST API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/phpgwapi/templates/default/login_default.php

    r6352 r6367  
    183183                        $ch = curl_init(); 
    184184 
     185                        $restConf = parse_ini_file( __DIR__ . '/../../../prototype/config/REST.ini', true ); 
     186 
    185187                        $param  = 'grant_type=password'; 
    186                         $param .= '&client_id=' . $GLOBALS['oauth']['client_id']; 
    187                         $param .= '&client_secret=' . $GLOBALS['oauth']['client_secret']; 
     188                        $param .= '&client_id=' . $restConf['oauth']['client_id']; 
     189                        $param .= '&client_secret=' . $restConf['oauth']['client_secret']; 
    188190                        $param .= '&username=' . $_POST['user']; 
    189191                        $param .= '&password=' . $_POST['passwd']; 
    190192 
    191193                        // set URL and other appropriate options 
    192                         curl_setopt($ch, CURLOPT_URL, $GLOBALS['oauth']['url_token']); 
     194                        curl_setopt($ch, CURLOPT_URL, $restConf['oauth']['url_token']); 
    193195                        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
    194196                        curl_setopt($ch, CURLOPT_POST, TRUE); 
     
    210212                                $_SESSION['oauth']['scope'] = $a->scope; 
    211213                                $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
    212                                  
    213214                                 
    214215                        } 
Note: See TracChangeset for help on using the changeset viewer.