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.2.2.3,1


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.sessions_db.inc.php,1.2.2.3,1.2.2.4 class.sessions_php4.inc.php,1.6.2.2,1.6.2.3
Date: Wed, 11 Sep 2002 22:27:40 -0400

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

Modified Files:
      Tag: Version-0_9_14-branch
        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.2.2.3
retrieving revision 1.2.2.4
diff -C2 -r1.2.2.3 -r1.2.2.4
*** class.sessions_db.inc.php   2 Sep 2002 02:32:33 -0000       1.2.2.3
--- class.sessions_db.inc.php   12 Sep 2002 02:27:37 -0000      1.2.2.4
***************
*** 51,54 ****
--- 51,56 ----
                );
  
+               var $dom;
+ 
                
/*************************************************************************\
                * Constructor just loads up some defaults from cookies          
          *
***************
*** 288,291 ****
--- 290,313 ----
                }
  
+               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 = '')
                {
***************
*** 345,359 ****
                        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 */
--- 367,381 ----
                        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 */
***************
*** 993,995 ****
                }
        }
! ?>
\ No newline at end of file
--- 1015,1017 ----
                }
        }
! ?>

Index: class.sessions_php4.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_php4.inc.php,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -C2 -r1.6.2.2 -r1.6.2.3
*** class.sessions_php4.inc.php 2 Sep 2002 02:32:33 -0000       1.6.2.2
--- class.sessions_php4.inc.php 12 Sep 2002 02:27:37 -0000      1.6.2.3
***************
*** 272,275 ****
--- 272,295 ----
                }
  
+               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 = '')
                {
***************
*** 329,343 ****
                        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 */
--- 349,363 ----
                        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]