Date: 10/24/99
- Next message: kk: "[PHPLIB-DEV] cvs commit"
- Previous message: kk: "[PHPLIB-DEV] cvs commit"
- Next in thread: kk: "[PHPLIB-DEV] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: kk
Date: Sun Oct 24 14:15:54 1999
Removed files:
php-lib/unsup/auth_v2.inc
Modified files:
php-lib/CHANGES
php-lib/doc/sgml/01-qinstgui.sgml
php-lib/doc/sgml/02-download.sgml
php-lib/doc/sgml/02-files.sgml
php-lib/doc/sgml/02-mod_php.sgml
php-lib/doc/sgml/02-procedure.sgml
php-lib/doc/sgml/02-requirements.sgml
php-lib/doc/sgml/03-ct_dbm.sgml
php-lib/doc/sgml/03-ct_ldap.sgml
php-lib/doc/sgml/03-ct_shm.sgml
php-lib/doc/sgml/03-ct_split_sql.sgml
php-lib/doc/sgml/03-ct_sql.sgml
php-lib/doc/sgml/03-db_sql.sgml
php-lib/doc/sgml/03-session.sgml
php-lib/doc/sgml/documentation.sgml
php-lib/php/auth.inc
php-lib/php/db_mssql.inc
php-lib/php/db_mysql.inc
php-lib/php/session.inc
Log message:
- Documentation update, second coming.
- Auth code from Massimilano taken.
- db_mssql.inc spelling fix: Auto_Free.
Index: php-lib/CHANGES
diff -u php-lib/CHANGES:1.107 php-lib/CHANGES:1.108
--- php-lib/CHANGES:1.107 Sun Oct 24 12:27:19 1999
+++ php-lib/CHANGES Sun Oct 24 14:15:19 1999
@@ -1,7 +1,15 @@
-$Id: CHANGES,v 1.107 1999/10/24 10:27:19 kk Exp $
+$Id: CHANGES,v 1.108 1999/10/24 12:15:19 kk Exp $
24-Oct-1999 kk
- Documentation update, prepare for armageddon
+ - Reviewed unsup/auth_v2.inc, removed all reference to
+ ct_sql.inc, as there is no code dependent on that class
+ in Auth (there may be such code in an Auth subclass, but
+ that is outside the scope of the library).
+ - Took Massimilianos auth code, because it is cleaner and
+ straighter that what we had before.
+ - db_mssql.inc: Auto_Free spelling fix.
+
22-Oct-1999 kk
- New method is_registered() for Session class.
Index: php-lib/doc/sgml/01-qinstgui.sgml
diff -u php-lib/doc/sgml/01-qinstgui.sgml:1.2 php-lib/doc/sgml/01-qinstgui.sgml:1.3
--- php-lib/doc/sgml/01-qinstgui.sgml:1.2 Sun Oct 24 12:21:23 1999
+++ php-lib/doc/sgml/01-qinstgui.sgml Sun Oct 24 14:15:19 1999
@@ -1,11 +1,11 @@
-<!-- $Id: 01-qinstgui.sgml,v 1.2 1999/10/24 10:21:23 kk Exp $ -->
+<!-- $Id: 01-qinstgui.sgml,v 1.3 1999/10/24 12:15:19 kk Exp $ -->
<sect1>Quick Guide to Installation
<p>
These instructions apply to PHPLIB running with CGI PHP. Most of
-them are valid for mod_php as well, though. <b>VERY
-IMPORTANT NOTE:</b> This is a quick installation guide to get
+them are valid for mod_php as well, though. <em>VERY
+IMPORTANT NOTE:</em> This is a quick installation guide to get
you started if you have an installation where you control the
web server, PHP interpreter and database server completely. They
are not suitable for a web hosting setup where you have only
@@ -45,7 +45,7 @@
<tt/prepend.php3/ file in that include directory.
If you do not have control over your php3.ini file, you did not
- read the <b>VERY IMPORTANT NOTE</b> above.
+ read the <em>VERY IMPORTANT NOTE</em> above.
<tag>Step 4</tag>
<p>Also check that <tt/track_vars/ are enabled and that you have
@@ -55,7 +55,7 @@
on most UNIX systems to work.
If you do not have control over your php3.ini file, you did
- not read the <b>VERY IMPORTANT NOTE</b> above.
+ not read the <em>VERY IMPORTANT NOTE</em> above.
<tag>Step 5</tag>
<p>cd into the <tt/php/ include directory. Edit <tt/local.inc/.
Index: php-lib/doc/sgml/02-download.sgml
diff -u php-lib/doc/sgml/02-download.sgml:1.1 php-lib/doc/sgml/02-download.sgml:1.2
--- php-lib/doc/sgml/02-download.sgml:1.1 Fri Jul 16 23:45:26 1999
+++ php-lib/doc/sgml/02-download.sgml Sun Oct 24 14:15:19 1999
@@ -1,9 +1,9 @@
-<!-- $Id: 02-download.sgml,v 1.1 1999/07/16 21:45:26 kk Exp $ -->
+<!-- $Id: 02-download.sgml,v 1.2 1999/10/24 12:15:19 kk Exp $ -->
<sect1>Downloading and unpacking the distribution
<p>The base library is supplied at <htmlurl
-url="http://phplib.shonline.de/" name="the PHP Base Library
+url="http://phplib.netuse.de/" name="the PHP Base Library
download location">. Two different formats are provided: A
tar.gz version and a shar version.
@@ -17,3 +17,9 @@
This is a pure ASCII file containing a self extracting shell
script. Just save the file, make it executable and feed it to
your Unix shell (for example, by typing <tt/sh phplib.shar/).
+
+The <htmlurl url="mailto:phplib <email protected>" name="PHPLIB
+support mailing list"> is available should you run into problems
+with the library. To subscribe send the command <tt/subscribe/
+to <htmlurl url="mailto:phplib-request <email protected>"
+name="the mailing list subscription address">.
Index: php-lib/doc/sgml/02-files.sgml
diff -u php-lib/doc/sgml/02-files.sgml:1.3 php-lib/doc/sgml/02-files.sgml:1.4
--- php-lib/doc/sgml/02-files.sgml:1.3 Sun Oct 24 12:27:19 1999
+++ php-lib/doc/sgml/02-files.sgml Sun Oct 24 14:15:19 1999
@@ -1,4 +1,4 @@
-<!-- $Id: 02-files.sgml,v 1.3 1999/10/24 10:27:19 kk Exp $ -->
+<!-- $Id: 02-files.sgml,v 1.4 1999/10/24 12:15:19 kk Exp $ -->
<sect1>Files, classes and functions
<p>
@@ -14,7 +14,7 @@
change any of these files. Your customization of PHPLIB can be
contained in two or three files, depending on the setup:
<tt/local.inc/, <tt/setup.inc/ and, in some cases,
-<tt/prepend.php3/. You <b/NEVER/ need to change any other file
+<tt/prepend.php3/. You <em/NEVER/ need to change any other file
with PHPLIB. Details are outlined below.
<sect2>Customization
Index: php-lib/doc/sgml/02-mod_php.sgml
diff -u php-lib/doc/sgml/02-mod_php.sgml:1.1 php-lib/doc/sgml/02-mod_php.sgml:1.2
--- php-lib/doc/sgml/02-mod_php.sgml:1.1 Fri Jul 16 23:45:28 1999
+++ php-lib/doc/sgml/02-mod_php.sgml Sun Oct 24 14:15:19 1999
@@ -1,25 +1,47 @@
-<!-- $Id: 02-mod_php.sgml,v 1.1 1999/07/16 21:45:28 kk Exp $ -->
+<!-- $Id: 02-mod_php.sgml,v 1.2 1999/10/24 12:15:19 kk Exp $ -->
<sect1>PHPLIB with mod_php (Apache module)
<p>
-The following was contributed by Giancarlo Pinerolo on the
-PHPLIB mailing list.
-
Installing PHPLIB onto a web server that has PHP3 as a module
(actually Apache) mainly differs in where you can set up runtime
settings for PHP3 itself. PHP3 can be compiled with a wealth of
-parameters (see the PHP section in phpinfo()), most of which can
-get overridden by the <tt/php.ini/ file, located by default, on
-Unix, in /usr/local/lib.
+parameters (see the PHP section in <tt/phpinfo()/), most of which can
+get overridden by the <tt/php3.ini/ file. The location of this
+file is shows as part of the output of <tt/phpinfo()/.
With PHP3 as a module you have a wider choice on placing these
settings: they are overridden, in this order, by what is defined
-in <tt/httpd.conf/ and in your per-directory <tt/.htaccess/ file.
-Directives in these files are identical to their <tt/php3.ini/
-brothers, but are prefixed with <tt/php_/ to avoid
-clashes with Apache configuration keywords.
+in <tt/httpd.conf/ and in your per-directory <tt/.htaccess/
+file. Directives in these files are identical to their
+<tt/php3.ini/ brothers, but are prefixed with <tt/php_/
+to avoid clashes with Apache configuration keywords. Also, as
+they are Apache configuration keywords, they have no equals
+("=") sign in them. If <tt/x=y/ is a configuration directive
+from <tt/php3.ini/, you should be using <tt/php3_x y/
+within the Apache configuration instead. That is, you should
+prepend <tt/php3_/ to the keyword and omit the equals
+sign. If you misspell a configuration directive, you will get an
+error 500 from your webserver and find more details about the
+error in the logfile you configured with <tt/ErrorLog/ in your
+webserver setup.
+
+<em/Example:/ If below we talk about setting in your
+<tt/php3.ini/ the configuration
+
+<tscreen><code>
+include_path = "/bla"
+</code></tscreen>
+<tt/mod_php/ users may alternatively configure in their
+<tt/httpd.conf/ the following:
+
+<tscreen><code>
+<Directory /home/www/servers/phplib.netuse.de/pages>
+php3_include_path "/bla"
+</Directory>
+</code></tscreen>
+
Of special interest to PHPLIB users are the following
directives:
@@ -46,14 +68,6 @@
include_path = (add path to the directory with all .inc files)
</code></tscreen>
-
-When you write these directives in your per-directory
-<tt/.htaccess/ files and in <tt/httpd.conf/, you have to prepend
-them with <tt/php3_/ and omit the <tt/=/ sign.
-
-That is, the <tt/php3.ini/ statement <tt>include_path =
-/home/www/phplib</tt> becomes <tt>php3_include_path
-/home/www/phplib</tt> in an Apache configuration file.
All of this comes very handy when you have multiple virtual
hosts (e.g. you are an ISP). In this case you can comfortably
Index: php-lib/doc/sgml/02-procedure.sgml
diff -u php-lib/doc/sgml/02-procedure.sgml:1.2 php-lib/doc/sgml/02-procedure.sgml:1.3
--- php-lib/doc/sgml/02-procedure.sgml:1.2 Sat Jul 17 15:25:50 1999
+++ php-lib/doc/sgml/02-procedure.sgml Sun Oct 24 14:15:20 1999
@@ -1,7 +1,16 @@
-<!-- $Id: 02-procedure.sgml,v 1.2 1999/07/17 13:25:50 negro Exp $ -->
+<!-- $Id: 02-procedure.sgml,v 1.3 1999/10/24 12:15:20 kk Exp $ -->
-<sect1>Installation procedure
-<p>
+<sect1>Installation procedure
+
+<p><tt/mod_php/ note: The following instructions apply
+to the CGI version of PHP as well as to the module version. If
+you are working with <tt/mod_php/, you must restart your
+web server to force a reload of the <tt/php3.ini/ file, though.
+
+If you are using <tt/mod_php/, you have additional
+configuration options: See the section below on using PHPLIB
+mit <tt/mod_php/.
+
<descrip>
<tag>Library Setup</tag>
@@ -9,13 +18,13 @@
Create a directory php next to your cgi:
<tscreen><code>
-/home/www/servers/poe.shonline.de/pages <- document root
- cgi <- php binary
- php <- includes and prepends
+/home/www/servers/phplib.netuse.de/pages <- document root
+ cgi <- php binary
+ php <- includes and prepends
</code></tscreen>
Make this php directory your php include directory: Put
-<tt>include_path = /home/www/servers/poe.shonline.de/php</tt>
+<tt>include_path = /home/www/servers/phplib.netuse.de/php</tt>
into <tt>cgi/php3.ini</tt>. If you already have an include path
defined in your setup, add the PHPLIB include path to the
existing include path using the separator character applicable
@@ -47,7 +56,7 @@
<tt/db_<databasename>.inc/. The <tt/require()/
statement has to be adapted to reflect this).
-Assuming your database server is named <tt/database.shonline.de/
+Assuming your database server is named <tt/database.netuse.de/
and your CGI user is <tt/webuser/ and you are accessing the
database <tt/myapp/, do
@@ -78,11 +87,12 @@
<tt/auto_prepend_file/
here and we add the statement
<tt>auto_prepend_file =
-/home/www/servers/poe.shonline.de/php/prepend.php3</tt> to our
+/home/www/servers/phplib.netuse.de/php/prepend.php3</tt> to our
<tt/php3.ini/.
Not all classes are included/required by <tt/prepend.php3/, only
-core functionality files are: <tt/db_xxx.inc/, <tt/session.inc/,
+core functionality files are: <tt/db_xxx.inc/,
+<tt/ct_sql.inc/, <tt/session.inc/,
<tt/auth.inc/, <tt/perm.inc/, <tt/user.inc/, <tt/local.inc/ and
<tt/page.inc/. The library provides other, less essential
classes that can be included manually on a page-by-page basis.
Index: php-lib/doc/sgml/02-requirements.sgml
diff -u php-lib/doc/sgml/02-requirements.sgml:1.2 php-lib/doc/sgml/02-requirements.sgml:1.3
--- php-lib/doc/sgml/02-requirements.sgml:1.2 Sun Oct 24 12:21:23 1999
+++ php-lib/doc/sgml/02-requirements.sgml Sun Oct 24 14:15:20 1999
@@ -1,4 +1,4 @@
-<!-- $Id: 02-requirements.sgml,v 1.2 1999/10/24 10:21:23 kk Exp $ -->
+<!-- $Id: 02-requirements.sgml,v 1.3 1999/10/24 12:15:20 kk Exp $ -->
<sect1>Requirements and things to check for
@@ -6,15 +6,18 @@
<p>
The PHP base library requires a working web server with CGI
-capability and the CGI version of PHP 3.0.12 or higher installed.
-Alternatively mod_php can be used. Lower versions of PHP
-do not work at all: The session class uses the
+capability and the CGI version of PHP 3.0.12 or higher
+installed. Alternatively mod_php can be used. Lower
+versions of PHP do not work at all: The session class uses the
<tt/base64_encode()/ and <tt/base64_decode()/
-functions which are known to be buggy in lower versions of the
-library. Also, the OOH Forms classes are using constructor
-syntax, which has been introduced into the PHP language in 3.0.12
-and later versions. An issue with the $PHP_SELF variable
-and CGI PHP has been resolved with version 3.0.12 and later.
+functions which are known to be buggy in lower versions (up to
+3.0.7) of the library. Also, the OOH Forms classes are using
+constructor syntax, which has been introduced into the PHP
+language in 3.0.5 and later versions. An issue with the
+$PHP_SELF variable and CGI PHP has been resolved with
+version 3.0.5 and later. Perl regular expression functions are
+being used in the <tt/Template/ class and these are not really
+avilable up to 3.0.12.
<em/Note:/ If you are using CGI PHP, it <em/must/ have been
compiled with the <tt/--enable-force-cgi-redirect/ switch for
@@ -37,14 +40,24 @@
<tt/magic_quotes_gpc/ to be enabled. The library
always uses <tt>addslashes()</tt> when necessary.
-<sect2>Database requirements
-<p>
-The PHP base library requires a database connection. Currently
-MySQL is fully supported and PostgreSQL, mSQL, ODBC and Oracle have
-limited support (the limitation is only relevant if you intend
-to access metadata information, i.e. table definitions and the
-like). Database interfaces are not difficult to write and
-Adabas-D and Sybase are likely to be supported in the future.
+<sect2>Database requirements
+
+<p>The PHP base library requires a database connection in the
+default setup for storage of session variables, but this can be
+circumvented by selection another storage container type at
+installation time. Currently, storage containers are available
+for SQL databases (the default), SQL databases with limited
+string length (ct_split_sql.inc), System V shared
+memory (requires a PHP interpreter with SYSVSHM and SYSVSEM
+support), LDAP servers (requires a PHP interpreter with LDAP
+support), flat files, and DBM files.
+
+Using SQL, currently MySQL is fully supported and PostgreSQL,
+mSQL, Sybase, Microsoft SQL Server, ODBC and Oracle have limited
+support (the limitation is only relevant if you intend to access
+metadata information, i.e. table definitions and the like).
+Database interfaces are not difficult to write and you can
+easily write your own interface.
You need a database server connection with <tt/select/,
<tt/insert/, <tt/update/ and <tt/delete/ privileges from your
@@ -69,20 +82,23 @@
core features. Is issues no HTML by default and it occupies only
few names in the global name space. These are the class names
for the classes defined: <tt/DB_Sql/, <tt/DB_SAM/,
-<tt/Session/, <tt/Auth/, <tt/Perm/, <tt/User/. Additionally, the
-classnames <tt/DB_Example/, <tt/Example_Session/,
-<tt/Example_Auth/, <tt/Example_Challenge_Auth/,
-<tt/Example_Perm/ and <tt/Example_User/ are defined by the
-sample setup in <tt/local.inc/, but these names can and shall be
-customized by the application developer. PHPLIB defines the
-function names <tt/page_open()/, <tt/page_close/,
-<tt/sess_load()/ and <tt/sess_save()/ for the page
-management functions. The global variable $_PHPLIB (a
-hash) is taken. Only if <tt/page_open()/ is being used,
-globals are defined by the library by default, but one global
-for each "feature" requested in the <tt/page_open()/
-statement is taken. These are at most <tt/$sess/, <tt/$user/,
-<tt/$auth/ and <tt/$perm/.
+<tt/CT_Sql/, <tt/Session/, <tt/Auth/, <tt/Perm/,
+<tt/User/. Additionally, the classnames <tt/DB_Example/,
+<tt/Example_CT_Sql/, <tt/Example_Session/,
+<tt/Example_Auth/,
+<tt/Example_Challenge_Auth/,
+<tt/Example_Perm/ and <tt/Example_User/ are
+defined by the sample setup in <tt/local.inc/, but these names
+can and shall be customized by the application developer. PHPLIB
+defines the function names <tt/page_open()/,
+<tt/page_close/, <tt/sess_load()/ and
+<tt/sess_save()/ for the page management functions. The
+global variable $_PHPLIB (a hash) is taken. Only if
+<tt/page_open()/ is being used, globals are defined by
+the library by default, but one global for each "feature"
+requested in the <tt/page_open()/ statement is taken.
+These are at most <tt/$sess/, <tt/$user/, <tt/$auth/ and
+<tt/$perm/.
Including extension functionality or HTML widgets may occupy
additional classnames, function names or variables in the global
Index: php-lib/doc/sgml/03-ct_dbm.sgml
diff -u php-lib/doc/sgml/03-ct_dbm.sgml:1.1 php-lib/doc/sgml/03-ct_dbm.sgml:1.2
--- php-lib/doc/sgml/03-ct_dbm.sgml:1.1 Fri Jul 16 23:45:30 1999
+++ php-lib/doc/sgml/03-ct_dbm.sgml Sun Oct 24 14:15:20 1999
@@ -1,10 +1,13 @@
-<!-- $Id: 03-ct_dbm.sgml,v 1.1 1999/07/16 21:45:30 kk Exp $ -->
+<!-- $Id: 03-ct_dbm.sgml,v 1.2 1999/10/24 12:15:20 kk Exp $ -->
<sect1>CT_Dbm
<p>
-To let Session use a DBM database file as a container, you use
-CT_Dbm.
+The <tt/Session/ class used to contain a bit of SQL to read and
+write session data from and to a database. To make sessions
+database independent, <tt/Session/ now makes all storage
+accesses through a container class. To let <tt/Session/ use a DBM
+database file as a container, you use <tt/CT_Dbm/.
<sect2>Instance variables
<p>
Index: php-lib/doc/sgml/03-ct_ldap.sgml
diff -u php-lib/doc/sgml/03-ct_ldap.sgml:1.1 php-lib/doc/sgml/03-ct_ldap.sgml:1.2
--- php-lib/doc/sgml/03-ct_ldap.sgml:1.1 Fri Jul 16 23:45:31 1999
+++ php-lib/doc/sgml/03-ct_ldap.sgml Sun Oct 24 14:15:20 1999
@@ -1,10 +1,13 @@
-<!-- $Id: 03-ct_ldap.sgml,v 1.1 1999/07/16 21:45:31 kk Exp $ -->
+<!-- $Id: 03-ct_ldap.sgml,v 1.2 1999/10/24 12:15:20 kk Exp $ -->
<sect1>CT_Ldap
<p>
-To let Session use a LDAP database as a container, you use
-CT_Ldap.
+The <tt/Session/ class used to contain a bit of SQL to read and
+write session data from and to a database. To make sessions
+database independent, <tt/Session/ now makes all storage
+accesses through a container class. To let <tt/Session/ use a
+LDAP database as a container, you use <tt/CT_Ldap/.
<sect2>Instance variables
<p>
Index: php-lib/doc/sgml/03-ct_shm.sgml
diff -u php-lib/doc/sgml/03-ct_shm.sgml:1.1 php-lib/doc/sgml/03-ct_shm.sgml:1.2
--- php-lib/doc/sgml/03-ct_shm.sgml:1.1 Fri Jul 16 23:45:31 1999
+++ php-lib/doc/sgml/03-ct_shm.sgml Sun Oct 24 14:15:20 1999
@@ -1,10 +1,13 @@
-<!-- $Id: 03-ct_shm.sgml,v 1.1 1999/07/16 21:45:31 kk Exp $ -->
+<!-- $Id: 03-ct_shm.sgml,v 1.2 1999/10/24 12:15:20 kk Exp $ -->
<sect1>CT_Shm
<p>
-To let Session use shared memory as container, you use
-CT_Shm.
+The <tt/Session/ class used to contain a bit of SQL to read and
+write session data from and to a database. To make sessions
+database independent, <tt/Session/ now makes all storage
+accesses through a container class. To let <tt/Session/ use shared
+memory as container, you use <tt/CT_Shm/.
<sect2>Instance variables
<p>
Index: php-lib/doc/sgml/03-ct_split_sql.sgml
diff -u php-lib/doc/sgml/03-ct_split_sql.sgml:1.1 php-lib/doc/sgml/03-ct_split_sql.sgml:1.2
--- php-lib/doc/sgml/03-ct_split_sql.sgml:1.1 Tue Jul 20 13:34:47 1999
+++ php-lib/doc/sgml/03-ct_split_sql.sgml Sun Oct 24 14:15:20 1999
@@ -1,11 +1,16 @@
-<!-- $Id: 03-ct_split_sql.sgml,v 1.1 1999/07/20 11:34:47 negro Exp $ -->
+<!-- $Id: 03-ct_split_sql.sgml,v 1.2 1999/10/24 12:15:20 kk Exp $ -->
<sect1>CT_Split_Sql
<p>
-This class is very similar to <tt/CT_Sql/ class, with the
-difference that if serialized data exceeds a specified amount of bytes,
-multiple rows will be used to memorized the entire field.
+The <tt/Session/ class used to contain a bit of SQL to read and
+write session data from and to a database. To make sessions
+database independent, <tt/Session/ now makes all storage
+accesses through a container class. The
+<tt/CT_split_sql/ container is very similar to
+<tt/CT_Sql/ container, with the difference that if
+serialized data exceeds a specified amount of bytes, multiple
+rows will be used to memorized the entire field.
This class is NOT compatible with <tt/CT_Sql/ class, since
table layout is different and column names are different in order to
Index: php-lib/doc/sgml/03-ct_sql.sgml
diff -u php-lib/doc/sgml/03-ct_sql.sgml:1.1 php-lib/doc/sgml/03-ct_sql.sgml:1.2
--- php-lib/doc/sgml/03-ct_sql.sgml:1.1 Fri Jul 16 23:45:32 1999
+++ php-lib/doc/sgml/03-ct_sql.sgml Sun Oct 24 14:15:20 1999
@@ -1,11 +1,14 @@
-<!-- $Id: 03-ct_sql.sgml,v 1.1 1999/07/16 21:45:32 kk Exp $ -->
+<!-- $Id: 03-ct_sql.sgml,v 1.2 1999/10/24 12:15:20 kk Exp $ -->
<sect1>CT_Sql
<p>
-To let Session use a SQL database as a container, you use
-CT_Sql. This uses a <tt/DB_Sql/ like class so you can
-access all supported databases with this container.
+The <tt/Session/ class used to contain a bit of SQL to read
+and write session data from and to a database. To make sessions
+database independent, this SQL has been isolated and put in
+a separate class, <tt/CT_Sql/. <tt/Session/ now makes
+all storage accesses through a container class, which may or
+may not be an SQL container.
<sect2>Instance variables
<p>
Index: php-lib/doc/sgml/03-db_sql.sgml
diff -u php-lib/doc/sgml/03-db_sql.sgml:1.3 php-lib/doc/sgml/03-db_sql.sgml:1.4
--- php-lib/doc/sgml/03-db_sql.sgml:1.3 Sun Oct 24 12:21:23 1999
+++ php-lib/doc/sgml/03-db_sql.sgml Sun Oct 24 14:15:20 1999
@@ -1,4 +1,4 @@
-<!-- $Id: 03-db_sql.sgml,v 1.3 1999/10/24 10:21:23 kk Exp $ -->
+<!-- $Id: 03-db_sql.sgml,v 1.4 1999/10/24 12:15:20 kk Exp $ -->
<sect1>DB_Sql
@@ -15,10 +15,34 @@
Database<colsep>Name of database or instance to use on that server.<rowsep>
User <colsep>The username used in connections attempts.<rowsep>
Password<colsep>The password used in connection attempts.<rowsep>
+
Row <colsep>Number of the current result row starting at 0.<rowsep>
Errno <colsep>Integer: error number of last database operation.<rowsep>
Error <colsep>String: error message of last database operation.<rowsep>
-Autofree<colsep>In some DB interfaces a flag for early result memory release.<rowsep>
+
+Halt_On_Error<colsep>One of "yes", "no", "report". If set to
+"yes" (the default), the database interface will report any errors and halt
+the program. If set to "report", the database interface will still report
+any errors, but continue reporting "false" back to the application, with
+Errno and Error set appropriately. If set to "no", the database interface
+will not report any errors, but silently report "false" back to application,
+with Errno and Error set appropriately.<rowsep>
+
+Auto_Free<colsep>Boolean: In some DB interfaces a flag for early
+result memory release.<rowsep>
+
+Debug <colsep>Boolean: If set, the database class will output all queries
+and additional diagnostic output.<rowsep>
+
+type <colsep>Contant string: The name of the database interface, e.g.
+"mysql" or "oracle"<rowsep>
+
+revision<colsep>Contant version string: The version of the database API
+(e.g. 1.2), NOT the CVS revision of the file implementing the API.
+
+Sql_Table<colsep>string: The name of the table used by the
+<tt/nextid()/ API function.<rowsep>
+
</tabular>
<caption>Accessible instance variables.</caption>
</table>
@@ -39,6 +63,15 @@
<p>
<descrip>
+<tag>DB_Sql($query = "")</tag>
+<p>
+Constructor. When creating an instance, you may optionally supply
+a query string.
+
+<tscreen><code>
+$db = new DB_Sql_Subclass("select * from mytable");)
+</code></tscreen>
+
<tag>query($query_string)</tag>
<p>
<tt/query_string/ is a SQL statement that is sent to the database.
@@ -52,7 +85,8 @@
<tt/User/ and <tt/Password/ instance variables.
Returns the result of the <tt/query()/ statement, which is
-guaranteed to be a valid result id.
+guaranteed to be a valid result id (or false, if
+Halt_On_Error isn't "yes").
<tag>next_record()</tag>
<p>
@@ -61,10 +95,54 @@
<tt/Errno/ and <tt/Error/ instance variables.
Returns true, if there is a new result record. Returns false, if
-done with the current result set. If <tt/Autofree/ is true,
+done with the current result set. If <tt/Auto_Free/ is true,
<tt/free_result()/ is called automatically before false
is returned.
+<tag>num_rows(), nf()</tag>
+<p>
+Returns the number of rows returned by the current SELECT query.
+
+<em/Note:/ This information is not available in all database
+interfaces. Some of the more advanced databases begin to return
+query results asynchronously while the backend is still
+appending result rows. In such environments the complete size of
+the result set is never known.
+
+You should duplicate your WHERE clause of the query in such
+environments and ask for the COUNT(*). This will be less
+inefficient as it seems as the query path and query result have
+been cached by the database.
+
+<tag>affected_rows()</tag>
+<p>
+Returns the number of rows affected by the current INSERT,
+UPDATE or DELETE query.
+
+<tag>num_fields()</tag>
+<p>
+Returns the number of columns returned by the current query.
+
+<tag>np()</tag>
+<p>
+Prints the number of rows returned by the current query.
+
+<tag>f($field)</tag>
+Identical to accessing <tt/Record[$field]/.
+
+<tag>p($field)</tag>
+<p>
+Identical to printing Record[$field].
+
+<tag>haltmsg($msg)</tag>
+<p>
+This function is called by <tt/halt()/ and will actually print
+the database error message. You may override this method in your
+subclass of <tt/DB_Sql/ and format the error message to
+be consistent with the layout of the rest of your application.
+You may also add additional error handling such as informing the
+application operator by mail that a database error has occured.
+
<tag>seek($pos)</tag>
<p>
Positions the <tt/Row/ pointer within the result set. Useful for
@@ -72,13 +150,31 @@
within the result. <tt/$pos/ is not checked in any way for
validity.
-<em/Note:/ If <tt/Autofree/ is true, <tt/seek()/ may not be
+<em/Note:/ If <tt/Auto_Free/ is true, <tt/seek()/ may not be
useable, because the result set has already been free'ed when
<tt/next_record()/ when behind the last record of the result
set.
+
+<em/Note:/ Not all database interfaces provide a cursor that is
+capable of seeking. This function will be unavailable in such
+environments.
-<tag>metadata($table)</tag>
+<tag>link_id()</tag>
<p>
+This function will return the current link ID, as returned by
+the <tt/pconnect()/ executed internally by the database class.
+
+You should not need this information.
+
+<tag>query_id()</tag>
+<p>
+This function will return the current result ID, as returned by
+the <tt/query()/ executed internally by the database class.
+
+You should not need this information.
+
+<tag>metadata($table = "", $full = false)</tag>
+<p>
<tt/$table/ is a SQL table name in the current database. The
function returns an array of hashes indexed on the (0 based)
column number of <tt/$table/. Each hash is indexed by <tt/table/
@@ -88,12 +184,19 @@
with one row per table column. Each row describes a column in
your table.
+The data returned by <tt/metadata()/ is suitable for passing
+it to the Table class. If you specify the <tt/full/ parameter,
+an additional column <tt/meta/ is added, which is indexed by
+field name and returns the field number of that name. Also, a
+column <tt/num_fields/ is added, containing the width
+of the table.
+
If <tt/$table/ is omitted, the function returns metadata on the result
-of the last executed query. NOTE: This is currently implemented only
+of the last executed query. <em/Note:/ This is currently implemented only
for the MySQL interface. You are encouraged to implement this feature
for other interfaces.
-NOTE: At the moment, the PostgreSQL and ODBC interface only report
+<em/NOTE:/ At the moment, the PostgreSQL and ODBC interface only report
the <tt/table/, <tt/name/ and <tt/type/ data reliably. You are
encouraged to fix this.
@@ -101,36 +204,21 @@
<p>
Returns an array with table name and tablespace name.
+<tscreen><code>
table name : $return[$i]["table_name"]
tablespace_name : $return[$i]["tablespace_name"]
+</code></tscreen>
Tables are from $i=0 to last table;
Implemented in db_oracle.inc,db_oci8.inc,db_mysql.inc,db_pgsql.inc
-
-<tag>num_rows(), nf()</tag>
-<p>
-Returns the number of rows returned by the current SELECT query.
-
-<tag>affected_rows()</tag>
-<p>
-Returns the number of rows affected by the current INSERT,
-UPDATE or DELETE query.
-
-<tag>num_fields()</tag>
-<p>
-Returns the number of columns returned by the current query.
-<tag>np()</tag>
-<p>
-Prints the number of rows returned by the current query.
-
-<tag>f($field)</tag>
-Identical to accessing <tt/Record[$field]/.
-
-<tag>p($field)</tag>
+<tag>nextid($sequence_name)</tag>
<p>
-Identical to printing Record[$field].
+This function will return a sequence number from the sequence
+named by <tt/$sequence_name/. This number is guaranteed
+to be obtained in an atomic manner and can be used as a primary
+key.
</descrip>
<sect3>Internal instance methods
@@ -146,8 +234,14 @@
<tag>halt($msg)</tag>
<p>
Used by <tt/query()/ if the initial database connection cannot
-be made or the target database does not exist. Prints an
-error message, then halts Script execution.
+be made or the target database does not exist. Depending on
+the setting of <tt/Halt_On_Error/, this method
+will call <tt/haltmsg()/ to report the error.
+
+<tag>free()</tag>
+<p>
+Used internally by <tt/next_record()/ to free the result
+set, if so configured.
</descrip>
<sect2>Example
@@ -165,13 +259,12 @@
var $User = "webuser";
var $Password = "";
- function halt($msg) {
+ function haltmsg($msg) {
printf("</td></table><b>Database error:</b> %s<br>\n", $msg);
printf("<b>MySQL Error</b>: %s (%s)<br>\n",
$this->Errno, $this->Error);
printf("Please contact shopmaster <email protected> and report the ");
printf("exact error message.<br>\n");
- die("Session halted.");
}
}
</code></tscreen>
@@ -225,3 +318,29 @@
database servers where connection setup time is negligible
(MySQL for example) this is a viable solution (don't try it with
Oracle) though.
+
+<sect2>Using <tt/nextid()/
+<p>
+
+The <tt/nextid()/ function can be used to obtain a sequence
+number which can be used as a primary key. The function manages
+an arbitrary number of named sequences, you have to provide the
+name of a sequence upon call.
+
+<tscreen><code>
+$db = new DB_Article;
+
+$artnr = $db->nextid("article_sequence");
+$query = sprintf("insert into articles ( artnr, ...) values ('%s', ...)",
+ $artnr, ...);
+$db->query($query);
+
+reset($articles);
+while(list($itemnr, $itemdesc) = each($articles)) {
+ $itemnr = $db->nextid("item_sequence");
+ $query = sprintf("insert into items (artnr, itemnr, ...) values ('%s', '%s', ...)",
+ $artnr, $itemnr, ...);
+ $db->query($query);
+}
+
+</code></tscreen>
Index: php-lib/doc/sgml/03-session.sgml
diff -u php-lib/doc/sgml/03-session.sgml:1.3 php-lib/doc/sgml/03-session.sgml:1.4
--- php-lib/doc/sgml/03-session.sgml:1.3 Fri Oct 22 11:47:48 1999
+++ php-lib/doc/sgml/03-session.sgml Sun Oct 24 14:15:20 1999
@@ -1,4 +1,4 @@
-<!-- $Id: 03-session.sgml,v 1.3 1999/10/22 09:47:48 kk Exp $ -->
+<!-- $Id: 03-session.sgml,v 1.4 1999/10/24 12:15:20 kk Exp $ -->
<sect1>Session
<p>
@@ -167,6 +167,46 @@
<tag>reimport_cookie_vars()</tag>
<p>
See <tt/reimport_get_vars()/.
+
+<tag>set_container()</tag>
+<p>
+You shall not call this function directly. It is called back by the
+<tt/start()/ function of <tt/Session()/ during initializiation.
+It is documented so that you can override its implementation in
+your subclass of <tt/Session/ if you know what you are doing.
+
+This function creates and starts the container class used by
+this instance of session.
+
+<tag>set_tokenname()</tag>
+<p>
+You shall not call this function directly. It is called back by the
+<tt/start()/ function of <tt/Session()/ during initializiation.
+It is documented so that you can override its implementation in
+your subclass of <tt/Session/ if you know what you are doing.
+
+This function determines and sets the internal session name.
+
+<tag>release_token()</tag>
+<p>
+You shall not call this function directly. It is called back by the
+<tt/start()/ function of <tt/Session()/ during initializiation.
+It is documented so that you can override its implementation in
+your subclass of <tt/Session/ if you know what you are doing.
+
+This function determines the current method of session
+propagation and determines if a new session token has to be
+generated.
+
+<tag>put_headers()</tag>
+<p>
+You shall not call this function directly. It is called back by the
+<tt/start()/ function of <tt/Session()/ during initializiation.
+It is documented so that you can override its implementation in
+your subclass of <tt/Session/ if you know what you are doing.
+
+This function determines which header lines are to be generated
+by the session, including cache control headers.
</descrip>
<sect3>Internal instance methods
Index: php-lib/doc/sgml/documentation.sgml
diff -u php-lib/doc/sgml/documentation.sgml:1.4 php-lib/doc/sgml/documentation.sgml:1.5
--- php-lib/doc/sgml/documentation.sgml:1.4 Fri Aug 27 17:27:12 1999
+++ php-lib/doc/sgml/documentation.sgml Sun Oct 24 14:15:20 1999
@@ -32,7 +32,6 @@
<!ENTITY f04cart SYSTEM "04-cart.sgml">
<!ENTITY f05widget SYSTEM "05-widget.sgml">
- <!ENTITY f05graph SYSTEM "05-graph.sgml">
<!ENTITY f05sqlquery SYSTEM "05-sql_query.sgml">
<!ENTITY f05table SYSTEM "05-table.sgml">
<!ENTITY f05form SYSTEM "05-form.sgml">
@@ -42,7 +41,7 @@
<!ENTITY f06ack SYSTEM "06-ack.sgml">
]>
-<!-- $Id: documentation.sgml,v 1.4 1999/08/27 15:27:12 ot Exp $ -->
+<!-- $Id: documentation.sgml,v 1.5 1999/10/24 12:15:20 kk Exp $ -->
<article>
<title>PHP Base Library Documentation, Release phplib_7
@@ -50,7 +49,7 @@
<author>Boris Erdmann, be <email protected>,
Kristian Köhntopp, kk <email protected>
and Sascha Schumann, sascha <email protected>
-<date>$Id: documentation.sgml,v 1.4 1999/08/27 15:27:12 ot Exp $
+<date>$Id: documentation.sgml,v 1.5 1999/10/24 12:15:20 kk Exp $
<toc>
@@ -86,7 +85,6 @@
&f04cart;
&f05widget;
-&f05graph;
&f05sqlquery;
&f05table;
&f05form;
Index: php-lib/php/auth.inc
diff -u php-lib/php/auth.inc:1.19 php-lib/php/auth.inc:1.20
--- php-lib/php/auth.inc:1.19 Wed Jul 14 13:55:55 1999
+++ php-lib/php/auth.inc Sun Oct 24 14:15:21 1999
@@ -4,8 +4,10 @@
*
* Copyright (c) 1998,1999 SH Online Dienst GmbH
* Boris Erdmann, Kristian Koehntopp
+ * Copyright (c) 1999 Internet Images srl
+ * Massimiliano Masserelli
*
- * $Id: auth.inc,v 1.19 1999/07/14 11:55:55 kk Exp $
+ * $Id: auth.inc,v 1.20 1999/10/24 12:15:21 kk Exp $
*
*/
@@ -14,8 +16,14 @@
var $persistent_slots = array("auth");
var $lifetime = 15; ## Max allowed idle time before
- ## reauthentication is necessary
+ ## reauthentication is necessary.
+ ## If set to 0, auth never expires.
+ var $refresh = 0; ## Refresh interval in minutes.
+ ## When expires auth data is refreshed
+ ## from db using auth_refreshlogin()
+ ## method. Set to 0 to disable refresh
+
var $mode = "log"; ## "log" for login only systems,
## "reg" for user self registration
@@ -28,143 +36,170 @@
var $auth = array(); ## Data array
var $in;
var $db;
- var $that;
##
## Initialization
##
function start() {
- global $sess, $username, $cancel_login;
+ global $sess, $cancel_login;
- if ( ! $this->in ) {
- $this->in = true;
+ ## This is for performance, I guess but I'm not sure if it could
+ ## be safely removed -- negro
+ if (! $this->in) {
$sess->register("auth");
+ $this->in = true;
+ }
+
+ ## back compatibility: if d_c is set, create db object
+ if(isset($this->database_class)) {
+ $class = $this->database_class;
+ $this->db = new $class;
+ }
- ## back compatibility: if d_c is set, create db object
- if(isset($this->database_class)) {
- $class = $this->database_class;
- $this->db = new $class;
- }
-
- if(isset($this->that_class)) {
- $class = $this->that_class;
- $this->that = new $class;
- $this->that->ac_start();
- }
-
- ## DEFAUTH handling: If there is no uid yet, fake one that won't expire.
- if ( $this->nobody && ( ! isset($this->auth["uid"]) ) ) {
- $this->auth["uname"] = $this->auth["uid"] = "nobody";
- $this->auth["exp"] = 0x7fffffff;
+ # Check current auth state. Should be one of
+ # 1) Not logged in (no valid auth info or auth expired)
+ # 2) Logged in (valid auth info)
+ # 3) Login in progress (if $cancel_login, revert to state 1)
+ if ($this->is_authenticated()) {
+ $uid = $this->auth["uid"];
+ switch ($uid) {
+ case "form":
+ # Login in progress
+ if ($cancel_login) {
+ # If $cancel_login is set, delete all auth info
+ # and set state to "Not logged in", so eventually
+ # default or automatic authentication may take place
+ $this->unauth();
+ $state = 1;
+ } else {
+ # Set state to "Login in progress"
+ $state = 3;
+ }
+ break;
+ default:
+ # User is authenticated and auth not expired
+ $state = 2;
+ break;
}
-
- $uid = isset($this->auth["uid"]) ? $this->auth["uid"] : false;
- $expired = isset($this->auth["exp"]) ? ( time() > $this->auth["exp"] ) : true;
-
} else {
-
- $expired = true;
- $uid = false;
-
+ # User is not (yet) authenticated
+ $this->unauth();
+ $state = 1;
}
- $loop = true;
-
- while ( $loop ) {
-#DEB printf("loop = %s expired = %s uid = %s frozen uid = %s<br>\n", $loop, $expired, $uid, $this->auth["uid"]);
- switch ($this->mode) {
-
- case "yes":
- case "log":
-#DEB printf("case log<br>\n");
- if ((($expired == true) && ($uid != "form")) || (!$uid)) {
-#DEB printf("subcase 1<br>\n");
-
- if ( $this->auth_preauth() ) {
- $uid = $this->auth["uid"];
- $expired = false;
- } else {
+ switch ($state) {
+ case 1:
+ # No valid auth info or auth is expired
+
+ # Check for user supplied automatic login procedure
+ if ( $uid = $this->auth_preauth() ) {
+ $this->auth["uid"] = $uid;
+ $this->auth["exp"] = time() + (60 * $this->lifetime);
+ $this->auth["refresh"] = time() + (60 * $this->refresh);
+ return true;
+ }
+
+ # Check for "log" vs. "reg" mode
+ switch ($this->mode) {
+ case "yes":
+ case "log":
+ if ($this->nobody) {
+ # Authenticate as nobody
+ $this->auth["uid"] = "nobody";
+ # $this->auth["uname"] = "nobody";
+ $this->auth["exp"] = 0x7fffffff;
+ $this->auth["refresh"] = 0x7fffffff;
+ return true;
+ } else {
+ # Show the login form
$this->auth_loginform();
- $this->auth["uid"]="form";
+ $this->auth["uid"] = "form";
+ $this->auth["exp"] = 0x7fffffff;
+ $this->auth["refresh"] = 0x7fffffff;
$sess->freeze();
exit;
}
-
- $this->auth_loginform();
- $this->auth["uid"]="form";
+ break;
+ case "reg":
+ # Show the registration form
+ $this->auth_registerform();
+ $this->auth["uid"] = "form";
+ $this->auth["exp"] = 0x7fffffff;
+ $this->auth["refresh"] = 0x7fffffff;
$sess->freeze();
exit;
-
- } elseif ( "form" == $uid && !isset($cancel_login)) {
-#DEB printf("subcase 2<br>\n");
-
- if ($this->nobody && !isset($username)) {
- $this->auth["uname"] = $this->auth["uid"] = "nobody";
- $loop = false;
- } else {
- $uid = $this->auth_validatelogin();
- $expired = false;
- }
- } else {
-#DEB printf("subcase 3<br>\n");
-
- $freeze = ($this->auth["uid"] != $uid);
-
- $this->auth["uid"] = $uid;
- ## DEFAUTH handling: do not update exp for nobody.
- if ($uid != "nobody")
- $this->auth["exp"] = time() + 60 * $this->lifetime;
- $loop=false;
-
- if ( $freeze ) {
-#DEB printf("freeze called<br>\n");
+ break;
+ default:
+ # This should never happen. Complain.
+ echo "Error in auth handling: no valid mode specified.\n";
+ $sess->freeze();
+ exit;
+ }
+ break;
+ case 2:
+ # Valid auth info
+ # Refresh expire info
+ ## DEFAUTH handling: do not update exp for nobody.
+ if ($uid != "nobody")
+ $this->auth["exp"] = time() + (60 * $this->lifetime);
+ break;
+ case 3:
+ # Login in progress, check results and act accordingly
+ switch ($this->mode) {
+ case "yes":
+ case "log":
+ if ( $uid = $this->auth_validatelogin() ) {
+ $this->auth["uid"] = $uid;
+ $this->auth["exp"] = time() + (60 * $this->lifetime);
+ $this->auth["refresh"] = time() + (60 * $this->refresh);
+ return true;
+ } else {
+ $this->auth_loginform();
+ $this->auth["uid"] = "form";
+ $this->auth["exp"] = 0x7fffffff;
+ $this->auth["refresh"] = 0x7fffffff;
$sess->freeze();
+ exit;
}
-
- }
-
- break;
- case "reg":
-#DEB printf("case reg<br>\n");
- switch ($uid) {
-
- case false:
-#DEB printf("subcase 1<br>\n");
-
+ break;
+ case "reg":
+ if ($uid = $this->auth_doregister()) {
+ $this->auth["uid"] = $uid;
+ $this->auth["exp"] = time() + (60 * $this->lifetime);
+ $this->auth["refresh"] = time() + (60 * $this->refresh);
+ return true;
+ } else {
$this->auth_registerform();
- $this->auth["uid"]="form";
+ $this->auth["uid"] = "form";
+ $this->auth["exp"] = 0x7fffffff;
+ $this->auth["refresh"] = 0x7fffffff;
$sess->freeze();
exit;
-
- break;
- case "form":
-#DEB printf("subcase 2<br>\n");
-
- $uid = md5(uniqid($this->magic));
- $uid = $this->auth_doregister($uid);
-
+ }
break;
- default:
-#DEB printf("case default<br>\n");
-
- $this->mode="log";
-
+ default:
+ # This should never happen. Complain.
+ echo "Error in auth handling: no valid mode specified.\n";
+ $sess->freeze();
+ exit;
break;
-
- }
-
- break;
- default:
- $loop = false;
+ }
break;
- }
+ default:
+ # This should never happen. Complain.
+ echo "Error in auth handling: invalid state reached.\n";
+ $sess->freeze();
+ exit;
+ break;
}
-
}
function login_if( $t ) {
- if ( $t && ( "nobody" == $this->auth["uid"] ) ) {
- $this->start();
+ if ( $t ) {
+ $this->unauth(); # We have to relogin, so clear current auth info
+ $this->nobody = false; # We are forcing login, so default auth is
+ # disabled
+ $this->start(); # Call authentication code
}
}
@@ -173,10 +208,10 @@
$this->auth["perm"] = "";
$this->auth["exp"] = 0;
- ## DEFAUTH handling: reauthenticate as nobody instead.
- if($nobody) {
- $this->auth["uname"] = $this->auth["uid"] = "nobody";
- $this->auth["exp"] = 0x7fffffff;
+ ## Back compatibility: passing $nobody to this method is
+ ## deprecated
+ if ($nobody) {
+ $this->nobody = $nobody;
}
}
@@ -185,18 +220,40 @@
global $sess;
$sess->unregister("auth");
- $this->auth["uname"] = "nobody";
+ unset($this->auth["uname"]);
$this->unauth($nobody == "" ? $this->nobody : $nobody);
}
function is_authenticated() {
- if ($this->auth["uid"] && (time() < $this->auth["exp"])) {
+ if (
+ $this->auth["uid"]
+ &&
+ (($this->lifetime <= 0) || (time() < $this->auth["exp"]))
+ ) {
+ # If more than $this->refresh minutes are passed since last check,
+ # perform auth data refreshing. Refresh is only done when current
+ # session is valid (registered, not expired).
+ if (
+ ($this->refresh > 0)
+ &&
+ ($this->auth["refresh"])
+ &&
+ ($this->auth["refresh"] < time())
+ ) {
+ if ( $this->auth_refreshlogin() ) {
+ $this->auth["refresh"] = time() + (60 * $this->refresh);
+ } else {
+ return false;
+ }
+ }
+
return $this->auth["uid"];
- } else
+ } else {
return false;
+ }
}
- ################################################################################
+ ########################################################################
##
## Helper functions
##
@@ -208,20 +265,22 @@
print $GLOBALS["sess"]->self_url();
}
- ##
- ## Authentication dummies. Must be overridden by user.
- ##
-
## This method can authenticate a user before the loginform
- ## is being displayed. If it does, it must set a uid just
- ## like auth_validatelogin, else it shall return false.
+ ## is being displayed. If it does, it must set a valid uid
+ ## (i.e. nobody IS NOT a valid uid) just like auth_validatelogin,
+ ## else it shall return false.
function auth_preauth() { return false; }
+ ##
+ ## Authentication dummies. Must be overridden by user.
+ ##
function auth_loginform() { ; }
function auth_validatelogin() { ; }
+
+ function auth_refreshlogin() { ; }
function auth_registerform() { ; }
Index: php-lib/php/db_mssql.inc
diff -u php-lib/php/db_mssql.inc:1.1 php-lib/php/db_mssql.inc:1.2
--- php-lib/php/db_mssql.inc:1.1 Fri Oct 22 12:40:09 1999
+++ php-lib/php/db_mssql.inc Sun Oct 24 14:15:21 1999
@@ -6,7 +6,7 @@
* Modified by Guarneri carmelo (carmelo <email protected>)
* Modified by Cameron Just (C.Just <email protected>)
*
- * $Id: db_mssql.inc,v 1.1 1999/10/22 10:40:09 kk Exp $
+ * $Id: db_mssql.inc,v 1.2 1999/10/24 12:15:21 kk Exp $
*/
# echo "<BR>This is using the MSSQL class<BR>";
@@ -24,7 +24,7 @@
var $Errno = 0;
var $Error = "";
- var $Auto_free = 0; ## set this to 1 to automatically free results
+ var $Auto_Free = 0; ## set this to 1 to automatically free results
function connect() {
@@ -69,7 +69,7 @@
$this->Row += 1;
$stat = 1;
} else {
- if ($this->Auto_free) {
+ if ($this->Auto_Free) {
$this->free_result();
}
$stat = 0;
Index: php-lib/php/db_mysql.inc
diff -u php-lib/php/db_mysql.inc:1.22 php-lib/php/db_mysql.inc:1.23
--- php-lib/php/db_mysql.inc:1.22 Mon Sep 27 02:58:41 1999
+++ php-lib/php/db_mysql.inc Sun Oct 24 14:15:21 1999
@@ -5,7 +5,7 @@
* Copyright (c) 1998,1999 SH Online Dienst GmbH
* Boris Erdmann, Kristian Koehntopp
*
- * $Id: db_mysql.inc,v 1.22 1999/09/27 00:58:41 sasha Exp $
+ * $Id: db_mysql.inc,v 1.23 1999/10/24 12:15:21 kk Exp $
*
*/
@@ -95,6 +95,10 @@
function query($Query_String) {
/* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
return 0;
if (!$this->connect()) {
Index: php-lib/php/session.inc
diff -u php-lib/php/session.inc:1.44 php-lib/php/session.inc:1.45
--- php-lib/php/session.inc:1.44 Fri Oct 22 12:40:09 1999
+++ php-lib/php/session.inc Sun Oct 24 14:15:21 1999
@@ -5,7 +5,7 @@
* Copyright (c) 1998,1999 SH Online Dienst GmbH
* Boris Erdmann, Kristian Koehntopp
*
- * $Id: session.inc,v 1.44 1999/10/22 10:40:09 kk Exp $
+ * $Id: session.inc,v 1.45 1999/10/24 12:15:21 kk Exp $
*
*/
@@ -36,7 +36,7 @@
## never cache the page.
var $allowcache_expire = 1440; ## If you allowcache, data expires in this
## many minutes.
- var $that_class = "Session_sql"; ## Name of data storage container
+ var $that_class = ""; ## Name of data storage container
##
## End of parameters.
-
PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in
the body, not the subject, of your message.
- Next message: kk: "[PHPLIB-DEV] cvs commit"
- Previous message: kk: "[PHPLIB-DEV] cvs commit"
- Next in thread: kk: "[PHPLIB-DEV] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

