Changeset 6754 for branches/2.4/phpgwapi


Ignore:
Timestamp:
07/11/12 11:45:10 (12 years ago)
Author:
niltonneto
Message:

Ticket #0000 - Copiadas as alterações do Trunk. Versão final da 2.4.1.

Location:
branches/2.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4

  • branches/2.4/phpgwapi/inc/class.browser.inc.php

    r6731 r6754  
    4444                const PLATFORM_ANDROID = 'Android'; 
    4545                const PLATFORM_UNIX = 'Unix'; 
    46                 const PLATFORM_WINMOBILE = 'WinMobile';  
     46                const PLATFORM_WINMOBILE = 'WinMobile'; 
    4747 
    4848                function browser() 
     
    118118                                $this->BROWSER_PLATFORM = self::PLATFORM_MAC; 
    119119                        } 
    120                         elseif(strstr($HTTP_USER_AGENT,'IEMobile'))  
    121             {  
    122                     $this->BROWSER_PLATFORM = self::PLATFORM_WINMOBILE;  
    123             }  
     120                        elseif(strstr($HTTP_USER_AGENT,'IEMobile')) 
     121                        { 
     122                                $this->BROWSER_PLATFORM = self::PLATFORM_WINMOBILE; 
     123                        }        
    124124                        elseif(strstr($HTTP_USER_AGENT,'Win')) 
    125125                        { 
    126126                                $this->BROWSER_PLATFORM = self::PLATFORM_WINDOWS; 
    127                         }                        
     127                        }        
    128128                        elseif(strstr($HTTP_USER_AGENT,'Linux')) 
    129129                        { 
  • branches/2.4/phpgwapi/inc/class.setup_process.inc.php

    r6741 r6754  
    737737                                                                } 
    738738                                                        } 
    739                                                         // elseif ($GLOBALS['phpgw_setup']->alessthanb($value,$currentver))  
    740                                 // {  
    741                                 //      if($DEBUG) { echo '<br>process->upgrade(): running baseline delta only: ' . $function . '...'; }  
    742                                 //      $GLOBALS['phpgw_setup']->oProc->m_bDeltaOnly = True;  
    743                                 //      $success = $function(); 
     739                                                        // elseif ($GLOBALS['phpgw_setup']->alessthanb($value,$currentver)) 
     740                                                        // { 
     741                                                        //      if($DEBUG) { echo '<br>process->upgrade(): running baseline delta only: ' . $function . '...'; } 
     742                                                        //      $GLOBALS['phpgw_setup']->oProc->m_bDeltaOnly = True; 
     743                                                        //      $success = $function(); 
    744744                                                                 
    745                                                         //      // is the next update the one we need?  
    746                             //      if ($success && $test[$x+1] != $success &&  
    747                             //              ($num = array_search($success,$test)) !== False && $num !== null)  
    748                             //      {  
    749                             //              // do we have the needed update somewhere else in the row?  
    750                             //              // if yes, position the array-pointer just before that update and continue  
    751                             //              reset($test);  
    752                             //              while((list($x,$value) = each($test)) && $x < $num-1);  
    753                             //              continue;  
    754                             //      }  
    755                             // } 
     745                                                        //      // is the next update the one we need? 
     746                                                        //      if ($success && $test[$x+1] != $success && 
     747                                                        //              ($num = array_search($success,$test)) !== False && $num !== null) 
     748                                                        //      { 
     749                                                        //              // do we have the needed update somewhere else in the row? 
     750                                                        //              // if yes, position the array-pointer just before that update and continue 
     751                                                        //              reset($test); 
     752                                                        //              while((list($x,$value) = each($test)) && $x < $num-1); 
     753                                                        //              continue; 
     754                                                        //      } 
     755                                                        // } 
    756756                                                        else 
    757757                                                        {                                                                
  • branches/2.4/phpgwapi/setup/setup.inc.php

    r5141 r6754  
    1414        $setup_info['phpgwapi']['name']      = 'phpgwapi'; 
    1515        $setup_info['phpgwapi']['title']     = 'API'; 
    16         $setup_info['phpgwapi']['version']   = '2.4.0'; 
    17         $setup_info['phpgwapi']['versions']['current_header'] = '2.4.0'; 
     16        $setup_info['phpgwapi']['version']   = '2.4.1'; 
     17        $setup_info['phpgwapi']['versions']['current_header'] = '2.4.1'; 
    1818        $setup_info['phpgwapi']['enable']    = 3; 
    1919        $setup_info['phpgwapi']['app_order'] = 1; 
  • branches/2.4/phpgwapi/setup/tables_update.inc.php

    r5311 r6754  
    163163                return $GLOBALS['setup_info']['phpgwapi']['currentver']; 
    164164        } 
     165        $test[] = '2.4.0'; 
     166        function phpgwapi_upgrade2_4_0() 
     167        { 
     168                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '2.4.1'; 
     169                return $GLOBALS['setup_info']['phpgwapi']['currentver']; 
     170        } 
    165171?> 
  • branches/2.4/phpgwapi/templates/default/login_default.php

    r5281 r6754  
    177177                        else 
    178178                                $_POST['login'] = $_POST['user']; 
     179 
     180                        /** 
     181                         * LOGIN OAUTH POR CURL 
     182                         */ 
     183                        $ch = curl_init(); 
     184 
     185                        $restConf = parse_ini_file( __DIR__ . '/../../../prototype/config/REST.ini', true ); 
     186 
     187                        $param  = 'grant_type=password'; 
     188                        $param .= '&client_id=' . $restConf['oauth']['client_id']; 
     189                        $param .= '&client_secret=' . $restConf['oauth']['client_secret']; 
     190                        $param .= '&username=' . $_POST['user']; 
     191                        $param .= '&password=' . $_POST['passwd']; 
     192 
     193                        // set URL and other appropriate options 
     194                        curl_setopt($ch, CURLOPT_URL, $restConf['oauth']['url_token']); 
     195                        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
     196                        curl_setopt($ch, CURLOPT_POST, TRUE); 
     197                        curl_setopt($ch, CURLOPT_POSTFIELDS, $param); 
     198                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  //configura para nao imprimir a saida na tela 
     199                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);//Passe um nï¿œmero long como parï¿œmetro que contï¿œm o limite de tempo, em segundos, que vocï¿œ permite as funᅵᅵes CURL levar.  
     200 
     201                        // grab URL and pass it to the browser 
     202                        $res = curl_exec($ch); 
     203                         
     204                        // close cURL resource, and free up system resources 
     205                        curl_close($ch); 
     206                        $a = json_decode($res); 
     207         
     208                        if ( isset($a->access_token) ) { 
     209                                $_SESSION['oauth']['access_token'] = $a->access_token; 
     210                                $_SESSION['oauth']['expires_in'] = $a->expires_in; 
     211                                $_SESSION['oauth']['token_type'] = $a->token_type; 
     212                                $_SESSION['oauth']['scope'] = $a->scope; 
     213                                $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
     214                                 
     215                        } 
     216                        else { 
     217                        } 
     218                        /** 
     219                         * #################### 
     220                         */ 
     221 
    179222                } 
    180223                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 
     
    598641        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    599642 
    600         // Adiciona código personalizado de outro template 
     643        // Adiciona cï¿œdigo personalizado de outro template 
    601644        // que esteja utilizando o login_default.php 
    602645        if(is_file('.'.$template_dir.'/login.inc.php')) { 
Note: See TracChangeset for help on using the changeset viewer.