Changeset 3486


Ignore:
Timestamp:
11/10/10 12:57:43 (11 years ago)
Author:
rafaelraymundo
Message:

Ticket #831 - Encadeamento de proxies reversos e login

Location:
branches/2.2/phpgwapi
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/phpgwapi/inc/class.sessions.inc.php

    r3430 r3486  
    405405                { 
    406406                        // Use HTTP_X_FORWARDED_HOST if set, which is the case behind a none-transparent proxy 
    407                         $this->cookie_domain = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ?  $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']; 
     407                        //$this->cookie_domain = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ?  $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']; 
     408                        //Modificacao feita para que o Expresso redirecione para o primeiro proxy caso haja um encadeamento de mais de um proxy. 
     409                        $this->cookie_domain = nearest_to_me(); 
    408410 
    409411                        // remove port from HTTP_HOST 
  • branches/2.2/phpgwapi/inc/common_functions.inc.php

    r3437 r3486  
    706706        } 
    707707 
     708        /*! 
     709         @function nearest_to_me 
     710         @abstract return host nearest to client 
     711         @Include by Serpro ( Antonio Carlos da Silva). 
     712         */ 
     713        function nearest_to_me() 
     714        { 
     715                $proxies=explode(',',$_SERVER['HTTP_X_FORWARDED_HOST']); 
     716                return isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST']; 
     717        } 
     718 
    708719        /*! 
    709720         @function session_convert 
  • branches/2.2/phpgwapi/templates/default/login.tpl

    r3480 r3486  
    4040                newScreenX  = screen.width - newWidth;   
    4141                newScreenY  = 0;                 
    42                 Window1=window.open(link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");                              
     42                Window1=window.open('{dir_root}'+link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no"); 
    4343        } 
    4444        var opened = false, vkb = null, text = null;  
  • branches/2.2/phpgwapi/templates/default/login_default.php

    r3480 r3486  
    198198                                list($forward,$extra_vars) = explode('?',$forward,2); 
    199199                        } 
    200                         if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) 
    201                         { 
    202                                 $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); 
    203                                 echo "<script language='Javascript1.3'>location.href='".$forward."'</script>"; 
    204                         } 
    205                         else 
    206                         { 
    207                                 $GLOBALS['phpgw']->redirect_link($forward,$extra_vars); 
     200                if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) 
     201                        { 
     202                        //Modificacao feita para que o Expresso redirecione para o primeiro proxy caso haja um encadeamento de mais de um proxy. 
     203                        //$forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); 
     204                        $forward = 'http://' . nearest_to_me() . $GLOBALS['phpgw']->link($forward.'?cd=yes'); 
     205                        echo "<script language='Javascript1.3'>location.href='".$forward."'</script>"; 
     206                        } 
     207                else 
     208                        { 
     209                        $GLOBALS['phpgw']->redirect_link($forward,$extra_vars); 
    208210                        } 
    209211                } 
     
    363365        $tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']); 
    364366        $tmpl->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']); 
    365  
    366         include_once(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php'); 
    367         if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    368367 
    369368        $GLOBALS['phpgw']->translation->add_app('loginhelp',$_GET['lang']); 
     
    539538                 
    540539 
     540        $tmpl->set_var('dir_root', 'http://' . nearest_to_me() . '/'); 
     541        include_once(dirname( __FILE__ ) . '/../../../infodist/ultima-revisao-svn.php'); 
     542        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    541543        $tmpl->pfp('loginout','login_form'); 
    542544?> 
  • branches/2.2/phpgwapi/templates/default/navbar.inc.php

    r3338 r3486  
    278278                                $GLOBALS['phpgw_info']['user']['lastpasswd_change'] < $aux) 
    279279                        { 
    280                                 $changepasswd_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php?cd=1'; 
    281                                  
     280                                //$changepasswd_url = $_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/preferences/changepassword.php?cd=1'; 
     281                                $changepasswd_url = nearest_to_me() . '/preferences/changepassword.php?cd=1'; 
    282282                                if ($GLOBALS['phpgw_info']['server']['use_https'] > 0) 
    283283                                        $changepasswd_url = 'https://' . $changepasswd_url; 
Note: See TracChangeset for help on using the changeset viewer.