? incompat Index: php/ct_split_sql.inc =================================================================== RCS file: /repository/php-lib/php/ct_split_sql.inc,v retrieving revision 1.4 diff -u -r1.4 ct_split_sql.inc --- php/ct_split_sql.inc 1999/11/05 11:18:18 1.4 +++ php/ct_split_sql.inc 1999/11/06 20:49:23 @@ -18,7 +18,7 @@ ## deriving your own class from it (recommened) ## - var $database_table = "active_sessions_split"; + var $database_table = "active_sessions"; var $database_class = ""; var $database_lock_semaphore = ""; var $split_length = 4096; ## Split data every xxx bytes @@ -57,7 +57,7 @@ $timeout = time(); $sqldate = date("YmdHis", $timeout - ($gc_time * 60)); $this->db->query(sprintf("DELETE FROM %s ". - "WHERE ct_changed < '%s' AND ct_name = '%s'", + "WHERE changed < '%s' AND name = '%s'", $this->database_table, $sqldate, addslashes($name))); @@ -67,8 +67,7 @@ $ret = true; $cmd = $this->enc_methods[$this->encoding_mode]["enc"]; - $str = sprintf("%s:%s", $this->encoding_mode, $cmd($str)); - + $str = $cmd($str); $now = date("YmdHis", time()); if ( $this->db->type == "oracle" ) @@ -82,12 +81,13 @@ $count = 0; while ($part = substr($str, 0, $this->split_length)) { $this->db->query(sprintf("INSERT INTO %s ". - " (ct_sid, ct_name, ct_pos, ct_val, ct_changed) ". + " (sid, name, valenc, valpos, val, changed) ". " VALUES ". - " ('%s','%s','%06d','%s','%s')", + " ('%s','%s','%s', '%06d','%s','%s')", $this->database_table, $id, addslashes($name), + $this->encoding_mode, $count++, $part, $now @@ -111,38 +111,28 @@ function ac_delete($id, $name) { $this->db->query(sprintf("DELETE FROM %s ". - "WHERE ct_name = '%s' AND ct_sid = '%s'", + "WHERE name = '%s' AND sid = '%s'", $this->database_table, addslashes($name), $id)); } function ac_get_value($id, $name) { - $this->db->query(sprintf("SELECT ct_val, ct_pos FROM %s ". - "WHERE ct_sid = '%s' AND ct_name = '%s' ". - "ORDER BY ct_pos", + $this->db->query(sprintf("SELECT valenc, val, valpos FROM %s ". + "WHERE sid = '%s' AND name = '%s' ". + "ORDER BY valpos", $this->database_table, $id, addslashes($name))); $str=""; while ($this->db->next_record()) { - $str .= $this->db->f("ct_val"); - } - - # get encoding method from (method:value) pair - $colon_pos = strpos($str,':'); - $str_method = substr ( $str , 0 , $colon_pos ); - if( empty($str_method) ) { - // For compatibility with old sessions - $str_method = "base64"; - $str_value = $str; - } else { - // New format case - $str_value = substr ( $str , $colon_pos + 1 ); + $str .= $this->db->f("val"); + $enc = $this->db->f("valenc"); } - $cmd = $this->enc_methods[$str_method]["dec"]; - $str = $cmd($str_value); + # get encoding method + $cmd = $enc?$this->enc_methods[$enc]["dec"]:"base64_decode"; + $str = $cmd($str); ## DEB echo $str; return $str; Index: php/ct_sql.inc =================================================================== RCS file: /repository/php-lib/php/ct_sql.inc,v retrieving revision 1.20 diff -u -r1.20 ct_sql.inc --- php/ct_sql.inc 1999/11/05 11:18:18 1.20 +++ php/ct_sql.inc 1999/11/06 20:49:24 @@ -64,23 +64,26 @@ function ac_store($id, $name, $str) { $ret = true; - #encode > string='method:result' + #encode $cmd = $this->enc_methods[$this->encoding_mode]["enc"]; - $str = sprintf("%s:%s", $this->encoding_mode, $cmd($str)); - + $str = $cmd($str); $name = addslashes($name); - $now = date("YmdHis", time()); - $uquery = sprintf("update %s set val='%s', changed='%s' where sid='%s' and name='%s'", + + $uquery = sprintf("update %s set valenc='%s', valpos='%s', val='%s', changed='%s' where sid='%s' and name='%s'", $this->database_table, + $this->encoding_mode, + '000000', $str, $now, $id, $name); - $iquery = sprintf("insert into %s ( sid, name, val, changed ) values ('%s', '%s', '%s', '%s')", + $iquery = sprintf("insert into %s ( sid, name, valenc, valpos, val, changed ) values ('%s', '%s', '%s', '%s', '%s', '%s')", $this->database_table, $id, $name, + $this->encoding_mode, + '000000', $str, $now); @@ -106,27 +109,15 @@ $str = ''; $this->db->query( sprintf( - "SELECT val FROM %s WHERE sid = '%s' AND name = '%s'", + "SELECT valenc, val FROM %s WHERE sid = '%s' AND name = '%s'", $this->database_table, $id, addslashes($name)) ); if ( $this->db->next_record() ) { - + $enc = $this->db->f('valenc'); $str = $this->db->f('val'); - - # get encoding method from (method:value) pair - $colon_pos = strpos($str,':'); - $str_method = substr ( $str , 0 , $colon_pos ); - if( empty($str_method) ) { - // For compatibility with old sessions - $str_method = "base64"; - $str_value = $str; - } else { - // New format case - $str_value = substr ( $str , $colon_pos + 1 ); - } - $cmd = $this->enc_methods[$str_method]["dec"]; - - $str = $cmd($str_value); + # get encoding method + $cmd = $this->enc_methods[$enc]["dec"]; + $str = $cmd($str); } return $str; Index: php/local.inc =================================================================== RCS file: /repository/php-lib/php/local.inc,v retrieving revision 1.31 diff -u -r1.31 local.inc --- php/local.inc 1999/10/29 13:55:13 1.31 +++ php/local.inc 1999/11/06 20:49:25 @@ -34,7 +34,7 @@ #class Example_CT_Split_Sql extends CT_Split_Sql { # var $database_class = "DB_Example"; ## Which database to connect... # var $database_table = "active_sessions_split"; ## and find our session data in this table. -# var $split_length = 4096 ## Split rows every 4096 bytes +# var $split_length = 4096; ## Split rows every 4096 bytes #} #class Example_CT_Shm extends CT_Shm { @@ -76,176 +76,27 @@ var $that_class = "Example_CT_Sql"; ## name of data storage container class } -## -## The following Auth subclasses present different flavors of the -## PHPLIB authentication schemes. In reality you would select one -## and drop all the others from this file. -## - -# An Auth class which authenticates against a database table. -# Has examples for log mode (login only) and reg mode (registration). - -class Example_Auth extends Auth { +class Example_Auth extends Auth_Sql { var $classname = "Example_Auth"; + var $lifetime = 15; + var $mode = "reg"; ## can do "log" as well. - var $lifetime = 15; - - var $mode = "log"; ## also try "reg" - var $database_class = "DB_Example"; var $database_table = "auth_user"; - - ## show login form - ## this is a CI-less generic login form. Feel free to - ## customize. - function auth_loginform() { - global $sess, $auth, $_PHPLIB, $PHP_SELF; - - include($_PHPLIB["libdir"] . "loginform.ihtml"); - } - - ## validate login information. - ## please remember to adapt the global statements here to match the - ## variables used in your loginform.ihtml. - ## this function has to return false, if the login fails, or - ## a valid user_id. - function auth_validatelogin() { - global $username, $password, $mode; - - if (isset($mode) && $mode == "reg") { - $this->mode = "reg"; - $this->auth["uname"] = $username; - $this->auth["error"] = "Please fill in the required registration information. Thank you."; - return false; - } - - if(isset($username)) { - $this->auth["uname"]=$username; ## This provides access for "loginform.ihtml" - } - - $uid = false; - - $this->db->query(sprintf("select user_id, perms ". - " from %s ". - " where username = '%s' ". - " and password = '%s'", - $this->database_table, - addslashes($username), - addslashes($password))); - - while($this->db->next_record()) { - $uid = $this->db->f("user_id"); - $this->auth["perm"] = $this->db->f("perms"); - } - if ($uid == false) - $this->auth["error"] = "Either your username or password are invalid.
Please try again."; - else - SetCookie("auth_username", $username, pow(2, 31)-1, "/"); - - return $uid; - } - function auth_preauth() { - global $HTTP_COOKIE_VARS; - - if ($HTTP_COOKIE_VARS["auth_username"]) { - $this->auth["uname"] = $HTTP_COOKIE_VARS["auth_username"]; - $this->mode = "log"; - } - return false; - } - - ## show registration form. - ## this is a very basic one, you certainly want to - ## add columns to that table and this form. - function auth_registerform() { - global $sess, $auth, $_PHPLIB, $PHP_SELF; - - include("registerform.ihtml"); - } - - function auth_doregister() { - ## Import form variables - global $username, $pass1, $pass2, $mode; - - ## Save the username for use in registerform.ihtml, - ## should registration fail. If you add more fields, - ## you will want to save them here, too. - $this->auth["uname"] = $username; - - if (isset($mode) && $mode == "log") { - $this->mode = "log"; - $this->auth["error"] = "Please enter your username and password. Thank you."; - return false; - } - - ## Check the passwords for validity. - if ($pass1 != $pass2) { - $this->auth["error"] = "Password and repeated password do not match. Please try again."; - return false; - } - - ## See if the user is already present - $query = sprintf("select user_id, username, password, perms from %s where username = '%s'", - $this->database_table, - $username); - $this->db->query($query); - while($this->db->next_record()) { - ## If user is present and password matches, silently log - ## the user in. - if ($this->db->f("password") == $pass1) { - $this->auth["perm"] = $this->db->f("perms"); - return $this->db->f("user_id"); - } - - ## If user is present and password does not match, - ## complain and fail. - $this->auth["error"] = "This username is already taken. Please choose a different one."; - return false; - } - - ## password is good and user is new, create a uid - ## and a user entry. The new user has no permissions (you - ## might want to add some?) - $uid = md5(uniqid($this->magic)); - $query = sprintf("insert into %s ( user_id, username, password ) values ('%s', '%s', '%s')", - $this->database_table, - $uid, - $username, - $pass1); - $this->db->query($query); - - ## Set a cookie to remember the username. - SetCookie("auth_username", $username, pow(2, 31)-1, "/"); - - ## log in that new user. The new user has no permissions. - ## If the user should have permissions, you put them - ## into $auth->auth["perm"]. - return $uid; - } + var $nobody = false; ## true for default authentication } -# This is Example_Auth with the $nobody flag set. Read up -# on Default Authentication in the Documentation. You do not -# need to derive this from Example_Auth, in fact it would be -# better to set $nobody directly in Example_Auth. - -class Example_Default_Auth extends Example_Auth { - var $classname = "Example_Default_Auth"; - - var $nobody = true; -} - # A variation of Example_Auth which uses a Challenge-Response # Authentication. The password never crosses the net in clear, # if the remote system supports JavaScript. Please read the # Documentation section about CR Authentication to understand # what is going on. -class Example_Challenge_Auth extends Auth { +class Example_Challenge_Auth extends Auth_Sql { var $classname = "Example_Challenge_Auth"; - var $lifetime = 1; + var $lifetime = 15; var $magic = "Simsalabim"; ## Challenge seed var $database_class = "DB_Example"; @@ -404,6 +255,8 @@ ## # class Example_Menu extends Menu { +# var $classname = "Example_Menu"; +# # # Map of PHP_SELF URL strings to menu positions # var $urlmap = array( # "/menu/index.php3" => "", Index: stuff/create_database.msaccess95 =================================================================== RCS file: /repository/php-lib/stuff/create_database.msaccess95,v retrieving revision 1.8 diff -u -r1.8 create_database.msaccess95 --- stuff/create_database.msaccess95 1999/08/26 10:51:08 1.8 +++ stuff/create_database.msaccess95 1999/11/06 20:49:26 @@ -25,18 +25,32 @@ Mandatory = YES OrdinalNumber = 2 End Column + Begin Column VALPOS + Name = valenc + DataType = Text(6) + Length = 6 + Mandatory = YES + OrdinalNumber = 3 + End Column + Begin Column VALENC + Name = valenc + DataType = Text(16) + Length = 16 + Mandatory = YES + OrdinalNumber = 4 + End Column Begin Column VAL Name = val DataType = Memo Length = 4096 - OrdinalNumber = 3 + OrdinalNumber = 5 End Column Begin Column CHANGED Name = changed DataType = Text(14) Length = 14 Mandatory = YES - OrdinalNumber = 5 + OrdinalNumber = 6 End Column End Table @@ -49,6 +63,7 @@ Field = SID Field = NAME + Field = VALPOS End Index ' ============================================================ @@ -61,68 +76,6 @@ End Index ' ============================================================ - ' Table : ACTIVE_SESSIONS_SPLIT - ' ============================================================ - Begin Table ACTIVE_SESSIONS_SPLIT - Name = active_sessions - Begin Column CT_SID - Name = ct_sid - DataType = Text(32) - Length = 32 - Mandatory = YES - OrdinalNumber = 1 - End Column - Begin Column CT_NAME - Name = ct_name - DataType = Text(32) - Length = 32 - Mandatory = YES - OrdinalNumber = 2 - End Column - Begin Column CT_POS - Name = ct_pos - DataType = Text(6) - Length = 6 - Mandatory = YES - OrdinalNumber = 3 - End Column - Begin Column CT_VAL - Name = ct_val - DataType = Memo - Length = 4096 - OrdinalNumber = 4 - End Column - Begin Column CT_CHANGED - Name = ct_changed - DataType = Text(14) - Length = 14 - Mandatory = YES - OrdinalNumber = 5 - End Column - End Table - - ' ============================================================ - ' Index : ACTIVE_SESSIONS_SPLIT_PK - ' ============================================================ - Begin Index ACTIVE_SESSIONS_SPLIT_PK - Table = ACTIVE_SESSIONS_SPLIT - Primary = primarykey - - Field = CT_SID - Field = CT_NAME - Field = CT_POS - End Index - - ' ============================================================ - ' Index : CHANGED - ' ============================================================ - Begin Index CHANGED - Table = ACTIVE_SESSIONS_SPLIT - - Field = CT_CHANGED - End Index - - ' ============================================================ ' Table : AUTH_USER ' ============================================================ Begin Table AUTH_USER @@ -141,52 +94,25 @@ Mandatory = YES OrdinalNumber = 2 End Column - Begin Column PASSWORD - Name = password - DataType = Text(32) - Length = 32 + Begin Column PWENC + Name = pwenc + DataType = Text(16) + Length = 16 Mandatory = YES OrdinalNumber = 3 End Column - Begin Column PERMS - Name = perms - DataType = Text(255) - Length = 255 - OrdinalNumber = 4 - End Column - End Table - - ' ============================================================ - ' Table : AUTH_USER_MD5 - ' ============================================================ - Begin Table AUTH_USER_MD5 - Name = auth_user_md5 - Begin Column USER_ID - Name = user_id - DataType = Text(32) - Length = 32 - Mandatory = YES - OrdinalNumber = 1 - End Column - Begin Column USERNAME - Name = username - DataType = Text(32) - Length = 32 - Mandatory = YES - OrdinalNumber = 2 - End Column Begin Column PASSWORD Name = password DataType = Text(32) Length = 32 Mandatory = YES - OrdinalNumber = 3 + OrdinalNumber = 4 End Column Begin Column PERMS Name = perms DataType = Text(255) Length = 255 - OrdinalNumber = 4 + OrdinalNumber = 5 End Column End Table Index: stuff/create_database.msql =================================================================== RCS file: /repository/php-lib/stuff/create_database.msql,v retrieving revision 1.6 diff -u -r1.6 create_database.msql --- stuff/create_database.msql 1999/08/26 10:51:08 1.6 +++ stuff/create_database.msql 1999/11/06 20:49:26 @@ -6,35 +6,21 @@ CREATE TABLE active_sessions ( sid char(32), name char(32), + valpos char(6), + valenc char(16), val text(300), changed char(14), ) \g -CREATE TABLE active_sessions_split ( - ct_sid char(32), - ct_name char(32), - ct_pos char(6), - ct_val text(300), - ct_changed char(14) -) \g - CREATE TABLE auth_user ( user_id char(32), - username char(32), - password char(32), - perms char(255) -) \g - -CREATE TABLE auth_user_md5 ( - user_id char(32), username char(32), + pwenc char(16), password char(32), perms char(255) ) \g -CREATE UNIQUE INDEX session_index ON active_sessions (sid,name) \g -CREATE UNIQUE INDEX split_session_index ON active_sessions_split (ct_sid,ct_name,ct_pos) \g +CREATE UNIQUE INDEX session_index ON active_sessions (sid,name,valpos) \g CREATE UNIQUE INDEX user_index ON auth_user (user_id) \g -INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','test','admin') \g -INSERT INTO auth_user_md5 VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','098f6bcd4621d373cade4e832627b4f6','admin') \g +INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','plain','test','admin') \g Index: stuff/create_database.mssql60 =================================================================== RCS file: /repository/php-lib/stuff/create_database.mssql60,v retrieving revision 1.8 diff -u -r1.8 create_database.mssql60 --- stuff/create_database.mssql60 1999/08/26 10:51:09 1.8 +++ stuff/create_database.mssql60 1999/11/06 20:49:26 @@ -19,9 +19,11 @@ ( SID varchar(32) not null, NAME varchar(32) not null, + VALPOS varchar(6) not null, + VALENC varchar(16) not null, VAL varchar(4096) null , CHANGED varchar(14) not null, - constraint PK_ACTIVE_SESSIONS primary key (SID, NAME) + constraint PK_ACTIVE_SESSIONS primary key (SID, NAME, VALPOS) ) go @@ -32,45 +34,16 @@ go /* ============================================================ */ -/* Table : ACTIVE_SESSIONS_SPLIT */ -/* ============================================================ */ -create table ACTIVE_SESSIONS_SPLIT -( - CT_SID varchar(32) not null, - CT_NAME varchar(32) not null, - CT_POS varchar(6) not null, - CT_VAL varchar(4096) null , - CT_CHANGED varchar(14) not null, - constraint PK_ACTIVE_SESSIONS primary key (CT_SID, CT_NAME, CT_POS) -) -go - -/* ============================================================ */ -/* Index : CHANGED */ -/* ============================================================ */ -create index SCHANGED on ACTIVE_SESSIONS_SPLIT (CT_CHANGED) -go - -/* ============================================================ */ /* Table : AUTH_USER */ /* ============================================================ */ create table AUTH_USER ( USER_ID varchar(32) not null, USERNAME varchar(32) not null, + PWENC varchar(16) not null, PASSWORD varchar(32) not null, PERMS varchar(255) null , constraint PK_AUTH_USER primary key (USER_ID) -) -go - -create table AUTH_USER_MD5 -( - USER_ID varchar(32) not null, - USERNAME varchar(32) not null, - PASSWORD varchar(32) not null, - PERMS varchar(255) null , - constraint PK_AUTH_USER_MD5 primary key (USER_ID) ) go Index: stuff/create_database.mysql =================================================================== RCS file: /repository/php-lib/stuff/create_database.mysql,v retrieving revision 1.14 diff -u -r1.14 create_database.mysql --- stuff/create_database.mysql 1999/08/26 10:51:09 1.14 +++ stuff/create_database.mysql 1999/11/06 20:49:27 @@ -17,40 +17,21 @@ CREATE TABLE active_sessions ( sid varchar(32) NOT NULL, name varchar(32) NOT NULL, + valpos varchar(6) NOT NULL, + valenc varchar(16) NOT NILL, val text, changed varchar(14) DEFAULT '' NOT NULL, - PRIMARY KEY (name, sid), + PRIMARY KEY (name, sid, valpos), KEY changed (changed) ); -CREATE TABLE active_sessions_split ( - ct_sid varchar(32) DEFAULT '' NOT NULL, - ct_name varchar(32) DEFAULT '' NOT NULL, - ct_pos varchar(6) DEFAULT '' NOT NULL, - ct_val text, - ct_changed varchar(14) DEFAULT '' NOT NULL, - PRIMARY KEY (ct_name,ct_sid,ct_pos), - KEY ct_changed (ct_changed) -); - # # Table structure for table 'auth_user' # CREATE TABLE auth_user ( user_id varchar(32) DEFAULT '' NOT NULL, - username varchar(32) DEFAULT '' NOT NULL, - password varchar(32) DEFAULT '' NOT NULL, - perms varchar(255), - PRIMARY KEY (user_id), - UNIQUE k_username (username) -); - -# -# Table structure for table 'auth_user_md5' -# -CREATE TABLE auth_user_md5 ( - user_id varchar(32) DEFAULT '' NOT NULL, username varchar(32) DEFAULT '' NOT NULL, + pwenc varchar(16) DEFAULT '' NOT NULL, password varchar(32) DEFAULT '' NOT NULL, perms varchar(255), PRIMARY KEY (user_id), @@ -61,8 +42,7 @@ # Dumping data for table 'auth_user' # -INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','test','admin'); -INSERT INTO auth_user_md5 VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','098f6bcd4621d373cade4e832627b4f6','admin'); +INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','plain','test','admin'); # # Table structure for table 'db_sequence' Index: stuff/create_database.odbc =================================================================== RCS file: /repository/php-lib/stuff/create_database.odbc,v retrieving revision 1.8 diff -u -r1.8 create_database.odbc --- stuff/create_database.odbc 1999/08/26 10:51:09 1.8 +++ stuff/create_database.odbc 1999/11/06 20:49:27 @@ -2,42 +2,22 @@ ( SID VARCHAR(32) not null, NAME VARCHAR(32) not null, + VALPOS VARCHAR(6) not null, + VALENC VARCHAR(16) not null, VAL LONG VARCHAR , CHANGED VARCHAR(14) not null, primary key (SID, NAME) ); -create unique index ACTIVE_SESSIONS_PK on ACTIVE_SESSIONS (SID asc, NAME asc); +create unique index ACTIVE_SESSIONS_PK on ACTIVE_SESSIONS (SID asc, NAME asc, VALPOS asc); create index CHANGED on ACTIVE_SESSIONS (CHANGED asc); -create table ACTIVE_SESSIONS_SPLIT -( - CT_SID VARCHAR(32) not null, - CT_NAME VARCHAR(32) not null, - CT_POS VARCHAR(6) not null, - CT_VAL LONG VARCHAR , - CT_CHANGED VARCHAR(14) not null, - primary key (CT_SID, CT_NAME, CT_POS) -); - -create unique index ACTIVE_SESSIONS_SPLIT_PK on ACTIVE_SESSIONS (CT_SID asc, CT_NAME asc, CT_POS asc); - -create index SCHANGED on ACTIVE_SESSIONS_SPLIT (CT_CHANGED asc); - create table AUTH_USER ( USER_ID VARCHAR(32) not null, - USERNAME VARCHAR(32) not null, - PASSWORD VARCHAR(32) not null, - PERMS VARCHAR(255) , - primary key (USER_ID) -); - -create table AUTH_USER_MD5 -( - USER_ID VARCHAR(32) not null, USERNAME VARCHAR(32) not null, + PWENC VARCHAR(16) not null, PASSWORD VARCHAR(32) not null, PERMS VARCHAR(255) , primary key (USER_ID) Index: stuff/create_database.oracle =================================================================== RCS file: /repository/php-lib/stuff/create_database.oracle,v retrieving revision 1.10 diff -u -r1.10 create_database.oracle --- stuff/create_database.oracle 1999/09/10 22:30:26 1.10 +++ stuff/create_database.oracle 1999/11/06 20:49:27 @@ -14,9 +14,11 @@ ( SID VARCHAR2(32) not null, NAME VARCHAR2(32) not null, + VALPOS VARCHAR2(6) not null, + VALENC VARCHAR(16) not null, VAL LONG null , CHANGED VARCHAR2(14) not null, - constraint PK_ACTIVE_SESSIONS primary key (SID, NAME) + constraint PK_ACTIVE_SESSIONS primary key (SID, NAME, VALPOS) ) / @@ -27,32 +29,13 @@ / -- ============================================================ --- Table : ACTIVE_SESSIONS_SPLIT --- ============================================================ -create table ACTIVE_SESSIONS_SPLIT -( - CT_SID VARCHAR2(32) not null, - CT_NAME VARCHAR2(32) not null, - CT_POS VARCHAR2(6) not null, - CT_VAL LONG null , - CT_CHANGED VARCHAR2(14) not null, - constraint PK_ACTIVE_SESSIONS_SPLIT primary key (CT_SID, CT_NAME, CT_POS) -) -/ - --- ============================================================ --- Index : CHANGED --- ============================================================ -create index SCHANGED on ACTIVE_SESSIONS_SPLIT (CT_CHANGED asc) -/ - --- ============================================================ -- Table : AUTH_USER -- ============================================================ create table AUTH_USER ( USER_ID VARCHAR2(32) not null, USERNAME VARCHAR2(32) not null, + PWENC VARCHAR(16) not null, PASSWORD VARCHAR2(32) not null, PERMS VARCHAR2(255) null , constraint PK_AUTH_USER primary key (USER_ID) @@ -60,24 +43,9 @@ / -- ============================================================ --- Table : AUTH_USER_MD5 --- ============================================================ -create table AUTH_USER_MD5 -( - USER_ID VARCHAR2(32) not null, - USERNAME VARCHAR2(32) not null, - PASSWORD VARCHAR2(32) not null, - PERMS VARCHAR2(255) null , - constraint PK_AUTH_USER_MD5 primary key (USER_ID) -) -/ - --- ============================================================ -- Index : K_USERNAME -- ============================================================ create unique index K_USERNAME on AUTH_USER (USERNAME asc) / - -INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','test','admin'); -INSERT INTO auth_user_md5 VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','098f6bcd4621d373cade4e832627b4f6','admin'); +INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','plain', 'test','admin'); Index: stuff/create_database.pgsql =================================================================== RCS file: /repository/php-lib/stuff/create_database.pgsql,v retrieving revision 1.8 diff -u -r1.8 create_database.pgsql --- stuff/create_database.pgsql 1999/08/26 10:51:09 1.8 +++ stuff/create_database.pgsql 1999/11/06 20:49:27 @@ -5,40 +5,24 @@ CREATE TABLE active_sessions ( sid varchar(32) DEFAULT '', name varchar(32) DEFAULT '', + valpos varchar(6) DEFAULT '', + valenc varchar(16) DEFAULT '', val text, changed varchar(14) DEFAULT '' NOT NULL, - PRIMARY KEY (sid,name) + PRIMARY KEY (sid,name,valpos) ); // CREATE INDEX k_changed ON active_sessions USING btree(changed); -CREATE TABLE active_sessions_split ( - ct_sid varchar(32) NOT NULL, - ct_name varchar(32) NOT NULL, - ct_pos varchar(6) NOT NULL, - ct_val text, - ct_changed varchar(14) DEFAULT '' NOT NULL, - PRIMARY KEY (ct_sid,ct_name,ct_pos) -); -CREATE INDEX k_asp_changed ON active_sessions_split USING btree(ct_changed); - CREATE TABLE auth_user ( user_id varchar(32) PRIMARY KEY, - username varchar(32) DEFAULT '' NOT NULL, - password varchar(32) DEFAULT '' NOT NULL, - perms varchar(255) -); - -CREATE TABLE auth_user_md5 ( - user_id varchar(32) PRIMARY KEY, username varchar(32) DEFAULT '' NOT NULL, + pwenc varchar(6) DEFAULT '' NOT NULL, password varchar(32) DEFAULT '' NOT NULL, perms varchar(255) ); CREATE UNIQUE INDEX k_username ON auth_user (username); -CREATE UNIQUE INDEX k_username_md5 ON auth_user_md5 (username); // This is an example of a sample row for auth_user -INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','test','admin'); -INSERT INTO auth_user_md5 VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','098f6bcd4621d373cade4e832627b4f6','admin'); +INSERT INTO auth_user VALUES ('c14cbf141ab1b7cd009356f555b607dc','kris','plain','test','admin'); Index: stuff/create_database.sybase =================================================================== RCS file: /repository/php-lib/stuff/create_database.sybase,v retrieving revision 1.10 diff -u -r1.10 create_database.sybase --- stuff/create_database.sybase 1999/08/26 10:51:09 1.10 +++ stuff/create_database.sybase 1999/11/06 20:49:28 @@ -19,9 +19,11 @@ ( SID varchar(32) not null, NAME varchar(32) not null, + VALPOS varchar(6) not null, + VALENC varchar(16) not null, VAL text null, CHANGED varchar(14) not null, - constraint PK_ACTIVE_SESSIONS primary key (SID, NAME) + constraint PK_ACTIVE_SESSIONS primary key (SID, NAME, VALPOS) ) go @@ -32,48 +34,16 @@ go /* ============================================================ */ -/* Table : ACTIVE_SESSIONS_SPLIT */ -/* ============================================================ */ -create table ACTIVE_SESSIONS_SPLIT -( - CT_SID varchar(32) not null, - CT_NAME varchar(32) not null, - CT_POS varchar(6) not null, - CT_VAL text null, - CT_CHANGED varchar(14) not null, - constraint PK_ACTIVE_SESSIONS primary key (CT_SID, CT_NAME, CT_POS) -) -go - -/* ============================================================ */ -/* Index : CHANGED */ -/* ============================================================ */ -create index SCHANGED on ACTIVE_SESSIONS_SPLIT (SCHANGED) -go - -/* ============================================================ */ /* Table : AUTH_USER */ /* ============================================================ */ create table AUTH_USER ( USER_ID varchar(32) not null, USERNAME varchar(32) not null, + PWENC varchar(16) not null, PASSWORD varchar(32) not null, PERMS varchar(255) null , constraint PK_AUTH_USER primary key (USER_ID) -) -go - -/* ============================================================ */ -/* Table : AUTH_USER_MD5 */ -/* ============================================================ */ -create table AUTH_USER_MD5 -( - USER_ID varchar(32) not null, - USERNAME varchar(32) not null, - PASSWORD varchar(32) not null, - PERMS varchar(255) null , - constraint PK_AUTH_USER_MD5 primary key (USER_ID) ) go