This is a design document, it contains some data about the design of arsLab.

arsLab is a self-registration module. It started as a module allowing people to register themselves to a laboratory event (and stop bugging me).
Ofcourse you can use it for any type of scheduled event, not just labs - but so far I'll keep the lame original name...
So, for this point forward, where you see the word "lab" assume I mean "event".

There is a main table "labs" which keeps definitions for all events, like duration, how many times, how it repeats, who's responsible and so forth. You can see the definition for this table below.
For each event a new table is created, which keeps registration data for that event (simply, who's registered where.) That table is described at the bottom as the "Generic Table".

The PHP scripts in this directory (lab.php) allow people to pick a lab and register by a very intuitive interface: just point to an empty cell and register...
The admin/ directory contains all PHP scripts that deal with adding/editing/deleting and auditing events. This allows the admin control over labs. I suggest you limit access to that directory using your web-server's configuration.

See info about login functions below the tables

Description of "labs" table (This table contains definition data on all registration events)
Column Name SQL definition Description
id int unsigned not null auto_increment Lab's id number, unique identifier
name tinytext not null Lab's name: the name of the database where registration data for this lab is stored.
title tinytext not null Lab's title which will be displayed to the users.
cat int unsigned not null Reference to category table, which category lab belongs to.
starts datetime not null Date and time of when the first lab starts
repeat tinyint unsigned not null Number of times the lab will repeat.
inter tinyint unsigned Interval in days between labs (not to be mixed with "pause" which is interval between labs in the same day)
class tinyint unsigned not null Number of Classes - or session in every lab-day
session mediumint unsigned not null Duration in minutes of each class/session
pause mediumint unsigned not null Duration in minutes of break between classes/sessions
places mediumint unsigned not null Number of places in each lab (like the number of computers in the lab)
seats tinyint unsigned not null Number of persons to seat at each place
closed tinyint unsigned not null Flag (1=Yes,0=No) is the lab closed for registration
multi tinyint unsigned not null default 1 Number of times users are allowed to register in this event. Zero = unlimited.
arsdel tinyint unsigned not null Flag (1=Yes,0=No) - are users allowed to delete themselves from the event
mother tinytext not null Email address (or name) of lab's moderator. Will appear alongside erros in dialogs belonging to this lab
POP1 tinytext not null In authentication dialog: title for 1st field
POP2 tinytext not null In authentication dialog: title for 2nd field
POPtitle tinytext not null In authentication dialog: Dialog's Title
func tinytext not null Name of the PHP function that will be used for authentication for this event
header text HTML or Plaintext to display at top of this lab
footer text HTML or Plaintext to display at bottom of this lab


Description of "Generic Event" table
(This is the table which is created for each event, and stores registration info for it.)
Column Name SQL definition Description
place smallint unsigned not null (unique) Integer indicating place of registration in lab
id tinytext not null User's id number
name tinytext not null User's full name


Description of "category" table (This table contains definition data of all categories)
Column Name SQL definition Description
cid int unsigned not null auto_increment Category's id number, unique identifier
cname tinytext not null Category's Name.
info tinytext Generic text on the Category.
Login Functions
The design of arsLab allows the flexibility of assigning a different login function to each event/lab.
The feature is accessible to lab-admins through the admin interface (the listbox in the "Registration Dialog Options" section).
The list presented in that box is configurable through two files: auth.php and cfg.php
- In auth.php reside all the function implementations
- In cfg.php there is the $AAF array defining which functions to use, and what title/description to give them.
Configuration is simple: make sure the function is configured the way you want it inside auth.php, and then make sure its declared in cfg.php. That's it - from that point on lab-admin can assign this login function to an event/lab.

How to add more login functions:   You can add more functions by either making a copy of the existing ones, modifying them and declaring them in cfg.php, or you can write your own implementation. The only rules they have to follow are:
+ Input is the first and second field from the authentication dialog (two input vars)
+ Output is either an empty string indicating login failed, or a string containing the user's full name - indicating success. (The returned field is used on display in the event's table.)