Standards  1.0
iUserSystem Interface Reference

The global UserSystem instance. More...

Public Member Functions

 isLoggedIn ()
 
 getLoggedIn ()
 
 checkPassword ($handle, $password)
 
 login ($handle, $password)
 
 logout ()
 
 registerUser ($username, $email, $password, $needsConfirm=true)
 
 createGroup ($groupName, $permissions)
 
 removeGroup ($groupName)
 
 setGroup ($groupName, $permissions)
 
 getGroup ($groupName)
 

Data Fields

const iType = "UserSystem"
 
const iShort = "us"
 
const iVersion = "1.0"
 
const iEntities
 
const iWidgets
 

Detailed Description

The global UserSystem instance.

Global constants:

  • STANDARD_USER_SYSTEM_EMAIL_TAKEN
  • STANDARD_USER_SYSTEM_USERNAME_TAKEN
  • STANDARD_USER_SYSTEM_PASSWORD_RESET
  • STANDARD_USER_SYSTEM_EMAIL_CHANGE

Base config:

  • "int maxUsernameLength"(Default: 24): Maximum number of characters a username can have.
  • "int minUsernameLength"(Default: 2): Minimum number of characters a username can have.
  • "int maxPasswordLength"(Default: 256): Maximum number of characters a password can have.
  • "int minPasswordLength"(Default: 8): Minimum number of characters a password can have.

Member Function Documentation

checkPassword (   $handle,
  $password 
)

This is a fast(compute) way to check if a password is correct.

Returns
False if password is wrong or raw user data if success.
createGroup (   $groupName,
  $permissions 
)

Creates a group with the groupName and the permissions

Returns
True on success or false on failure.
getGroup (   $groupName)

Gets the groupName permissions.

Returns
Array of permissions or false on failure.
getLoggedIn ( )
Returns
The current logged in user entity or false if not.
isLoggedIn ( )
Returns
true if a client is logged into a user, or false if not.
login (   $handle,
  $password 
)

This will check if the handle and password match if so it will log the user in

Returns
True if correct or false if not.
logout ( )

This will logout the currently logged in user.

registerUser (   $username,
  $email,
  $password,
  $needsConfirm = true 
)

Tries to register a new user with the given information.

Returns
True, false, or an error id deppending on if the user was created.

Error ids:

  • STANDARD_USER_SYSTEM_USERNAME_TAKEN: If the user name was taken.
  • STANDARD_USER_SYSTEM_EMAIL_TAKEN: If the email is already used.
removeGroup (   $groupName)

Removes users in the groupName group and then removes the group.

Returns
True on success or false on failure.
setGroup (   $groupName,
  $permissions 
)

Sets the permissions to the groupName.

Returns
True on success or false on failure.

Field Documentation

const iEntities
Initial value:
= [
"User"
]

Must have User constant and $User static member.

const iWidgets
Initial value:
= [
"Login",
"Logout",
"Register",
"Group",
"Perms",
"ChangePassword",
"ChangeEmail",
"ResetPassword"
]

Must have all constants and $[Widget name] variables.


The documentation for this interface was generated from the following file: