Authorization handler


Authorization handler allows you to integrate the chat with your web site users' database.


NAME - user name
PASSWORD - user password
UID - user id (used with non session/cookie based web site authorization)

Format of the returned data

If authorization is passed successfully:



Node name Description
userName Required. User login name.
gender User's gender. Can take 'male', 'female' or 'couple' value. Required when avatar mode is set to "gender"
level User's authorization level. Required when limitation plugin is installed.
photo Path to user's photo/image file. Recommended image size 100x100 px.
photoModeImage Path to user's photo-avatar. Required when avatar mode is set to "photo". Recommended image size 30x30 px.

If not authorized:

<auth error="AUTH_ERROR" />

Authorization handler serves both Auto Login and Chat Authorization requests. Example code below illustrates the handler logic:

if($_REQUEST['user_name']!="" && $_REQUEST['password']!="")
//Chat authorization - a user has specified login/password on the chat welcome screen
else if ($_SESSION['uid']!="")
// Autologin session/cookie based authorization
else if ($_GET['uid']!="")
// Non session/cookie based autologin authorization
return '<auth error="AUTH_ERROR" />';