DESCRIPTION: J-SESSIONS 1.0.0 pre-release: http://www.nirvani.net/software/ The goal of this session package is protected pages and a very small footprint. The bulk of the code is less than 176 lines. You can see it in action here: http://www.jeremybrand.com/admin (Not that you can use it) If anyone finds a bug I would like to know. I would rather not end up on 2600.com as a hacked site. THE LICENSE: Copyright (C) 2000 Jeremy Brand email: jeremy@nirvani.net web: http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This stuff is not organized yet. It is not an official release. I am just putting it up so that those of you who want to hack, can hack. WARNING: You'll probably have to read through common.inc. There isn't a config file yet. So, you'll have to take hard code in a few things. THE BASICS: - put login.html in /admin - put common.inc somewhere else and edit login.html and any page that includes it. - on each file that you want to protect, include common.inc and run parse_session_cookie(1). In a page that you want to protect with a session, do the following: include common.inc run parse_session_cookie(1) (the 1 means that authentication it is required) For now, you can change the session timeout in the check_session() function that is in common.inc. Defaut is 3600 seconds (1 hour). Find the setcookie call in common.inc. It has jeremybrand.com as the domain. Change that domain to your own domain. This is also in check_sessions(). You'll also need to configure your web server to parse .html files as php files. Otherwise, hack away and change the extention to .php or .php3, whatever works on your system. To change the look and feel of the login/password box, add html, flash, whatever into the dump_form() function in login.html. MYSQL SCHEMAS: (You will need these) # # Table structure for table 'accounts' # CREATE TABLE accounts ( userID char(15) DEFAULT '' NOT NULL, firstname char(20) DEFAULT '' NOT NULL, mi char(3) DEFAULT '' NOT NULL, lastname char(20) DEFAULT '' NOT NULL, password char(15) DEFAULT '' NOT NULL, PRIMARY KEY (userID) ); # # Table structure for table 'sessions' # CREATE TABLE sessions ( sessionID char(32) DEFAULT '' NOT NULL, userID char(15) DEFAULT '' NOT NULL, starttime timestamp(14), PRIMARY KEY (sessionID), UNIQUE userID (userID), KEY starttime (starttime) );