FIELDTYPE_TEXT
FIELDTYPE_TEXT
Constant to indentify a text property.
The FrontEndUsers module, besides being a module to provide authentication services to the frontend of a CMSMS website also has a complete and flexible API.
AddGroup(string $name, string $description) : array
Add a new group
| string | $name | The group name |
| string | $description | The group description |
Array containing two elements. The first element is the return status of the function (boolean), the second element is either a message in the case of an error, or the group id (integer) on success.
AddGroupPropertyRelation(int $grpid, string $propname, int $sortkey, boolean $lostun, int $required) : array
Add a new group property relation.
| int | $grpid | The group id |
| string | $propname | The property name |
| int | $sortkey | The sorting order for this relationship |
| boolean | $lostun | Wether this relationship should be used for the lostun stuff (deprecated) |
| int | $required | The required flag for this relationship. 0==off 1==optional, 2==required |
First element of the array is the return status, second element is the error message, if any.
AddPropertyDefn(string $name, string $prompt, int $type, int $length, int $maxlength, string $attribs, bool $force_unique, bool $encrypt)
Add a new property definition
| string | $name | The property name |
| string | $prompt | The property prompt for use in various views |
| int | $type | The field type |
| int | $length | The default length for rendering the property |
| int | $maxlength | The maximum length for rendering the property |
| string | $attribs | A serialized array of attributes for the property |
| bool | $force_unique | Whether or not the value for this property should be unique across all users. |
| bool | $encrypt | Whether or not this data should be encrypted in the database. |
AddUser(string $name, string $password, int $expires) : array
Add a user to the syetem
| string | $name | The new username |
| string | $password | The plain text password |
| int | $expires | the Unix timestamp of the expiry date |
The first element of the array is a boolean indicating success or failure, the second element is an error message, or the new UID.
DeleteUserFull(int $uid) : array
Completely delete a user from the database. Including all properties, group memberships, etc.
| int | $uid | The user identifier to delete. |
The first element of the array is a boolean status, the second element (if any) is an error message.
GenerateRandomUsername(string $prefix) : string
Generate a random username
| string | $prefix | an optional prefix for the username |
| todo |
|---|
GetUserProperties(int $uid) : array
Get all properties for the specified user.
| int | $uid | The user identifier |
The user properties as read from the database.
| todo |
|---|
GetMemberGroupsArray(int $userid) : null|array
Get a list of the specified users groups (if any)
| int | $userid | The user identifier |
If the user is a member of any groups the resulting array will contail the userid, and the groupid in each element of the returned array.
| todo |
|---|
GetUserProperty(string $title, mixed $defaultvalue) : string
Get a property value for the currently logged in user.
| string | $title | The property name |
| mixed | $defaultvalue | An optional default value if the property is not set for the user. Note, an empty string may be a valid property value. |
(All properties are stored as strings in the database)
| todo |
|---|
GetUserPropertyFull(string $title, int $userid, mixed $defaultvalue) : string
Get a property value for the specified user id
| string | $title | the property name |
| int | $userid | The user identifier |
| mixed | $defaultvalue | An optional default value if the property is not set for the user. Note, an empty string may be a valid property value. |
(All properties are stored as strings in the database)
| todo |
|---|
GetPropertyGroupRelations(string $title) : array
Get the group property relations for the specified property, for all groups.
| string | $title | the property title. |
| todo |
|---|
GetUserPropertyRelations(int $uid) : array
Get the property relations for the specified user
| int | $uid |
| todo |
|---|
GetGroupPropertyRelations(int $grpid) : array
Get the property relations for the specified group
| int | $grpid | The group identifier |
| todo |
|---|
GetGroupInfo(int $gid) : array
Get the group information for the specified group
| int | $gid | The group identifier |
| todo |
|---|
GetUserHistory(int $uid, string $action, int $count) : array
Get user history records, by descending date.
Warning: This could potentially return a very large array.
| int | $uid | |
| string | $action | An optional action filter (such as login or logout) |
| int | $count | An optional limit |
| todo |
|---|
GetLoggedInUsers(int $not_active_since) : int[]
Get a list of the currently logged in users.
| int | $not_active_since | An optional unix timestamp filter indicating last activity. |
Array of logged in uids.
| todo |
|---|
GetUserInfo(int $uid, bool $deep) : array
Get user information for the specified user.
| int | $uid | |
| bool | $deep | Optionally also retrieve property values. |
| todo |
|---|
GetUserInfoByName(string $username) : array
Get user information for the specified user, by his username.
| string | $username |
| todo |
|---|
GetFullUsersInGroup(int $gid) : array
Get info for the users by their group.
Warning: This could potentially return alot of data.
| int | $gid |
Array of userinfo data. One element per user.
| todo |
|---|
GroupExistsByID(int $gid) : bool
Test if the guid specified is a valid, existing group id.
| int | $gid |
| todo |
|---|
GroupExistsByName(string $name) : bool
Test if the group name specified is a valid, existing group.
| string | $name | The group name. |
| todo |
|---|
LoggedInEmail() : string
The email of the currently logged in user for this request.
| todo |
|---|
GetEmail(int $uid) : string
Get the email address of the specified user.
| int | $uid |
| todo |
|---|
GetPropertyDefn(string $name) : array
Get a property definition record by its name
| string | $name | the property name. |
| todo |
|---|
GetSelectOptions(string $name, int $dim)
Return select options for a property as a simple, or a 2 dimensional array
| string | $name | The property name |
| int | $dim | If 1, return a simple associative array. If 2, return a multi-dimensional array with properties option_name, option_text and control_name |
| todo |
|---|
GetUserName(int $userid) : string
Get the username for a specified uid
| int | $userid |
| todo |
|---|
GetUserID(string $username) : \it
Get the userid for a specified username
| string | $username |
| todo |
|---|
GetGroupName(int $groupid) : string
Get the group name for a specified group id
| int | $groupid |
| todo |
|---|
GetGroupDesc(int $groupid) : string
Get the descriptionf or a specified group id
| int | $groupid |
| todo |
|---|
GetGroupList() : array
Get a list of the groups, for use in a dropdown.
| todo |
|---|
GetGroupListFull(bool $with_count) : array
Get a full group list, with all information about that group.
| bool | $with_count | optionally include membership info. |
| todo |
|---|
GetGroupID(string $groupname) : int
Given a group name, get a group id.
| string | $groupname |
| todo |
|---|
GetMemberGroups(int $userid) : string[]
Get the list of groups (by name) that a user is a member of.
| int | $userid |
| todo |
|---|
GetExpiryDate(mixed $uid) : int
Get the date that a user account expires.
| mixed | $uid |
A unix timestamp of the expiry date.
| todo |
|---|
IsAccountExpired(int $uid) : bool
Test if the specified account is expired.
| int | $uid |
| todo |
|---|
IsValidPassword(string $password) : bool
Test if the specified plain text password is suitable (matches module settings)
| string | $password |
| todo |
|---|
GetUsernamePrompt() : string
Get the prompt for a username.
This may change based on module settings.
| todo |
|---|
IsValidEmailAddress(string $email, int $uid, $check_existing) : boolean
Test if the email specified is valid, and optionally not used.
| string | The email address to test |
|
| int | $uid | If speciied, this value will be used to ensure that the email addresss is stored in the database and not associated with any other users. |
| $check_existing |
indicating wether this email address can be used within the system.
| todo |
|---|
IsValidUsername(string $username, boolean $check, int $uid) : boolean
Test wether the specified username is valid for the system.
| string | $username | |
| boolean | $check | Optionally test whether this username is in current use. |
| int | $uid | If $check is true, indicate an optional uid to exclude from the check |
| todo |
|---|
CheckPassword(string $username, string $password, string $groups) : boolean
Validate the user password.
This is is not a login operation, but does perform the validation of the password.
| string | $username | The user name |
| string | $password | The plain text password. |
| string | $groups | An optional comma separated list of group names. If specified, the user must also belong to one of these groups. |
| todo |
|---|
Login(string $username, string $password, string $groups, boolean $ignored, $force_logout) : array
Log the user into the system.
| string | $username | |
| string | $password | The plain text password |
| string | $groups | An optional comma separated list of group names. If specified, the user must also belong to one of these groups. |
| boolean | $ignored | No longer used |
| $force_logout |
The first element of the array is either the uid or FALSE. If false, the second element is an error string.
| todo |
|---|
LoggedInName() : string
The username of the currently logged in user for this request.
| todo |
|---|
Logout(int $uid, string $message)
Logout the specified user, or the current user.
| int | $uid | An optional uid. If not specified, the current logged in uid for this request will be used. |
| string | $message | An optional string to include in thie history log. |
| todo |
|---|
LogoutUser(int $uid, $eventmsg)
Logout the specified user.
| int | $uid | An optional uid. If not specified, the current logged in uid for this request will be used. |
| $eventmsg |
| todo |
|---|
LoggedInId() : int
Return the uid of the current logged in user for this request.
| todo |
|---|
LoggedIn() : boolean
Test whether the current site visitor is logged in to FrontEndUsers
| todo |
|---|
MemberOfGroup(int $userid, int $groupid) : boolean
Test whether the specified user is a member of the specified group.
| int | $userid | |
| int | $groupid |
| todo |
|---|
RemoveUserFromGroup(int $uid, int $gid) : array
Remove the specified user from the specified group.
| int | $uid | |
| int | $gid |
The first element of the array is a boolean status. If false, the second element is an error string.
| todo |
|---|
SetPropertyDefnExtra(string $name, string $extra)
Set the extra information for a proerty.
| string | $name | The property name |
| string | $extra | The extra value. |
| todo |
|---|
SetGroup(int $gid, string $name, string $desc) : array
Update a group definition.
| int | $gid | |
| string | $name | The group name |
| string | $desc | An optional group description |
The first element of the array is a boolean status. If false, the second element is an error string.
| todo |
|---|
EncryptPassword(int $uid, $plain_password) : string
Given a plain text password, encrypt it for a user
| int | $uid | |
| $plain_password |
| todo |
|---|
SetUserPassword(int $uid, string $password) : array
Set the password for a user
| int | $uid | |
| string | $password |
The first element of the array is a boolean status. If false, the second element is an error string.
| todo |
|---|
SetUserDisabled(int $uid, boolean $flag)
Toggle a user account as disbled.
| int | $uid | |
| boolean | $flag | Whether or not the account is disabled. |
| todo |
|---|
ForcePasswordChange(int $uid, boolean $flag)
Toggle whether a user is forced to change his password at the next login.
| int | $uid | |
| boolean | $flag |
| todo |
|---|
ForceChangeSettings(int $uid, boolean $flag)
Toggle whether a user is forced to change his settings in some way at the next login.
| int | $uid | |
| boolean | $flag |
| todo |
|---|
SetUser(int $uid, string $username, string $password, int $expires)
Adjust user details
| int | $uid | |
| string | $username | The user name |
| string | $password | The users plain text password |
| int | $expires | An optional expiry date. |
| todo |
|---|
SetUserGroups(int $uid, int[] $grpids)
Set explicit group membership.
This method does not alter the user properties.
| int | $uid | |
| int[] | $grpids |
| todo |
|---|
AddUserToGroup( $uid, $gid) : boolean
Add user to a group
does not effect user properties does not validate gid userid is validated
| $uid | ||
| $gid |
| todo |
|---|
IsUserPropertyValueUnique( $uid, $title, $value)
| $uid | ||
| $title | ||
| $value |
| todo |
|---|
| todo |
|---|