phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.sessions_db.inc.php,1.8,1.9 c


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.sessions_db.inc.php,1.8,1.9 class.sessions_php4.inc.php,1.11,1.12
Date: Wed, 11 Sep 2002 22:28:00 -0400

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

Modified Files:
        class.sessions_db.inc.php class.sessions_php4.inc.php 
Log Message:
This was something lacking and is now used with sitemgr.

Index: class.sessions_db.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_db.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.sessions_db.inc.php   2 Sep 2002 02:32:10 -0000       1.8
--- class.sessions_db.inc.php   12 Sep 2002 02:27:58 -0000      1.9
***************
*** 296,299 ****
--- 296,319 ----
                }
  
+               function phpgw_set_domain()
+               {
+                       $dom = $GLOBALS['HTTP_HOST'];
+                       if (preg_match("/^(.*):(.*)$/",$dom,$arr))
+                       {
+                               $dom = $arr[1];
+                       }
+                       $parts = explode('.',$dom);
+                       $this->dom = 
'.'.$parts[count($parts)-2].'.'.$parts[count($parts)-1];
+               }
+ 
+               function 
phpgw_setcookie($cookiename,$cookievalue='',$cookietime=0)
+               {
+                       if (!$this->dom)
+                       {
+                               $this->phpgw_set_domain();
+                       }
+                       
setcookie($cookiename,$cookievalue,$cookietime,'/',$this->dom); 
+               }
+ 
                function create($login,$passwd = '',$passwd_type = '')
                {
***************
*** 353,367 ****
                        if ($GLOBALS['phpgw_info']['server']['usecookies'])
                        {
!                               Setcookie('sessionid',$this->sessionid);
!                               Setcookie('kp3',$this->kp3);
!                               Setcookie('domain',$this->account_domain);
!                               
Setcookie('last_domain',$this->account_domain,$now+1209600);
                                if ($this->account_domain == 
$GLOBALS['phpgw_info']['server']['default_domain'])
                                {
!                                       Setcookie('last_loginid', 
$this->account_lid ,$now+1209600); /* For 2 weeks */
                                }
                                else
                                {
!                                       Setcookie('last_loginid', $login 
,$now+1209600); /* For 2 weeks */
                                }
                                
unset($GLOBALS['phpgw_info']['server']['default_domain']); /* we kill this for 
security reasons */
--- 373,387 ----
                        if ($GLOBALS['phpgw_info']['server']['usecookies'])
                        {
!                               
$this->phpgw_setcookie('sessionid',$this->sessionid);
!                               $this->phpgw_setcookie('kp3',$this->kp3);
!                               
$this->phpgw_setcookie('domain',$this->account_domain);
!                               
$this->phpgw_setcookie('last_domain',$this->account_domain,$now+1209600);
                                if ($this->account_domain == 
$GLOBALS['phpgw_info']['server']['default_domain'])
                                {
!                                       $this->phpgw_setcookie('last_loginid', 
$this->account_lid ,$now+1209600); /* For 2 weeks */
                                }
                                else
                                {
!                                       $this->phpgw_setcookie('last_loginid', 
$login ,$now+1209600); /* For 2 weeks */
                                }
                                
unset($GLOBALS['phpgw_info']['server']['default_domain']); /* we kill this for 
security reasons */
***************
*** 997,999 ****
                }
        }
! ?>
\ No newline at end of file
--- 1017,1019 ----
                }
        }
! ?>

Index: class.sessions_php4.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_php4.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.sessions_php4.inc.php 2 Sep 2002 02:32:10 -0000       1.11
--- class.sessions_php4.inc.php 12 Sep 2002 02:27:58 -0000      1.12
***************
*** 279,282 ****
--- 279,302 ----
                }
  
+               function phpgw_set_domain()
+               {
+                       $dom = $GLOBALS['HTTP_HOST'];
+                       if (preg_match("/^(.*):(.*)$/",$dom,$arr))
+                       {
+                               $dom = $arr[1];
+                       }
+                       $parts = explode('.',$dom);
+                       $this->dom = 
'.'.$parts[count($parts)-2].'.'.$parts[count($parts)-1];
+               }
+ 
+               function 
phpgw_setcookie($cookiename,$cookievalue='',$cookietime=0)
+               {
+                       if (!$this->dom)
+                       {
+                               $this->phpgw_set_domain();
+                       }
+                       
setcookie($cookiename,$cookievalue,$cookietime,'/',$this->dom); 
+               }
+ 
                function create($login,$passwd = '',$passwd_type = '')
                {
***************
*** 336,350 ****
                        if ($GLOBALS['phpgw_info']['server']['usecookies'])
                        {
!                               Setcookie('sessionid',$this->sessionid);
!                               Setcookie('kp3',$this->kp3);
!                               Setcookie('domain',$this->account_domain);
!                               
Setcookie('last_domain',$this->account_domain,$now+1209600);
                                if ($this->account_domain == 
$GLOBALS['phpgw_info']['server']['default_domain'])
                                {
!                                       Setcookie('last_loginid', 
$this->account_lid ,$now+1209600); /* For 2 weeks */
                                }
                                else
                                {
!                                       Setcookie('last_loginid', $login 
,$now+1209600); /* For 2 weeks */
                                }
                                
unset($GLOBALS['phpgw_info']['server']['default_domain']); /* we kill this for 
security reasons */
--- 356,370 ----
                        if ($GLOBALS['phpgw_info']['server']['usecookies'])
                        {
!                               
$this->phpgw_setcookie('sessionid',$this->sessionid);
!                               $this->phpgw_setcookie('kp3',$this->kp3);
!                               
$this->phpgw_setcookie('domain',$this->account_domain);
!                               
$this->phpgw_setcookie('last_domain',$this->account_domain,$now+1209600);
                                if ($this->account_domain == 
$GLOBALS['phpgw_info']['server']['default_domain'])
                                {
!                                       $this->phpgw_setcookie('last_loginid', 
$this->account_lid ,$now+1209600); /* For 2 weeks */
                                }
                                else
                                {
!                                       $this->phpgw_setcookie('last_loginid', 
$login ,$now+1209600); /* For 2 weeks */
                                }
                                
unset($GLOBALS['phpgw_info']['server']['default_domain']); /* we kill this for 
security reasons */





reply via email to

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