Class: User_User
Source Location: /user_classes/user.class.php
Class Details
[line 50]
Class Variables
Class Methods
constructor __construct [line 71]
Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.
Tags:
method addUser [line 97]
int addUser(
array
$sqlData)
|
|
Adds user to the user table. Takes a field=>value array with user data as first argument. Returns insert id.
Tags:
Parameters:
method deleteUser [line 159]
Removes user from the user table. Takes the user id as first argument. Returns amount of affected rows
Tags:
Parameters:
method detachUserFromProject [line 724]
int detachUserFromProject(
int
$user)
|
|
Detaches user from current project. Takes user id as first argument. Returns amount of affected rows.
Tags:
Parameters:
method initUserAdmin [line 864]
Sets WCOM_CURRENT_USER constant using the user id saved in the open session. Returns user id.
Tags:
method initUserPublicArea [line 894]
int initUserPublicArea(
)
|
|
Initialises "user environment" for the public area. Sets the WCOM_CURRENT_USER and the WCOM_CURRENT_USER_ANONYMOUS constants using the saved user id in the open session or the anonymous user configured for the current project. Returns user id.
Tags:
method isDeletable [line 816]
bool isDeletable(
int
$user)
|
|
Finds out, whether a user is deletable or not. Takes the user id as first argument. Returns bool.
Tags:
Parameters:
method mapUserToGroup [line 505]
int mapUserToGroup(
int
$user, [int
$group = null])
|
|
Maps user to one group. Takes user id as first argument, group id as second argument. Returns the id of the new link. If the second parameter is omitted, the user will be detached from all groups and the function returns boolean true.
Tags:
Parameters:
method mapUserToProject [line 650]
int mapUserToProject(
int
$user, [int
$active = 1], [
$author = 0])
|
|
Maps user to the current project. Takes user id as first argument, activity and author switch as second and third argument. Returns link id. To detach a user from a project, see User_User::detachUserFromProject().
Tags:
Parameters:
method mapUserToTargetGroup [line 580]
int mapUserToTargetGroup(
int
$user, int
$project, [int
$group = null])
|
|
Maps user to one group. Takes user id as first argument, group id as second argument. Returns the id of the new link. If the second parameter is omitted, the user will be detached from all groups and the function returns boolean true.
Tags:
Parameters:
method mapUserToTargetProject [line 688]
int mapUserToTargetProject(
int
$user, int
$project, [
$active = 1], [
$author = 0])
|
|
Maps user to the target project. Takes user id as first argument, activity and author switch as second and third argument. Returns link id. To detach a user from a project, see User_User::detachUserFromProject().
Tags:
Parameters:
method selectAnonymousUser [line 448]
array selectAnonymousUser(
)
|
|
Returns anonymous user of the current project. Throws exception if no anonymous user can be found.
Tags:
method selectUser [line 191]
array selectUser(
int
$id)
|
|
Selects one user. Takes the user id as first argument. Returns array with user information.
Tags:
Parameters:
method selectUsers [line 297]
array selectUsers(
[array
$params = array()])
|
|
Method to select one or more users. Takes key=>value array with select params as first argument. Returns array. List of supported params: - group, int, optional: User group id
- exclude, int, optional: Bit to exclude skeleton user set and the current user
- email, string, optional: E-mail address
- author, int, optional: Author bit (either 0 or 1)
- start, int, optional: row offset
- limit, int, optional: amount of rows to return
- order_marco, string, otpional: How to sort the result set.
Supported macros:
- DATE_ADDED: sort by date added
- NAME: sort by name
Tags:
Parameters:
method testForUniqueEmail [line 761]
bool testForUniqueEmail(
string
$email, [int
$id = null])
|
|
Tests given email address for uniqueness. Takes the email address as first argument and an optional user id as second argument. If the user id is given, this user won't be considered when checking for uniqueness (useful for updates). Returns boolean true if the email address is unique.
Tags:
Parameters:
method updateUser [line 123]
int updateUser(
int
$id, array
$sqlData)
|
|
Updates user. Takes the user id as first argument, a field=>value array with the new user data as second argument. Returns amount of affected rows.
Tags:
Parameters:
method userBelongsToCurrentProject [line 1180]
bool userBelongsToCurrentProject(
int
$user)
|
|
Tests whether user belongs to current project. Takes user id as first argument. Returns bool.
Tags:
Parameters:
method userBelongsToCurrentUser [line 1232]
bool userBelongsToCurrentUser(
int
$user)
|
|
Tests whether user belongs to current user or not. Takes the user id as first argument. Returns bool.
Tags:
Parameters:
method userCheckAccess [line 1118]
bool userCheckAccess(
[string
$area = null], [string
$component = null], [string
$action = null])
|
|
Test if user has access to given area/component/action. Takes the area name as first argument, the component name as second argument and the action name as third argument. Returns bool.
Tags:
Parameters:
method userExists [line 945]
bool userExists(
int
$user, [int
$project = null])
|
|
Finds out whether user exists or nut. Takes the user id as first argument, the project id as second argument. Returns bool.
Tags:
Parameters:
method userIsActive [line 1060]
bool userIsActive(
int
$user, int
$project)
|
|
Test if user is an active user of the given project. Takes the user id as first argument, the project id as second argument. Returns bool.
Tags:
Parameters:
method userIsAuthor [line 1003]
bool userIsAuthor(
int
$user, int
$project)
|
|
Tests if given user is an author of the given project. Takes the user id as first argument, the project id as second argument. Returns bool.
Tags:
Parameters:
|
|