cBrooks Core Authentication Utilities

Include Architecture, Dependancies & Other Notes

Dependancies:

Realistically, the only truly required file for this include is cb_User.class.php; however, the current version of this include also requires error_handler.inc.php and dbug.inc.php.

Please refer to the documentation for these dependencies, as they will have their own requirements as well.

Provided Functions

  • CB_user_logged_in () - Returns true / false depending on whether or not the current site user is logged in.
  • count_online_users () - Returns the number of users currently online, excluding any system users.
  • getUser ( str $username ) - take the provided username (regardless of case, as it is converted to lowercase before information retrieval,) and returns a CbrooksUserClass object.
  • getUserByID ( int $userid ) - Exactly the same as getUser, except you can provide an id instead of a username.
  • getUserList ( [bool $byid] ) - Returns an array of user id & username information. Default returns array populated with (username, id) pairs. $byid=true returns array with user ids as array keys with usernames as values.
  • getMemberList ( [bool $byid] ) - Operates like getUserList, except this is a tailored function for the Guild Bank Manager, in that, if a user is a SystemUser?, and they are not set to be displayed as a member, they will not be included in the results. Also, instead of usernames being the returned value of choice, member, or avatar names are returned if they exist; otherwise the username is used as a fallback.
    Note: I am not entirely sure this is the best location for this function, but it resides here for the time being.
  • save_user_changes () - This function is automatically set to be called if a certain information in a POST header is present. Specifically, if $_POST['submit_action'] == 'save changes'. It will process specific form data (that is user information) and store the changes in the database.
  • displayLogin () - I am currently unaware as to the state of this function, however, it is a means of displaying a basic login form on a page somewheres. I do expect that it will work properly, but make no promises at this point.

Other Notes

When this file is included, it will start the authentication process, by including all of the other dependencies it relies on, and those its dependencies rely on, and so forth. That said, if the configuration file is properly set up, and someone has submitted their particulars through the login form, this is where that information will be parsed and otherwise dealt with first.

You will also find that this is where the Session is set up, generally updated, etc. During this process, user timeouts are also determined.

Note: Currently, the support for running multiple versions of this software with a single authentication database for different subdomains has been disabled. However, this is also where you would find that set up.

Note for future: In the future, when account locking and regular email validation become functional, the validation / execution of these process should most likely be found here.