File/includes/functions_user.php

Description
  • version: $Id: functions_user.php 8783 2008-08-23 17:23:40Z acydburn $
  • copyright: (c) 2005 phpBB Group
  • license: GNU Public License
Functions
avatar_delete (line 1839)

Remove avatar

void avatar_delete ( $mode,  $row, [ $clean_db = false])
  • $mode
  • $row
  • $clean_db
avatar_gallery (line 2018)

Avatar Gallery

void avatar_gallery ( $category,  $avatar_select,  $items_per_column, [ $block_var = 'avatar_row'])
  • $category
  • $avatar_select
  • $items_per_column
  • $block_var
avatar_get_dimensions (line 2123)

Tries to (re-)establish avatar dimensions

void avatar_get_dimensions ( $avatar,  $avatar_type,  &$error, [ $current_x = 0], [ $current_y = 0])
  • $avatar
  • $avatar_type
  • &$error
  • $current_x
  • $current_y
avatar_process_user (line 2176)

Uploading/Changing user avatar

void avatar_process_user ( &$error, [ $custom_userdata = false])
  • &$error
  • $custom_userdata
avatar_remote (line 1869)

Remote avatar linkage

void avatar_remote ( $data,  &$error)
  • $data
  • &$error
avatar_remove_db (line 2520)

Remove avatar also for users not having the group as default

void avatar_remove_db ( $avatar_name)
  • $avatar_name
avatar_upload (line 1947)

Avatar upload using the upload class

void avatar_upload ( $data,  &$error)
  • $data
  • &$error
get_avatar_filename (line 1996)

Generates avatar filename from the database entry

void get_avatar_filename ( $avatar_entry)
  • $avatar_entry
get_group_name (line 3199)

Get group name

void get_group_name ( $group_id)
  • $group_id
group_correct_avatar (line 2496)

Changes a group avatar's filename to conform to the naming scheme

void group_correct_avatar ( $group_id,  $old_entry)
  • $group_id
  • $old_entry
group_create (line 2337)

Add or edit a group. If we're editing a group we only update user

parameters such as rank, etc. if they are changed

void group_create ( &$group_id,  $type,  $name,  $desc,  $group_attributes, [ $allow_desc_bbcode = false], [ $allow_desc_urls = false], [ $allow_desc_smilies = false])
  • &$group_id
  • $type
  • $name
  • $desc
  • $group_attributes
  • $allow_desc_bbcode
  • $allow_desc_urls
  • $allow_desc_smilies
group_delete (line 2535)

Group Delete

void group_delete ( $group_id, [ $group_name = false])
  • $group_id
  • $group_name
group_memberships (line 3224)

Obtain either the members of a specified group, the groups the specified user is subscribed to or checking if a specified user is in a specified group. This function does not return pending memberships.

Note: Never use this more than once... first group your users/groups

void group_memberships ([ $group_id_ary = false], [ $user_id_ary = false], [ $return_bool = false])
  • $group_id_ary
  • $user_id_ary
  • $return_bool
group_set_user_default (line 3092)

Set users default group

  • access: private
void group_set_user_default ( $group_id,  $user_id_ary, [ $group_attributes = false], [ $update_listing = false])
  • $group_id
  • $user_id_ary
  • $group_attributes
  • $update_listing
group_update_listings (line 3290)

Re-cache moderators and foes if group has a_ or m_ permissions

void group_update_listings ( $group_id)
  • $group_id
group_user_add (line 2607)

Add user(s) to group

  • return: false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
mixed group_user_add ( $group_id, [ $user_id_ary = false], [ $username_ary = false], [ $group_name = false], [ $default = false], [ $leader = 0], [ $pending = 0], [ $group_attributes = false])
  • $group_id
  • $user_id_ary
  • $username_ary
  • $group_name
  • $default
  • $leader
  • $pending
  • $group_attributes
group_user_attributes (line 2907)

This is used to promote (to leader), demote or set as default a member/s

void group_user_attributes ( $action,  $group_id, [ $user_id_ary = false], [ $username_ary = false], [ $group_name = false], [ $group_attributes = false])
  • $action
  • $group_id
  • $user_id_ary
  • $username_ary
  • $group_name
  • $group_attributes
group_user_del (line 2708)

Remove a user/s from a given group. When we remove users we update their default group_id. We do this by examining which "special" groups they belong to. The selection is made based on a reasonable priority system

  • return: if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
false group_user_del ( $group_id, [ $user_id_ary = false], [ $username_ary = false], [ $group_name = false])
  • $group_id
  • $user_id_ary
  • $username_ary
  • $group_name
group_validate_groupname (line 3044)

A small version of validate_username to check for a group name's existence. To be called directly.

