Jump to: navigation, search

Contents

Introduction

Authentication modules are pieces of code that allow Observium to use different sorts of user databases. They also take care of changing passwords (or disallowing it) and other related things. You can use any of the supplied ones to start from.

Please do send us a patch if you create something new! That way it will (hopefully) also be automatically updated if we add new interface functions.

Interface

Auth modules live in html/includes/authentication and should end in ".inc.php". They need to have the following functions:

Authentication

function authenticate($username,$password)

Check the combination of username and password.

function passwordscanchange($username = "")

Return 1 if the module can change user passwords, 0 if it cannot.

function changepassword($username,$password)

Change the user's password to a new value, if passwords can be changed.

User data

function user_exists($username)

Check if this username exists.

function get_userlevel($username)

Return the user level of the specified user.

function get_userid($username)

Return the user id of the specified user.

function get_userlist()

Returns a list of users in an array with the following keys: username, realname, user_id

User management

function auth_usermanagement()

Return 1 if the module can do user management, 0 if it cannot.

function adduser($username, $password, $level, $email = "", $realname = "", $can_modify_passwd = '1')

Add a user with the specified attributes, if user management is allowed.

function deluser($username)

Deletes the specified user, if user management is allowed.

Donate via Paypal

btn_donate_LG.gif