richter 01/07/18 07:30:22
Modified: . Embperl.pm epcmd.c eputil.c
Log:
Session handling
Revision Changes Path
1.163 +3 -3 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- Embperl.pm 2001/07/18 07:27:50 1.162
+++ Embperl.pm 2001/07/18 14:30:21 1.163
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.162 2001/07/18 07:27:50 richter Exp $
+# $Id: Embperl.pm,v 1.163 2001/07/18 14:30:21 richter Exp $
#
###################################################################################
@@ -1674,7 +1674,7 @@
my $cookie_name = $r?$r -> CookieName:$ENV{EMBPERL_COOKIE_NAME} ||
'EMBPERL_UID' ;
my $cookie_val = $ENV{HTTP_COOKIE} ||
($req_rec?$req_rec->header_in('Cookie'):undef) ;
- if (defined ($cookie_val) && ($cookie_val =~ /$cookie_name=(.*?)(\;|\s|$)/))
+ if ((defined ($cookie_val) && ($cookie_val =~ /$cookie_name=(.*?)(\;|\s|$)/))
|| ($ENV{QUERY_STRING} =~ /$cookie_name=(.*?)(\;|\s|&|$)/))
{
$sessid = $1 ;
print HTML::Embperl::LOG "[$$]SES: Received user session cookie $1\n" if
($HTML::Embperl::dbgSession) ;
@@ -1683,7 +1683,7 @@
$udat -> setid ($sessid) if (!$udat -> getid) ;
$mdat -> setidfrom ($Inputfile) if ($Inputfile && !$mdat -> getid) ;
- if (defined ($cookie_val) && ($cookie_val =~ /${cookie_name}s=(.*?)(\;|\s|$)/))
+ if (($ENV{QUERY_STRING} =~ /${cookie_name}s=(.*?)(\;|\s|&|$)/) || (defined
($cookie_val) && ($cookie_val =~ /${cookie_name}s=(.*?)(\;|\s|$)/)))
{
$sessid = $1 ;
print HTML::Embperl::LOG "[$$]SES: Received status session cookie $1\n"
if ($HTML::Embperl::dbgSession) ;
1.42 +17 -2 embperl/epcmd.c
Index: epcmd.c
===================================================================
RCS file: /home/cvs/embperl/epcmd.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- epcmd.c 2001/05/16 03:56:54 1.41
+++ epcmd.c 2001/07/18 14:30:21 1.42
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epcmd.c,v 1.41 2001/05/16 03:56:54 richter Exp $
+# $Id: epcmd.c,v 1.42 2001/07/18 14:30:21 richter Exp $
#
###################################################################################*/
@@ -1127,7 +1127,22 @@
}
oputs (r, pArgBuf) ;
- r -> bEscInUrl = FALSE ;
+ if (r -> bOptions & optAddSessionToLinks)
+ {
+ if (strchr(pArgBuf, '?')
+ {
+ oputc(r, '&') ;
+ }
+ else
+ {
+ oputc(r, '?') ;
+ }
+ oputs (r, r -> pConf -> sCookieName) ;
+ oputc(r, '=') ;
+
+
+
+ r -> bEscInUrl = FALSE ;
NewEscMode (r, NULL) ;
if (pFreeBuf)
_free (r, pFreeBuf) ;
1.25 +52 -1 embperl/eputil.c
Index: eputil.c
===================================================================
RCS file: /home/cvs/embperl/eputil.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- eputil.c 2001/06/15 06:28:19 1.24
+++ eputil.c 2001/07/18 14:30:21 1.25
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: eputil.c,v 1.24 2001/06/15 06:28:19 richter Exp $
+# $Id: eputil.c,v 1.25 2001/07/18 14:30:21 richter Exp $
#
###################################################################################*/
@@ -1204,3 +1204,54 @@
cv_undef (pCV) ;
}
+
+/* ---------------------------------------------------------------------------- */
+/* */
+/* Get Session ID */
+/* */
+/* ---------------------------------------------------------------------------- */
+
+
+char * GetSessionID (/*i/o*/ register req * r,
+ /*in*/ HV * pSessionHash,
+ /*out*/ char * * ppInitialID,
+ /*out*/ IV * pModified)
+
+ {
+ SV ** ppSVID ;
+ SV * pSVID = NULL ;
+ MAGIC * pMG ;
+ char * pUID = "" ;
+ STRLEN ulen = 0 ;
+ STRLEN ilen = 0 ;
+
+ if (r -> nSessionMgnt)
+ {
+ SV * pUserHashObj = NULL ;
+ if ((pMG = mg_find((SV *)pSessionHash,'P')))
+ {
+ dSP; /* initialize stack pointer */
+ int n ;
+ pUserHashObj = pMG -> mg_obj ;
+
+ PUSHMARK(sp); /* remember the stack pointer */
+ XPUSHs(pUserHashObj) ; /* push pointer to obeject */
+ PUTBACK;
+ n = perl_call_method ("getids", G_ARRAY) ; /* call the function
*/
+ SPAGAIN;
+ if (n > 2)
+ {
+ int savewarn = dowarn ;
+ dowarn = 0 ; /* no warnings here */
+ *pModified = POPi ;
+ pSVID = POPs;
+ pUID = SvPV (pSVID, ulen) ;
+ pSVID = POPs;
+ *ppInitialID = SvPV (pSVID, ilen) ;
+ dowarn = savewarn ;
+ }
+ PUTBACK;
+ }
+ }
+ return pUID ;
+ }
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]