Difference between revisions of "HyperAdmin"

From HypertWiki
Jump to navigation Jump to search
Line 4: Line 4:
This is my attempt to create a general user administration system for use by other web-based applications (mostly mine) which might need one.
This is my attempt to create a general user administration system for use by other web-based applications (mostly mine) which might need one.


==Login Sequence==
# Get user input (user, pass, possibly extra pass & email)
# If no user given:
## set $is_old_user flag
## check cookies for user/pass combination:
### If user/pass found in cookies, set $is_old_user flag
### If no user/pass found in cookies, set $do_login_screen flag
# ...else if user given:
## If password also given
### If 2 passwords match set $new_pass_valid flag
### If 2 passwords don't match, set $do_login_screen flag
# Open database and inspect "users" table.
# If no users yet:
## set $is_first_user flag
# ...else if users found:
(in progress)
## If $new_pass_valid:
### Create new account
==Tables==
==Tables==
*"K" indicates Primary Key fields
*"K" indicates Primary Key fields

Revision as of 12:03, 8 August 2005

Woozle: HyperAdmin

This is my attempt to create a general user administration system for use by other web-based applications (mostly mine) which might need one.

Login Sequence

  1. Get user input (user, pass, possibly extra pass & email)
  2. If no user given:
    1. set $is_old_user flag
    2. check cookies for user/pass combination:
      1. If user/pass found in cookies, set $is_old_user flag
      2. If no user/pass found in cookies, set $do_login_screen flag
  3. ...else if user given:
    1. If password also given
      1. If 2 passwords match set $new_pass_valid flag
      2. If 2 passwords don't match, set $do_login_screen flag
  4. Open database and inspect "users" table.
  5. If no users yet:
    1. set $is_first_user flag
  6. ...else if users found:

(in progress)

    1. If $new_pass_valid:
      1. Create new account

Tables

  • "K" indicates Primary Key fields
  • "#" indicates autonumbered fields

Main data tables

  • users -- users with access to the admin system
#K ID int(4)
Name varchar(32)
Pass text
Email varchar(128) email address for password confirmation and such
WhenGood timestamp when user last logged in
WhenBad timestamp when user last attempted to log in but failed (bad password)
QtyFails int(4) number of failed login attempts since last success
  • groups -- each group has a role to play, and each role requires a particular set of privileges
#K ID int(4)
Name varchar(32)
Descr text text describing the purpose of this group
  • privs -- particular privileges; meaning is defined in code
#K ID int(4)
Name varchar(32)
Descr text text describing this permission

Collection/link tables

  • users_x_groups -- users in each group / groups to which each user belongs
K ID_User int(4) users.ID
K ID_Group int(4) groups.ID
  • groups_x_privs -- privileges each group has / groups having a particular privilege
K ID_Group int(4) groups.ID
K ID_Priv int(4) privs.ID

Logging tables

  • log -- logs of login attempts as well as what users did while logged in
K# ID int(4)
ID_User int(4) users.ID - which user, if any (NULL = unknown user)
ID_Session int(4) sessions.ID - more information in case user is unknown
When timestamp when this action was taken
Seq int(4) Order in which actions were executed, if done at the same time
Descr text description of action taken (should be very specific)