Location: PHPKode > projects > Ars Lab > arsLab-1.4.1/docs/design.html
<html>
<!-- this file belongs to arsLab - self registration program to labs using PHP/MySQL -->
<head>
  <title>Design</title>
  <style type="text/css">
	.des { font-family: tahoma, helvetica; color: #000080; font-size: 9pt; }
  </style>
</head>
<body bgcolor=white class=des>
  <b>This is a design document, it contains some data about the design of arsLab.</b><br><br>
  <p class=des>
  arsLab is a self-registration module. It started as a module allowing people to register themselves to a laboratory event (and stop bugging me).
  <br> Ofcourse you can use it for any type of scheduled event, not just labs - but so far I'll keep the lame original name...<br>
  So, for this point forward, where you see the word "lab" assume I mean "event".<br><br>
  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.<br>
  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 &quot;Generic Table&quot;.<br><br>
  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...<br>
  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.
  <br><br>
  <b>See info about login functions below the tables</b><br>
  </p>
  <table bgcolor=#C0C0C0 class=des cellspacing=1 cellpadding=3 border=1>
	<tr align=center>
		<td colspan=3><b>Description of &quot;labs&quot; table</b>
(This table contains definition data on all registration events)
		</td>
	</tr>
	<tr align=center>
		<td><b>Column Name</b></td>
		  <td><b>SQL definition</b></td>
		  <td><b>Description</b></td>
	</tr>
	<tr align=center>
	  <td>id</td>
	  <td>int unsigned not null auto_increment</td>
	  <td align=left>Lab's id number, unique identifier</td>
	</tr>
	<tr align=center>
	  <td>name</td>
	  <td>tinytext not null</td>
	  <td align=left>Lab's name: the name of the database where registration data for this lab is stored.</td>
	</tr>
	<tr align=center>
	  <td>title</td>
	  <td>tinytext not null</td>
	  <td align=left>Lab's title which will be displayed to the users.</td>
	</tr>
	<tr align=center>
	  <td>cat</td>
	  <td>int unsigned not null</td>
	  <td align=left>Reference to category table, which category lab belongs to.</td>
	</tr>
	<tr align=center>
	  <td>starts</td>
	  <td>datetime not null</td>
	  <td align=left>Date and time of when the first lab starts</td>
	</tr>
	<tr align=center>
	  <td>repeat</td>
	  <td>tinyint unsigned not null</td>
	  <td align=left>Number of times the lab will repeat.</td>
	</tr>
	<tr align=center>
	  <td>inter</td>
	  <td>tinyint unsigned</td>
	  <td align=left>Interval in days between labs (not to be mixed with "pause" which is interval between labs in the same day)</td>
	</tr>
	<tr align=center>
	  <td>class</td>
	  <td>tinyint unsigned not null</td>
	  <td align=left>Number of Classes - or session in every lab-day</td>
	</tr>
	<tr align=center>
	  <td>session</td>
	  <td>mediumint unsigned not null</td>
	  <td align=left>Duration in minutes of each class/session</td>
	</tr>
	<tr align=center>
	  <td>pause</td>
	  <td>mediumint unsigned not null</td>
	  <td align=left>Duration in minutes of break between classes/sessions</td>
	</tr>
	<tr align=center>
	  <td>places</td>
	  <td>mediumint unsigned not null</td>
	  <td align=left>Number of places in each lab (like the number of computers in the lab)</td>
	</tr>
	<tr align=center>
	  <td>seats</td>
	  <td>tinyint unsigned not null</td>
	  <td align=left>Number of persons to seat at each place</td>
	</tr>
	<tr align=center>
	  <td>closed</td>
	  <td>tinyint unsigned not null</td>
	  <td align=left>Flag (1=Yes,0=No) is the lab closed for registration</td>
	</tr>
	<tr align=center>
	  <td>multi</td>
	  <td>tinyint unsigned not null default 1</td>
	  <td align=left>Number of times users are allowed to register in this event. Zero = unlimited.</td>
	</tr>
	<tr align=center>
	  <td>arsdel</td>
	  <td>tinyint unsigned not null</td>
	  <td align=left>Flag (1=Yes,0=No) - are users allowed to delete themselves from the event</td>
	</tr>
	<tr align=center>
	  <td>mother</td>
	  <td>tinytext not null</td>
	  <td align=left>Email address (or name) of lab's moderator. Will appear alongside erros in dialogs belonging to this lab</td>
	</tr>
	<tr align=center>
	  <td>POP1</td>
	  <td>tinytext not null</td>
	  <td align=left>In authentication dialog: title for 1st field</td>
	</tr>
	<tr align=center>
	  <td>POP2</td>
	  <td>tinytext not null</td>
	  <td align=left>In authentication dialog: title for 2nd field</td>
	</tr>
	<tr align=center>
	  <td>POPtitle</td>
	  <td>tinytext not null</td>
	  <td align=left>In authentication dialog: Dialog's Title</td>
	</tr>
	<tr align=center>
	  <td>func</td>
	  <td>tinytext not null</td>
	  <td align=left>Name of the PHP function that will be used for authentication for this event</td>
	</tr>
	<tr align=center>
	  <td>header</td>
	  <td>text</td>
	  <td align=left>HTML or Plaintext to display at top of this lab</td>
	</tr>
	<tr align=center>
	  <td>footer</td>
	  <td>text</td>
	  <td align=left>HTML or Plaintext to display at bottom of this lab</td>
	</tr>

  </table>
  <br><br>
  <table bgcolor=#C0C0C0 class=des cellspacing=1 cellpadding=3 border=1>
	<tr align=center>
		<td colspan=3><b>Description of &quot;Generic Event&quot; table</b><br>
(This is the table which is created for each event, and stores registration info for it.)
		</td>
	</tr>
	<tr align=center>
		<td><b>Column Name</b></td>
		  <td><b>SQL definition</b></td>
		  <td><b>Description</b></td>
	</tr>
	<tr align=center>
	  <td>place</td>
	  <td>smallint unsigned not null (unique)</td>
	  <td align=left>Integer indicating place of registration in lab</td>
	</tr>
	<tr align=center>
	  <td>id</td>
	  <td>tinytext not null</td>
	  <td align=left>User's id number</td>
	</tr>
	<tr align=center>
	  <td>name</td>
	  <td>tinytext not null</td>
	  <td align=left>User's full name</td>
	</tr>
</table>
<br><br>
<table bgcolor=#C0C0C0 class=des cellspacing=1 cellpadding=3 border=1>
	<tr align=center>
		<td colspan=3><b>Description of &quot;category&quot; table</b>
(This table contains definition data of all categories)
		</td>
	</tr>
	<tr align=center>
		<td><b>Column Name</b></td>
		  <td><b>SQL definition</b></td>
		  <td><b>Description</b></td>
	</tr>
	<tr align=center>
	  <td>cid</td>
	  <td>int unsigned not null auto_increment</td>
	  <td align=left>Category's id number, unique identifier</td>
	</tr>
	<tr align=center>
	  <td>cname</td>
	  <td>tinytext not null</td>
	  <td align=left>Category's Name.</td>
	</tr>
	<tr align=center>
	  <td>info</td>
	  <td>tinytext</td>
	  <td align=left>Generic text on the Category.</td>
	</tr>
</table>

<dl class=des>
<dt><b><u>Login Functions</u></b>
<dd>
The design of arsLab allows the flexibility of assigning a different login function to each event/lab.<br>
The feature is accessible to lab-admins through the admin interface (the listbox in the "Registration Dialog Options" section).<br>
The list presented in that box is configurable through two files: auth.php and cfg.php<br>
- In auth.php reside all the function implementations<br>
- In cfg.php there is the $AAF array defining which functions to use, and what title/description to give them.<br>
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.<br><br>

<u>How to add more login functions:</u> &nbsp; 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:<br>
+ Input is the first and second field from the authentication dialog (two input vars)<br>
+ 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.)
</dl>

</body>
</html>
Return current item: Ars Lab