[phplib-dev] cvs commit From: uw (phplib-dev <email protected>)
Date: 05/30/01

From: uw
Date: Wed May 30 12:48:56 2001
Modified files:
      php-lib/php/session/session4.inc
      php-lib/php/session/session4_custom.inc

Log message:
Don't know anymore on all the changes - any further comments on the API?

Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.7 php-lib/php/session/session4.inc:1.8
--- php-lib/php/session/session4.inc:1.7 Wed May 30 10:37:13 2001
+++ php-lib/php/session/session4.inc Wed May 30 12:48:24 2001
@@ -7,27 +7,28 @@
 *  <email protected> 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
 * 2000 Teodor Cimpoesu <teo <email protected>>
 *  <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>
-*  <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
+*  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
 *  <email protected> public
 *  <email protected> PHPLib
 */
 class Session4 {
 
+
   /**
- * Name of an optional autoinit-file
- *
- *  <email protected> string
- */
+ * Name of the autoinit-File, if any.
+ *
+ *  <email protected> string
+ */
   var $auto_init = "";
   
   
   /**
- * Set to false only, if all pages call
+ * Set to 0 only, if all pages call page_close() guaranteed.
+ *
+ *  <email protected> integer
+ */
+ var $secure_auto_init = 1;
   
- *  <email protected> boolean
- */
- var $secure_auto_init = true;
-
   
   /**
   * Marker: Did we already include the autoinit file?
@@ -148,7 +149,7 @@
   
   /**
   *  <email protected> id()
- *  <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
+ *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
   *  <email protected> public
   */
   function get_id($sid = '') {
@@ -208,7 +209,7 @@
   * doesn't seem to do (looking @ the session.c:940)
   * uw: yes we should keep it to remain the same interface, but deprec.
   *
- *  <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
+ *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
   *  <email protected> public
   *  <email protected> $HTTP_COOKIE_VARS
   */
@@ -232,7 +233,7 @@
   *  <email protected> boolean session_destroy return value
   *  <email protected> public
   */
- function delete () {
+ function delete() {
    
     $this->put_id();
     
@@ -250,10 +251,10 @@
   *  <email protected> string rewritten url with session id included
   *  <email protected> $trans_id_enabled
   *  <email protected> $HTTP_COOKIE_VARS
- *  <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
+ *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
   *  <email protected> public
   */
- function url ($url) {
+ function url($url) {
      global $HTTP_COOKIE_VARS;
     
     if ($this->trans_id_enabled)
@@ -269,24 +270,14 @@
 
     return $url;
     /*
- Ulf:
- Maxim, can you merge it? You're code looks more
- sophisticated. I'll also vote for you on the first
- international PHP obfuscated code contest if you can
- add some bit operations and format the code like a "M" for
- Maxim.
- Maxim:
- how about this? :)
-
- $url .=(
- strpos ( $url,
- '?' ) ) ? chr (
- ord ( '&') & ord ( '?'
- ) ) : chr ( ord ( '&' )
- | ord ( '?')) .urlencode (
- $this->name). "=" .$this->id ;
-
-
+
+ $url .=(
+ strpos ( $url,
+ '?' ) ) ? chr (
+ ord ( '&') & ord ( '?'
+ ) ) : chr ( ord ( '&' )
+ | ord ( '?')) .urlencode (
+ $this->name). "=" .$this->id ;
     */
   } // end func url
 
@@ -315,7 +306,7 @@
     return $this->url(getenv('REQUEST_URI'));
   } // end func self_url
 
-
+
   /**
   * Print the current URL
   *  <email protected> void
@@ -323,8 +314,8 @@
   function pself_url() {
     print $this->self_url();
   } // end func pself_url
-
-
+
+
   /**
   * Stores session id in a hidden variable (part of a form).
   *
@@ -332,44 +323,43 @@
   *  <email protected> public
   */
   function get_hidden_session() {
- return sprintf('<input type="hidden" name="%s" value="%s">',
+
+ if ($this->trans_id_enabled)
+ return "";
+ else
+ return sprintf('<input type="hidden" name="%s" value="%s">',
                     $this->name,
                     $this->id
       );
+
   } // end fun get_hidden_session
 
-
+
   /**
   *  <email protected> get_hidden_session
   *  <email protected> void
   */
   function hidden_session() {
- if ($this->trans_id_enabled)
- return;
-
     print $this->get_hidden_session();
   } // end func hidden_session
-
-
+
+
   /**
   *  <email protected> get_hidden_session
   */
   function get_hidden_id() {
     return $this->get_hidden_session();
   } // end func get_hidden_id
-
-
+
+
   /**
   *  <email protected> hidden_session
   */
   function hidden_id() {
- if ($this->trans_id_enabled)
- return;
-
     print $this->get_hidden_session();
   } // end func hidden_id
 
-
+
   /**
   * Prepend variables passed into an array to a query string.
   *
Index: php-lib/php/session/session4_custom.inc
diff -u php-lib/php/session/session4_custom.inc:1.10 php-lib/php/session/session4_custom.inc:1.11
--- php-lib/php/session/session4_custom.inc:1.10 Wed May 30 11:08:53 2001
+++ php-lib/php/session/session4_custom.inc Wed May 30 12:48:25 2001
@@ -10,7 +10,7 @@
  * some of the code taken from Teodor Cimpoesu's session4 class
  * Copyright (c) 2000 Teodor Cimpoesu <teo <email protected>>
  *
- * $Id: session4_custom.inc,v 1.10 2001/05/30 09:08:53 max Exp $
+ * $Id: session4_custom.inc,v 1.11 2001/05/30 10:48:25 uw Exp $
  *
  */
 
@@ -155,7 +155,6 @@
     if ($this->module == 'user') {
       $this->that->ac_delete($this->id, $this->name);
       $this->put_id();
- return true;
     }
     
     return true;

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>