void group_validate_groupname ( $group_id,  $group_name)
  • $group_id
  • $group_name
remove_default_avatar (line 2828)

Removes the group avatar of the default group from the users in user_ids who have that group as default.

void remove_default_avatar ( $group_id,  $user_ids)
  • $group_id
  • $user_ids
remove_default_rank (line 2869)

Removes the group rank of the default group from the users in user_ids who have that group as default.

void remove_default_rank ( $group_id,  $user_ids)
  • $group_id
  • $user_ids
update_last_username (line 87)

Get latest registered username and update database to reflect it

void update_last_username ()
user_active_flip (line 578)

Flips user_type from active to inactive and vice versa, handles group membership updates

void user_active_flip (string $mode,  $user_id_ary, [ $reason = INACTIVE_MANUAL])
  • string $mode: can be flip for flipping from active/inactive, activate or deactivate
  • $user_id_ary
  • $reason
user_add (line 152)

Adds an user

  • return: new user's ID.
the user_add (mixed $user_row, [string $cp_data = false])
  • mixed $user_row: An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
  • string $cp_data: custom profile fields, see custom_profile::build_insert_sql_array
user_ban (line 671)

Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address

boolean user_ban (string $mode, mixed $ban, int $ban_len, string $ban_len_other, boolean $ban_exclude, string $ban_reason, [ $ban_give_reason = ''])
  • string $mode: Type of ban. One of the following: user, ip, email
  • mixed $ban: Banned entity. Either string or array with usernames, ips or email addresses
  • int $ban_len: Ban length in minutes
  • string $ban_len_other: Ban length as a date (YYYY-MM-DD)
  • boolean $ban_exclude: Exclude these entities from banning?
  • string $ban_reason: String describing the reason for this ban
  • $ban_give_reason
user_delete (line 301)

Remove User

void user_delete ( $mode,  $user_id, [ $post_username = false])
  • $mode
  • $user_id
  • $post_username
user_get_id_name (line 27)

Obtain user_ids from usernames or vice versa. Returns false on success else the error string

void user_get_id_name (array &$user_id_ary, array &$username_ary, [mixed $user_type = false])
  • array &$user_id_ary: The user ids to check or empty if usernames used
  • array &$username_ary: The usernames to check or empty if user ids used
  • mixed $user_type: Array of user types to check, false if not restricting by user type
user_ipwhois (line 1133)

Whois facility

void user_ipwhois ( $ip)
  • $ip
user_unban (line 1066)

Unban User

void user_unban ( $mode,  $ban)
  • $mode
  • $ban
user_update_name (line 114)

Updates a username across all relevant tables/fields

void user_update_name (string $old_name, string $new_name)
  • string $old_name: the old/current username
  • string $new_name: the new username
validate_data (line 1190)

Data validation ... used primarily but not exclusively by ucp modules

"Master" function for validating a range of data types

void validate_data ( $data,  $val_ary)
  • $data
  • $val_ary
validate_date (line 1272)

Validate Date

boolean validate_date ( $date_string, [ $optional = false], String $string)
  • String $string: a date in the dd-mm-yyyy format
  • $date_string
  • $optional
validate_email (line 1582)

Check to see if email address is banned or already present in the DB

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
mixed validate_email (string $email, [string $allowed_email = false])
  • string $email: The email to check
  • string $allowed_email: An allowed email, default being $user->data['user_email']
validate_jabber (line 1640)

Validate jabber address Taken from the jabber class within flyspray (see author notes)

  • author: flyspray.org
void validate_jabber ( $jid)
  • $jid
validate_match (line 1311)

Validate Match

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
boolean|string validate_match ( $string, [ $optional = false], [ $match = ''])
  • $string
  • $optional
  • $match
validate_num (line 1248)

Validate Number

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
boolean|string validate_num ( $num, [ $optional = false], [ $min = 0], [ $max = 1E99])
  • $num
  • $optional
  • $min
  • $max
validate_password (line 1487)

Check to see if the password meets the complexity settings

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
boolean|string validate_password ( $password)
  • $password
validate_string (line 1224)

Validate String

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
boolean|string validate_string ( $string, [ $optional = false], [ $min = 0], [ $max = 0])
  • $string
  • $optional
  • $min
  • $max
validate_username (line 1341)

Check to see if the username has been taken, or if it is disallowed.

Also checks if it includes the " character, which we don't allow in usernames. Used for registering, changing names, and posting anonymously with a username

  • return: Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
mixed validate_username (string $username, [string $allowed_username = false])
  • string $username: The username to check
  • string $allowed_username: An allowed username, default being $user->data['username']

Documentation generated on Tue, 26 Aug 2008 08:34:05 +0200 by phpDocumentor 1.4.2