[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/includes/ -> functions_user.php (summary)

(no description)

Copyright: (c) 2005 phpBB Group
License: http://opensource.org/licenses/gpl-license.php GNU Public License
Version: $Id$
File Size: 3619 lines (95 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 44 functions

  user_get_id_name()
  update_last_username()
  user_update_name()
  user_add()
  user_delete()
  user_active_flip()
  user_ban()
  user_unban()
  user_ipwhois()
  validate_data()
  validate_string()
  validate_num()
  validate_date()
  validate_match()
  validate_language_iso_name()
  validate_username()
  validate_password()
  validate_email()
  validate_jabber()
  phpbb_validate_hex_colour()
  phpbb_style_is_active()
  avatar_delete()
  avatar_remote()
  avatar_upload()
  get_avatar_filename()
  avatar_gallery()
  avatar_get_dimensions()
  avatar_process_user()
  group_create()
  group_correct_avatar()
  avatar_remove_db()
  group_delete()
  group_user_add()
  group_user_del()
  remove_default_avatar()
  remove_default_rank()
  group_user_attributes()
  group_validate_groupname()
  group_set_user_default()
  get_group_name()
  group_memberships()
  group_update_listings()
  remove_newly_registered()
  phpbb_get_banned_user_ids()

Functions
Functions that are not part of a class:

user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)   X-Ref
Obtain user_ids from usernames or vice versa. Returns false on
success else the error string

param: array &$user_id_ary The user ids to check or empty if usernames used
param: array &$username_ary The usernames to check or empty if user ids used
param: mixed $user_type Array of user types to check, false if not restricting by user type

update_last_username()   X-Ref
Get latest registered username and update database to reflect it


user_update_name($old_name, $new_name)   X-Ref
Updates a username across all relevant tables/fields

param: string $old_name the old/current username
param: string $new_name the new username

user_add($user_row, $cp_data = false)   X-Ref
Adds an user

param: 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.
param: string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
return: the new user's ID.

user_delete($mode, $user_id, $post_username = false)   X-Ref
Remove User


user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)   X-Ref
Flips user_type from active to inactive and vice versa, handles group membership updates

param: string $mode can be flip for flipping from active/inactive, activate or deactivate

user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '')   X-Ref
Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address

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

user_unban($mode, $ban)   X-Ref
Unban User


user_ipwhois($ip)   X-Ref
Internet Protocol Address Whois
RFC3912: WHOIS Protocol Specification

param: string $ip        Ip address, either IPv4 or IPv6.
return: string        Empty string if not a valid ip address.

validate_data($data, $val_ary)   X-Ref
Data validation ... used primarily but not exclusively by ucp modules

"Master" function for validating a range of data types

validate_string($string, $optional = false, $min = 0, $max = 0)   X-Ref
Validate String

return: boolean|string    Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

validate_num($num, $optional = false, $min = 0, $max = 1E99)   X-Ref
Validate Number

return: boolean|string    Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

validate_date($date_string, $optional = false)   X-Ref
Validate Date

param: String $string a date in the dd-mm-yyyy format
return: boolean

validate_match($string, $optional = false, $match = '')   X-Ref
Validate Match

return: boolean|string    Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

validate_language_iso_name($lang_iso)   X-Ref
Validate Language Pack ISO Name

Tests whether a language name is valid and installed

param: string $lang_iso    The language string to test
return: bool|string        Either false if validation succeeded or

validate_username($username, $allowed_username = false)   X-Ref
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

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

validate_password($password)   X-Ref
Check to see if the password meets the complexity settings

return: boolean|string    Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)

validate_email($email, $allowed_email = false)   X-Ref
Check to see if email address is banned or already present in the DB

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

validate_jabber($jid)   X-Ref
Validate jabber address
Taken from the jabber class within flyspray (see author notes)

author: flyspray.org

phpbb_validate_hex_colour($colour, $optional = false)   X-Ref
Validate hex colour value

param: string $colour The hex colour value
param: bool $optional Whether the colour value is optional. True if an empty
return: bool|string Error message if colour value is incorrect, false if it

phpbb_style_is_active($style_id)   X-Ref
Verifies whether a style ID corresponds to an active style.

param: int $style_id The style_id of a style which should be checked if activated or not.
return: boolean

avatar_delete($mode, $row, $clean_db = false)   X-Ref
Remove avatar


avatar_remote($data, &$error)   X-Ref
Remote avatar linkage


avatar_upload($data, &$error)   X-Ref
Avatar upload using the upload class


get_avatar_filename($avatar_entry)   X-Ref
Generates avatar filename from the database entry


avatar_gallery($category, $avatar_select, $items_per_column, $block_var = 'avatar_row')   X-Ref
Avatar Gallery


avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0)   X-Ref
Tries to (re-)establish avatar dimensions


avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)   X-Ref
Uploading/Changing user avatar


group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)   X-Ref
Add or edit a group. If we're editing a group we only update user
parameters such as rank, etc. if they are changed


group_correct_avatar($group_id, $old_entry)   X-Ref
Changes a group avatar's filename to conform to the naming scheme


avatar_remove_db($avatar_name)   X-Ref
Remove avatar also for users not having the group as default


group_delete($group_id, $group_name = false)   X-Ref
Group Delete


group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)   X-Ref
Add user(s) to group

return: mixed false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)   X-Ref
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: false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

remove_default_avatar($group_id, $user_ids)   X-Ref
Removes the group avatar of the default group from the users in user_ids who have that group as default.


remove_default_rank($group_id, $user_ids)   X-Ref
Removes the group rank of the default group from the users in user_ids who have that group as default.


group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)   X-Ref
This is used to promote (to leader), demote or set as default a member/s


group_validate_groupname($group_id, $group_name)   X-Ref
A small version of validate_username to check for a group name's existence. To be called directly.


group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)   X-Ref
Set users default group


get_group_name($group_id)   X-Ref
Get group name


group_memberships($group_id_ary = false, $user_id_ary = false, $return_bool = false)   X-Ref
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

group_update_listings($group_id)   X-Ref
Re-cache moderators and foes if group has a_ or m_ permissions


remove_newly_registered($user_id, $user_data = false)   X-Ref
Funtion to make a user leave the NEWLY_REGISTERED system group.

param: $user_id The id of the user to remove from the group

phpbb_get_banned_user_ids($user_ids = array()   X-Ref
Gets user ids of currently banned registered users.

param: array $user_ids Array of users' ids to check for banning,
return: array    Array of banned users' ids if any, empty array otherwise



Generated: Wed Oct 2 15:03:47 2013 Cross-referenced by PHPXref 0.7.1