labdb Resources |
Saturday, April 26, 2025. Local time: 4:43:26 AM. |
|
'labdb' Software
|
|
User |
|
Visitors and guests
Visitors/guests have the lowest level of access in labdb. In some cases they may be able to perform basic searches to one or more modules. Although the output will contain minimum details, it may be useful for some resources.
Registered users
This category contains three types of users.
A Standard User has enhanced access to all modules and records in terms of browse and search features.
A Manager has all the rights of a Standard User and, in addition, can access many system-wide and module settings as well as perform back up of module database tables.
Finally, an Administrator has all the rights of a manager as well as greater access to settings. The Administrator can also create/ban/delete user accounts.
Module curators
A registered user (both Standard as well as Manager) can be assigned the role of a module curator. Such a user can manage module contents. Curator has the ability to add, delete and modify module records. Multiple browse options are provided to facilitate module data management.
|
|
Manager and Administrator |
|
Managers Information to access and manage resources (to be added)
Administrators Information about resources to administer the system (to be added)
|
|
Developer |
|
Software overview
The following diagram outlines the flow of information in labdb.The default/main landing pages are INDEX (standard user interface) and ADMIN.The admin interface allows backend entry to the site. A sitelock feature can be used to restrict access to the default landing page.

Software access control
PHP-based session method has been implemented to authenticate users and limit content delivery.
The function page_protect when placed in the beginning of a page will regenerate a valid session and allow contents to be restricted to registered users. Visitors/guests will get a warning or error message.
For this to work effectively page_protect must be combined with $_SESSION superglobal variable, preferably using session generated user_id value.
Users and access privileges
User levels are defined in GVAR2 script file. The following four levels are allowed -
Administrator
- full access to software, users, and modules
Manager
- full access to assigned module(s),
- most access to SETUP and database record backup
User
- enhanced browse and search access to resource modules
- can curate modules if enabled
Guest
- no access or bare minimum search access to module records
Module development
The software is designed to scan the web directory for folder names with prefix mod_. All such folders are recognized as modules. The SQL database table contains a list of all installed modules.
A new module folder (uploaded in the directory) can be installed by managers and administrators using the SETUP script. The module folder contains the following script files and subfolders.
- Required subfolders
- Required scripts
- browse: browse database records
- index: landing page
- info: brief description of the module
- input: form to input records
- manage: manage database records
- mod_setup: customize module operations
- mod_var: module-specific variables
- navtab: module-specific navigation links/buttons
- output: output records
- search: search database records
- sql table: database table structure
- Recommended scripts
- mod_function: module-specific functions
Module access control
The global variable access is used to set user access to modules. Its value ranges from 0 to 7. See below for details.
0 No access to module
1 Minimum search option
2 Enhanced search option, minimum browse option
3 Enhanced search and browse options
4 Above features plus ability to enter new records to a module
5 Above features plus the ability to update existing module records
6 Above features plus the ability to enter new and update existing module records
7 Full access to search, browse and alter module records
In addition to access, the following discrete variables allow fine grain control of module records. The variables are global in scope and are set as TRUE or FALSE.
s Minimum search option
sE Enhanced search option
b Minimum browsing option
bE Enhanced browsing option
mE Insert new records to a module
mU Update existing module records
mD Delete existing module records
The relationship between access and discrete variables is shown below.
access level 1 - s
2 - sE, b
3 - sE, bE
4 - sE, bE, mE
5 - sE, bE, mU
6 - sE, bE, mE, mU
7 - sE, bE, mE, mU, mD
Displaying module records
Records can be viewed in a box format using a function box_table. This function takes an array of 12 variables (all required) and displays records and their locations in a table format. Box size (row and height) can be specified. Default is 10x10 size box.
Navigation tools/buttons
Three different navigation function (tools) are available to enable browsing of module records. These provide FRONT/BACK links and a SELECT dropdown list.
- The box_navbar accepts an array of 7 (min) or 13 (max) variables and allows navigation of records using FRONT/BACK and dropdown links. This is used for the box table format.
- The second tool nav_tab_tool accepts an array of 10 variables. It allows browsing of records (using FRONT/BACK navigation links) in a table format.
- The last and final one, jump_to_page_tool, accepts the same array as nav_tab_tool but shows a dropdown list and allows the user to view any page/set of records in a table format. The table will need to be drawn separately.
Global and module-specific features and access controls
The SETUP script file allows control of certain features including access (user access). It can be accessed by Managers and Administrators. The script allows changes in core system (engine) and modules. The module-specific fine controls are now placed inside the MOD_SETUP script file, which is part of each module. It is a preferred route to keep features that are unique to each module.
The boxmap script in wormdb-specific module file MOD_FUNCTION can be used to get a bird's-eye view of current box table while entering a new record or modifying an existing record.
Global and module-specific messages
Messages are divided into two broad categories - system-wide (global) messages (placed inside the script GMSG) and module-specific messages (inside MOD_VAR script in each module folder).
Misc
The global function rel_date_format accepts date in a specific format, e.g., January 2, 2013, and outputs an array of three elements: package release year (e.g., 2013) and package release date in long (same as input) and short (e.g., Jan 2, 2013) formats.
The site_lock feature in SETUP script allows lock down of the entire site. The admin can still access the site via backend (ADMIN) and make some changes. However, this approach has many limitations and therefore not very useful. The only immediate application could be to block access to the site in the event of an issue. Significantly more work is needed to develop a full-fledged backend admin interface. This will be done in the future.
|
|
Global variables and functions |
|
Global variables are:
$date
Display date in Day, Month, Date, and Year. Example: Tuesday, January 1, 2019.
$date_minus_day
Display date in Month, Date, and Year. Example: January 1, 2019.
$date_formatted
Formatted display of date. Example: Today is Tuesday, January 1, 2019.
$time
Display time in Hour, Minutes, and Seconds along with AM/PM. Example: 12:01:01 PM.
$time_formatted
Formatted display of time. Example: Local time: 12:01:01 PM.
$date_time
??
Global functions are:
rel_date_format
|
Contents last updated on July 26, 2022. | |
|