phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.browser.inc.php,1.15,1.16


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.browser.inc.php,1.15,1.16
Date: Sat, 13 Apr 2002 17:38:37 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv3465

Modified Files:
        class.browser.inc.php 
Log Message:
format, add one cache header

Index: class.browser.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.browser.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.browser.inc.php       29 Jan 2002 00:48:03 -0000      1.15
--- class.browser.inc.php       13 Apr 2002 21:38:34 -0000      1.16
***************
*** 40,82 ****
                                Determine browser and version
                        */
!                       if (ereg( 'MSIE 
([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER = $log_version[1];
                                $this->BROWSER_AGENT = 'IE';
                        }
!                       elseif (ereg( 'Opera 
([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) ||
!                               ereg( 
'Opera/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'OPERA';
                        }
!                       elseif ( eregi( 'iCab 
([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version) ||
!                               eregi( 
'iCab/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'iCab';
                        } 
!                       elseif ( eregi( 
'Netscape6/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version)) 
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'Netscape';
                        }
! 
!                       elseif (ereg( 
'Konqueror/([0-9].[0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) ||
                                ereg( 
'Konqueror/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
!                               $this->BROWSER_VER=$log_version[1];
!                               $this->BROWSER_AGENT='Konqueror';
                        }
! 
!                       elseif (ereg( 
'Mozilla/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
!                               $this->BROWSER_VER=$log_version[1];
!                               $this->BROWSER_AGENT='MOZILLA';
                        }
                        else
                        {
!                               $this->BROWSER_VER=0;
!                               $this->BROWSER_AGENT='OTHER';
                        }
  
--- 40,80 ----
                                Determine browser and version
                        */
!                       if(ereg('MSIE 
([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER = $log_version[1];
                                $this->BROWSER_AGENT = 'IE';
                        }
!                       elseif(ereg('Opera 
([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) ||
!                               
ereg('Opera/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'OPERA';
                        }
!                       elseif(eregi('iCab 
([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version) ||
!                               
eregi('iCab/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version))
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'iCab';
                        } 
!                       
elseif(eregi('Netscape6/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version))
 
                        {
                                $this->BROWSER_VER   = $log_version[1];
                                $this->BROWSER_AGENT = 'Netscape';
                        }
!                       
elseif(ereg('Konqueror/([0-9].[0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) 
||
                                ereg( 
'Konqueror/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
!                               $this->BROWSER_VER   = $log_version[1];
!                               $this->BROWSER_AGENT = 'Konqueror';
                        }
!                       
elseif(ereg('Mozilla/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
                        {
!                               $this->BROWSER_VER   = $log_version[1];
!                               $this->BROWSER_AGENT = 'MOZILLA';
                        }
                        else
                        {
!                               $this->BROWSER_VER   = 0;
!                               $this->BROWSER_AGENT = 'OTHER';
                        }
  
***************
*** 84,104 ****
                                Determine platform
                        */
!                       if (strstr($HTTP_USER_AGENT,'Win'))
                        {
                                $this->BROWSER_PLATFORM='Win';
                        }
!                       else if (strstr($HTTP_USER_AGENT,'Mac'))
                        {
                                $this->BROWSER_PLATFORM='Mac';
                        }
!                       else if (strstr($HTTP_USER_AGENT,'Linux'))
                        {
                                $this->BROWSER_PLATFORM='Linux';
                        }
!                       else if (strstr($HTTP_USER_AGENT,'Unix'))
                        {
                                $this->BROWSER_PLATFORM='Unix';
                        }
!                       else if (strstr($HTTP_USER_AGENT,'Beos'))
                        {
                                $this->BROWSER_PLATFORM='Beos';
--- 82,102 ----
                                Determine platform
                        */
!                       if(strstr($HTTP_USER_AGENT,'Win'))
                        {
                                $this->BROWSER_PLATFORM='Win';
                        }
!                       elseif(strstr($HTTP_USER_AGENT,'Mac'))
                        {
                                $this->BROWSER_PLATFORM='Mac';
                        }
!                       elseif(strstr($HTTP_USER_AGENT,'Linux'))
                        {
                                $this->BROWSER_PLATFORM='Linux';
                        }
!                       elseif(strstr($HTTP_USER_AGENT,'Unix'))
                        {
                                $this->BROWSER_PLATFORM='Unix';
                        }
!                       elseif(strstr($HTTP_USER_AGENT,'Beos'))
                        {
                                $this->BROWSER_PLATFORM='Beos';
***************
*** 111,142 ****
                        /*
                        echo "\n\nAgent: $HTTP_USER_AGENT";
!                       echo "\nIE: ".browser_is_ie();
!                       echo "\nMac: ".browser_is_mac();
!                       echo "\nWindows: ".browser_is_windows();
!                       echo "\nPlatform: ".browser_get_platform();
!                       echo "\nVersion: ".browser_get_version();
!                       echo "\nAgent: ".browser_get_agent();
                        */
  
!                       // The br and p functions are supposed to return the 
correct
                        // value for tags that do not need to be closed.  This 
is
                        // per the xhmtl spec, so we need to fix this to include
                        // all compliant browsers we know of.
!                       if ($this->BROWSER_AGENT == 'IE')
                        {
                                $this->br = '<br/>';
                        }
                        else
                        {
                                $this->br = '<br>';
!                       }
! 
!                       if ($this->BROWSER_AGENT =='IE')
!                       {
!                               $this->p = '<p/>';
!                       }
!                       else
!                       {
!                               $this->p = '<p>';
                        }
                }
--- 109,133 ----
                        /*
                        echo "\n\nAgent: $HTTP_USER_AGENT";
!                       echo "\nIE: "       . $this->is_ie();
!                       echo "\nMac: "      . $this->is_mac();
!                       echo "\nWindows: "  . $this->is_windows();
!                       echo "\nPlatform: " . $this->get_platform();
!                       echo "\nVersion: "  . $this->get_version();
!                       echo "\nAgent: "    . $this->get_agent();
                        */
  
!                       // The br and p vars are supposed to return the correct
                        // value for tags that do not need to be closed.  This 
is
                        // per the xhmtl spec, so we need to fix this to include
                        // all compliant browsers we know of.
!                       if($this->BROWSER_AGENT == 'IE')
                        {
                                $this->br = '<br/>';
+                               $this->p  = '<p/>';
                        }
                        else
                        {
                                $this->br = '<br>';
!                               $this->p  = '<p>';
                        }
                }
***************
*** 170,174 ****
                function is_linux()
                {
!                       if ($this->get_platform()=='Linux')
                        {
                                return true;
--- 161,165 ----
                function is_linux()
                {
!                       if($this->get_platform()=='Linux')
                        {
                                return true;
***************
*** 182,186 ****
                function is_unix()
                {
!                       if ($this->get_platform()=='Unix')
                        {
                                return true;
--- 173,177 ----
                function is_unix()
                {
!                       if($this->get_platform()=='Unix')
                        {
                                return true;
***************
*** 194,198 ****
                function is_beos()
                {
!                       if ($this->get_platform()=='Beos')
                        {
                                return true;
--- 185,189 ----
                function is_beos()
                {
!                       if($this->get_platform()=='Beos')
                        {
                                return true;
***************
*** 206,210 ****
                function is_mac()
                {
!                       if ($this->get_platform()=='Mac')
                        {
                                return true;
--- 197,201 ----
                function is_mac()
                {
!                       if($this->get_platform()=='Mac')
                        {
                                return true;
***************
*** 218,222 ****
                function is_windows()
                {
!                       if ($this->get_platform()=='Win')
                        {
                                return true;
--- 209,213 ----
                function is_windows()
                {
!                       if($this->get_platform()=='Win')
                        {
                                return true;
***************
*** 230,234 ****
                function is_ie()
                {
!                       if ($this->get_agent()=='IE')
                        {
                                return true;
--- 221,225 ----
                function is_ie()
                {
!                       if($this->get_agent()=='IE')
                        {
                                return true;
***************
*** 242,246 ****
                function is_netscape()
                {
!                       if ($this->get_agent()=='MOZILLA')
                        {
                                return true;
--- 233,237 ----
                function is_netscape()
                {
!                       if($this->get_agent()=='MOZILLA')
                        {
                                return true;
***************
*** 254,258 ****
                function is_opera()
                {
!                       if ($this->get_agent()=='OPERA')
                        {
                                return true;
--- 245,249 ----
                function is_opera()
                {
!                       if($this->get_agent()=='OPERA')
                        {
                                return true;
***************
*** 267,279 ****
                function 
content_header($fn='',$mime='',$length='',$nocache=True)
                {
!                       if (!$mime)
                        {
                                $mime='application/octet-stream';
                        }
!                       if ($fn)
                        {
!                               if ($this->get_agent() == 'IE') // && 
browser_get_version() == "5.5")
                                {
                                        $attachment = '';
                                }
                                else
--- 258,271 ----
                function 
content_header($fn='',$mime='',$length='',$nocache=True)
                {
!                       if(!$mime)
                        {
                                $mime='application/octet-stream';
                        }
!                       if($fn)
                        {
!                               if($this->get_agent() == 'IE')
                                {
                                        $attachment = '';
+                                       header('Cache-control: private');
                                }
                                else
***************
*** 282,295 ****
                                }
  
!                               // Show this for all
!                               header('Content-disposition:'.$attachment.' 
filename="'.$fn.'"');
!                               header('Content-type: '.$mime);
  
!                               if ($length)
                                {
                                        header('Content-length: '.$length);
                                }
  
!                               if ($nocache)
                                {
                                        header('Pragma: no-cache');
--- 274,286 ----
                                }
  
!                               header('Content-type: ' . $mime);
!                               header('Content-disposition:' . $attachment . ' 
filename="' . $fn . '"');
  
!                               if($length)
                                {
                                        header('Content-length: '.$length);
                                }
  
!                               if($nocache)
                                {
                                        header('Pragma: no-cache');




reply via email to

[Prev in Thread] Current Thread [Next in Thread]