Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • UBCollection
  • UBEvent
  • UBFile
  • UBItem
  • UBMessage
  • UBSite
  • UBUser
  • Overview
  • Package
  • Class
  • Tree

Class UBUser

<Class Description>

UBItem
Extended by UBUser

Direct known subclasses

ClipitUser
Package: ClipIt\urjc\backend
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at UBUser.php
Methods summary
public
# __construct( integer $id = null, ElggUser $elgg_user = null )

Constructor

Constructor

Parameters

$id
integer
$id If !null, load instance.
$elgg_user
ElggUser
$elgg_user Object to load instance from (optional)

Throws

APIException

Overrides

UBItem::__construct()
protected
# copy_from_elgg( ElggUser $elgg_user )

Loads a User instance from the system.

Loads a User instance from the system.

Parameters

$elgg_user
ElggUser
$elgg_user User to load from the system.

Overrides

UBItem::copy_from_elgg()
protected boolean|integer
# save( )

Saves this instance to the system.

Saves this instance to the system.

Returns

boolean|integer
Returns id of saved instance, or false if error.

Overrides

UBItem::save()
protected
# copy_to_elgg( ElggUser $elgg_user )

Copy $this user parameters into an Elgg User entity.

Copy $this user parameters into an Elgg User entity.

Parameters

$elgg_user
ElggUser
$elgg_user Elgg User object instance to save $this to

Overrides

UBItem::copy_to_elgg()
protected static boolean
# create_password( string $clear_password )

Creates an encoded user password using a random hash for encoding.

Creates an encoded user password using a random hash for encoding.

Parameters

$clear_password
string
$clear_password The new user password in clear text.

Returns

boolean
'true' if success, 'false' if error.
public static integer|boolean
# set_properties( integer $id, array $prop_value_array )

Sets values to specified properties of a User

Sets values to specified properties of a User

Parameters

$id
integer
$id Id of User to set property values
$prop_value_array
array
$prop_value_array Array of property=>value pairs to set into the User

Returns

integer|boolean
Returns Id of User if correct, or false if error

Throws

InvalidParameterException

Overrides

UBItem::set_properties()
public static boolean
# login( string $login, string $password, boolean $persistent = false )

Authenticate a user and log him into the system.

Authenticate a user and log him into the system.

Parameters

$login
string
$login User login
$password
string
$password User password
$persistent
boolean
$persistent Determines whether to make the session persistent

Returns

boolean
Returns true if ok, or false if error
public static boolean
# logout( )

Logs out a user from the system.

Logs out a user from the system.

Returns

boolean
Returns true if ok, or false if error.
public static static[]
# get_by_login( array $login_array )

Get users with login contained in a given list of logins.

Get users with login contained in a given list of logins.

Parameters

$login_array
array
$login_array Array of user logins

Returns

static[]
Returns an array of User objects
public static static[]
# get_by_email( array $email_array )

Get users with email contained in a given list of emails. Each email can be associated with multiple users. The output will be an array of Users per login, nested inside a main array.

Get users with email contained in a given list of emails. Each email can be associated with multiple users. The output will be an array of Users per login, nested inside a main array.

Parameters

$email_array
array
$email_array Array of user emails

Returns

static[]
Returns an array of arrays of User objects
public static static[]
# get_by_role( array $role_array )

Get users with role contained in a given list of roles.

Get users with role contained in a given list of roles.

Parameters

$role_array
array
$role_array Array of user roles

Returns

static[]
Returns an array of [role] => array(Users)
public static integer|boolean
# get_last_login( integer $id )

Get a User's last login timestamp.

Get a User's last login timestamp.

Parameters

$id
integer
$id User ID

Returns

integer|boolean
Last login timestamp, or false in case of error
public static integer|false
# set_avatar( integer $id, integer $file_id )

Sets the avatar for a User

Sets the avatar for a User

Parameters

$id
integer
$id User ID
$file_id
integer
$file_id Id of the image file containing the User's avatar

Returns

integer|false
Returns the ID of the User, or false if error.
public static array|null
# get_avatar( integer $id, string $size = "medium" )

Returns the avatar for a User

Returns the avatar for a User

Parameters

$id
integer
$id User ID
$size
string
$size Desired size of avatar image: small, medium or large.

Returns

array|null
Returns an array with 2 elements: "url" => <avatar_url> and "path" => <avatar_path>, or null if none.
public static array|null
# import_data( string $file_path )

Add Users from an Excel file, and return an array of User Ids from those created or selected from the file.

Add Users from an Excel file, and return an array of User Ids from those created or selected from the file.

Parameters

$file_path
string
$file_path Local file path

Returns

array|null
Array of User IDs, or null if error.
Methods inherited from UBItem
count_all(), create(), create_clone(), delete_all(), delete_by_id(), get_all(), get_all_parents(), get_by_id(), get_by_owner(), get_clone_tree(), get_cloned_from(), get_clones(), get_events(), get_from_search(), get_properties(), link_parent_clone(), list_properties(), sort_by_date(), sort_by_date_inv(), sort_by_name(), sort_by_name_inv(), sort_numbers(), sort_numbers_inv(), unlink_from_clones(), unlink_from_parent()
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public string $login ""
#
public string $password ""
#
public string $email ""
#
public string $role "user"
#
public string $language ""
#
public integer $last_login 0
#
public integer $avatar_file 0
#
Properties inherited from UBItem
$clone_array, $cloned_from, $description, $id, $name, $owner_id, $time_created, $url
API documentation generated by ApiGen 2.8.0