Ryzom Account Management System  1.0
Public Member Functions | Static Public Member Functions | Private Attributes
Ticket_User Class Reference

user entry point in the ticket system. More...

Public Member Functions

 __construct ()
 A constructor.
 set ($values)
 sets the object's attributes.
 load_With_TUserId ($id)
 loads the object's attributes.
 update ()
 update the object's attributes to the db.
 getPermission ()
 get permission attribute of the object.
 getExternId ()
 get externId attribute of the object.
 getTUserId ()
 get tUserId attribute of the object.
 setPermission ($perm)
 set permission attribute of the object.
 setExternId ($id)
 set externId attribute of the object.
 setTUserId ($id)
 set tUserId attribute of the object.

Static Public Member Functions

static createTicketUser ($extern_id, $permission)
 create a new ticket user.
static isMod ($user)
 check if a ticket_user object is a mod or not.
static isAdmin ($user)
 check if a ticket_user object is an admin or not.
static constr_TUserId ($id)
 return constructed ticket_user object based on TUserId.
static getModsAndAdmins ()
 return a list of all mods/admins.
static constr_ExternId ($id)
 return constructed ticket_user object based on ExternId.
static change_permission ($user_id, $perm)
 change the permission of a ticket_user.
static get_email_by_user_id ($id)
 return the email address of a ticket_user.
static get_username_from_id ($id)
 return the username of a ticket_user.
static get_id_from_username ($username)
 return the TUserId of a ticket_user by giving a username.
static get_id_from_email ($email)
 return the ticket_user id from an email address.

Private Attributes

 $tUserId
 The id of the user inside the ticket system.
 $permission
 The permission of the user.
 $externId
 The id of the user account in the www (could be drupal,...) that is linked to the ticket_user.

Detailed Description

user entry point in the ticket system.

The ticket_user makes a link between the entire ticket system's lib db and the www user, which is stored in another db (this is the external ID). The externalID could be the ID of a drupal user or wordpress user,.. The ticket_user also stores the permission of that user, this way the permission system is inside the lib itself and can be used in any www version that you like. permission 1 = user, 2 = mod, 3 = admin.

Author:
Daan Janssens, mentored by Matthew Lagoe

Constructor & Destructor Documentation

A constructor.

Empty constructor


Member Function Documentation

static change_permission ( user_id,
perm 
) [static]

change the permission of a ticket_user.

Parameters:
$user_idthe TUserId of the entry.
$permthe new permission value.
static constr_ExternId ( id) [static]

return constructed ticket_user object based on ExternId.

Parameters:
$idthe ExternId of the entry.
Returns:
constructed ticket_user object
static constr_TUserId ( id) [static]

return constructed ticket_user object based on TUserId.

Parameters:
$idthe TUserId of the entry.
Returns:
constructed ticket_user object
static createTicketUser ( extern_id,
permission 
) [static]

create a new ticket user.

Parameters:
$extern_idthe id of the user account in the www version (drupal,...)
$permissionthe permission that will be given to the user. 1=user, 2=mod, 3=admin
static get_email_by_user_id ( id) [static]

return the email address of a ticket_user.

Parameters:
$idthe TUserId of the entry.
Returns:
string containing the email address of that user.
static get_id_from_email ( email) [static]

return the ticket_user id from an email address.

Parameters:
$emailthe emailaddress of a user.
Returns:
the ticket_user id related to that email address, in case none, return "FALSE".
static get_id_from_username ( username) [static]

return the TUserId of a ticket_user by giving a username.

Parameters:
$usernamethe username of a user.
Returns:
the TUserId related to that username.
static get_username_from_id ( id) [static]

return the username of a ticket_user.

Parameters:
$idthe TUserId of the entry.
Returns:
string containing username of that user.

get externId attribute of the object.

static getModsAndAdmins ( ) [static]

return a list of all mods/admins.

Returns:
an array consisting of ticket_user objects that are mods & admins.

get permission attribute of the object.

get tUserId attribute of the object.

static isAdmin ( user) [static]

check if a ticket_user object is an admin or not.

Parameters:
$userthe ticket_user object itself
Returns:
true or false
static isMod ( user) [static]

check if a ticket_user object is a mod or not.

Parameters:
$userthe ticket_user object itself
Returns:
true or false
load_With_TUserId ( id)

loads the object's attributes.

loads the object's attributes by giving a TUserId.

Parameters:
$idthe id of the ticket_user that should be loaded
set ( values)

sets the object's attributes.

Parameters:
$valuesshould be an array of the form array('TUserId' => id, 'Permission' => perm, 'ExternId' => ext_id).
setExternId ( id)

set externId attribute of the object.

Parameters:
$idthe external id.
setPermission ( perm)

set permission attribute of the object.

Parameters:
$perminteger that indicates the permission level. (1= user, 2= mod, 3= admin)
setTUserId ( id)

set tUserId attribute of the object.

Parameters:
$idthe ticket_user id
update ( )

update the object's attributes to the db.


Field Documentation

$externId [private]

The id of the user account in the www (could be drupal,...) that is linked to the ticket_user.

$permission [private]

The permission of the user.

$tUserId [private]

The id of the user inside the ticket system.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables