b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: User

Source Location: /blogs/inc/users/model/_user.class.php

Class User

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DataObject

DataObject::$allow_ID_insert
DataObject::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
DataObject::action_icon()
Generate requested action icon depending on perm
DataObject::action_link()
Generate requested action link depending on perm
DataObject::check_delete()
Check relations for restrictions before deleting
DataObject::check_relations()
Check relations for restrictions or cascades.
DataObject::confirm_delete()
Displays form to confirm deletion of this object
DataObject::dbchange()
Records a change that will need to be updated in the db
DataObject::dbdelete()
Delete object from DB.
DataObject::dbexists()
Check existence of specified value in unique field.
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.
DataObject::dbsave()
Inserts or Updates depending on object state.
DataObject::dbupdate()
Update the DB based on previously recorded changes
DataObject::dget()
Get a ready-to-display member param by its name
DataObject::disp()
Display a member param by its name
DataObject::get()
Get a member param by its name
DataObject::get_action_title()
Generate help title text for action
DataObject::history_info_icon()
Create icon with dataobject history
DataObject::ID()
Template function: Displays object ID.
DataObject::set()
Set param value
DataObject::set_from_Request()
Set a parameter from a Request form value.
DataObject::set_param()
Set param value.
DataObject::set_string_from_param()
Set a string parameter from a Request form value.

[ Top ]
Property Summary
mixed   $aim  
boolean   $allow_msgform   Does the user accept emails through a message form?
mixed   $avatar_file_ID  
mixed   $blog_post_statuses   Blog posts statuses permissions
mixed   $browser  
array   $cache_perms   Cache for perms.
country   $Country   Country lazy filled
mixed   $ctry_ID  
mixed   $datecreated  
mixed   $domain  
mixed   $email  
mixed   $firstname  
Group   $Group   Reference to group
integer   $group_ID   The ID of the (primary, currently only) group of the user.
mixed   $icq  
mixed   $idmode  
mixed   $ip  
mixed   $lastname  
mixed   $level  
mixed   $locale  
mixed   $login  
mixed   $msn  
mixed   $new_fields  
mixed   $nickname  
mixed   $notify  
mixed   $pass  
mixed   $showonline  
mixed   $updated_fields  
mixed   $url  
mixed   $userfields   User fields
mixed   $userfields_by_type  
mixed   $userfield_defs   Userfield defs
boolean   $validated   Has the user been validated (by email)?
mixed   $yim  
integer   $_num_posts   Number of posts by this user. Use get_num_posts() to access this (lazy filled).

[ Top ]
Method Summary
User   User()   Constructor
void   aim()   Template function: display AIM of the user.
void   callback_optionsForIdMode()  
boolean   check_password()   Check password
boolean   check_perm()   Check permission for this user
boolean   check_perm_blogowner()   Check if the user is the owner of the designated blog (which gives him a lot of permissions)
boolean   check_perm_blogusers()   Check permission for this user on a specified blog
void   dbdelete()   Delete user and dependencies from database
boolean   dbinsert()   Insert object into DB based on previously recorded changes
void   dbupdate()   Update the DB based on previously recorded changes.
void   email()   Template function: display email of the user
void   first_name()   Template function: display first name of the user
void   get()   Get a param
string   get_account_name()   Get the name of the account with complete details for admin select lists
File   &get_avatar_File()   Get File object of the user's avatar.
string   get_avatar_imgtag()   Get avatar IMG tag.
void   &get_Country()   Get Country object
void   get_country_name()   Get country name
Group   &get_Group()   Get the Group of the user.
string   get_link()   Get link to User
mixed   get_media_dir()   Get the path to the media directory. If it does not exist, it will be created.
string   get_media_url()   Get the URL to the media folder
void   get_msgform_link()   Template helper function: Get a link to a message form for this user.
void   get_msgform_url()   Get message form url
integer   get_num_posts()   Get the number of posts for the user.
string   get_preferred_name()   Get preferred name of the user, according to User::$idmode.
void   get_userpage_url()   Get user page url
void   has_avatar()  
void   icq()   Template function: display ICQ of the user
void   last_name()   Template function: display last name of the user
void   level()   Template function: display user's level
boolean   load_from_Request()   Load data from Request form fields.
void   login()   Template function: display user's login
void   msgform_link()   Template function: display a link to a message form for this user
void   msn()   Template function: display MSN of the user
void   nick_name()   Template function: display nickname of the user
void   num_posts()   Template function: display number of user's posts
void   preferred_name()   Template function: display user's preferred name
boolean   send_validate_email()   Send an email to the user with a link to validate/confirm his email address.
boolean   set()   Set param value
void   setGroup()  
void   set_datecreated()   Set date created.
boolean   set_email()   Set email address of the user.
boolean   set_Group()   Set new Group.
void   url()   Template function: display user's URL
string   userfieldget_first_for_type()   Get first field for a specific type
void   userfields_load()   Load userfields
void   userfield_add()   Add a user field
void   userfield_defs_load()   Load userfields defs
void   userfield_update()   Update an user field. Empty fields will be deleted on dbupdate.
void   yim()   Template function: display Yahoo IM of the user

[ Top ]
Properties
mixed   $aim [line 60]

[ Top ]
boolean   $allow_msgform [line 75]

Does the user accept emails through a message form?


[ Top ]
mixed   $avatar_file_ID [line 68]

[ Top ]
mixed   $blog_post_statuses = array() [line 116]

Blog posts statuses permissions


[ Top ]
mixed   $browser [line 65]

[ Top ]
array   $cache_perms = array() [line 123]

Cache for perms.

API Tags:
Access:  protected


[ Top ]
country   $Country [line 111]

Country lazy filled


[ Top ]
mixed   $ctry_ID [line 69]

[ Top ]
mixed   $datecreated [line 66]

[ Top ]
mixed   $domain [line 64]

[ Top ]
mixed   $email [line 57]

[ Top ]
mixed   $firstname [line 52]

[ Top ]
Group   $Group [line 104]

Reference to group

API Tags:
See:  User::get_Group()
Access:  protected


[ Top ]
integer   $group_ID [line 96]

The ID of the (primary, currently only) group of the user.


[ Top ]
mixed   $icq [line 59]

[ Top ]
mixed   $idmode [line 55]

[ Top ]
mixed   $ip [line 63]

[ Top ]
mixed   $lastname [line 53]

[ Top ]
mixed   $level [line 67]

[ Top ]
mixed   $locale [line 56]

[ Top ]
mixed   $login [line 50]

[ Top ]
mixed   $msn [line 61]

[ Top ]
mixed   $new_fields = array() [line 132]

[ Top ]
mixed   $nickname [line 54]

[ Top ]
mixed   $notify [line 76]

[ Top ]
mixed   $pass [line 51]

[ Top ]
mixed   $showonline [line 77]

[ Top ]
mixed   $updated_fields = array() [line 131]

[ Top ]
mixed   $url [line 58]

[ Top ]
mixed   $userfields = array() [line 129]

User fields


[ Top ]
mixed   $userfields_by_type = array() [line 130]

[ Top ]
mixed   $userfield_defs [line 137]

Userfield defs


[ Top ]
boolean   $validated [line 83]

Has the user been validated (by email)?


[ Top ]
mixed   $yim [line 62]

[ Top ]
integer   $_num_posts [line 90]

Number of posts by this user. Use get_num_posts() to access this (lazy filled).

API Tags:
Access:  protected


[ Top ]
Methods
Constructor User  [line 144]

  User User( [object DB $db_row = NULL]  )

Constructor

Parameters:
object DB   $db_row:  row


[ Top ]
aim  [line 1805]

  void aim( [ $format = 'htmlbody']  )

Template function: display AIM of the user.

NOTE: Replaces spaces with '+' ?!?

Parameters:
   $format: 


[ Top ]
callback_optionsForIdMode  [line 1553]

  void callback_optionsForIdMode( $value  )

Parameters:
   $value: 


[ Top ]
check_password  [line 867]

  boolean check_password( string $pass, [boolean $pass_is_md5 = false]  )

Check password

Parameters:
string   $pass:  password
boolean   $pass_is_md5:  Is the password parameter already MD5()'ed?


[ Top ]
check_perm  [line 892]

  boolean check_perm( string $permname, [string $permlevel = 'any'], [boolean $assert = false], [mixed $perm_target = NULL]  )

Check permission for this user

Parameters:
string   $permname:  Permission name, can be one of:
string   $permlevel:  Permission level
boolean   $assert:  Execution will halt if this is !0 and permission is denied
mixed   $perm_target:  Permission target (blog ID, array of cat IDs, Item...)

API Tags:
Return:  0 if permission denied


[ Top ]
check_perm_blogowner  [line 1174]

  boolean check_perm_blogowner( integer $blog_ID  )

Check if the user is the owner of the designated blog (which gives him a lot of permissions)

Parameters:
integer   $blog_ID: 


[ Top ]
check_perm_blogusers  [line 1210]

  boolean check_perm_blogusers( string $permname, string $permlevel, integer $perm_target_blog, [Item $Item = NULL]  )

Check permission for this user on a specified blog

This is not for direct use, please call User::check_perm() instead

Parameters:
string   $permname:  Permission name, can be one of the following:
  • blog_ismember
  • blog_post_statuses
  • blog_del_post
  • blog_comments
  • blog_cats
  • blog_properties
  • blog_genstatic
string   $permlevel:  Permission level
integer   $perm_target_blog:  Permission target blog ID
Item   $Item:  Item that we want to edit

API Tags:
Return:  0 if permission denied
See:  User::check_perm()


[ Top ]
dbdelete  [line 1471]

  void dbdelete( Log &$Log  )

Delete user and dependencies from database

Includes WAY TOO MANY requests because we try to be compatible with MySQL 3.23, bleh!

Parameters:
Log   &$Log:  Log object where output gets added (by reference).


Redefinition of:
DataObject::dbdelete()
Delete object from DB.

[ Top ]
dbinsert  [line 1383]

  boolean dbinsert( )

Insert object into DB based on previously recorded changes

Triggers the plugin event AfterUserInsert.


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.

[ Top ]
dbupdate  [line 1416]

  void dbupdate( )

Update the DB based on previously recorded changes.

Triggers the plugin event AfterUserUpdate.



Redefinition of:
DataObject::dbupdate()
Update the DB based on previously recorded changes

[ Top ]
email  [line 1785]

  void email( [ $format = 'htmlbody']  )

Template function: display email of the user

Parameters:
   $format: 


[ Top ]
first_name  [line 1758]

  void first_name( [ $format = 'htmlbody']  )

Template function: display first name of the user

Parameters:
   $format: 


[ Top ]
get  [line 462]

  void get( string $parname  )

Get a param

Parameters:
string   $parname:  the parameter


Redefinition of:
DataObject::get()
Get a member param by its name

[ Top ]
get_account_name  [line 487]

  string get_account_name( )

Get the name of the account with complete details for admin select lists



[ Top ]
get_avatar_File  [line 1842]

  File &get_avatar_File( )

Get File object of the user's avatar.


API Tags:
Return:  This may be NULL.


[ Top ]
get_avatar_imgtag  [line 1868]

  string get_avatar_imgtag( [ $size = 'crop-64x64'], [ $class = 'avatar'], [ $align = '']  )

Get avatar IMG tag.

Parameters:
   $size: 
   $class: 
   $align: 


[ Top ]
get_Country  [line 571]

  void &get_Country( )

Get Country object



[ Top ]
get_country_name  [line 586]

  void get_country_name( )

Get country name



[ Top ]
get_Group  [line 849]

  Group &get_Group( )

Get the Group of the user.


API Tags:
Return:  (by reference)


[ Top ]
get_link  [line 498]

  string get_link( [ $params = array()]  )

Get link to User

Parameters:
   $params: 


[ Top ]
get_media_dir  [line 631]

  mixed get_media_dir( [boolean $create = true]  )

Get the path to the media directory. If it does not exist, it will be created.

If we're on an admin page, it adds status messages.

Parameters:
boolean   $create:  Create the directory, if it does not exist yet?

API Tags:
Return:  the path as string on success, false if the dir could not be created

Information Tags:
Todo:  These status messages should rather go to a "syslog" and not be displayed to a normal user
Todo:  dh> refactor this into e.g. create_media_dir() and use it for Blog::get_media_dir, too.

[ Top ]
get_media_url  [line 685]

  string get_media_url( )

Get the URL to the media folder


API Tags:
Return:  the URL


[ Top ]
get_msgform_link  [line 1665]

  void get_msgform_link( [string $form_url = NULL], [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = '']  )

Template helper function: Get a link to a message form for this user.

Parameters:
string   $form_url:  url of the message form
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name


[ Top ]
get_msgform_url  [line 702]

  void get_msgform_url( $formurl  )

Get message form url

Parameters:
   $formurl: 


[ Top ]
get_num_posts  [line 602]

  integer get_num_posts( )

Get the number of posts for the user.



[ Top ]
get_preferred_name  [line 552]

  string get_preferred_name( )

Get preferred name of the user, according to User::$idmode.



[ Top ]
get_userpage_url  [line 722]

  void get_userpage_url( )

Get user page url



[ Top ]
has_avatar  [line 1831]

  void has_avatar( )



[ Top ]
icq  [line 1794]

  void icq( [ $format = 'htmlbody']  )

Template function: display ICQ of the user

Parameters:
   $format: 


[ Top ]
last_name  [line 1767]

  void last_name( [ $format = 'htmlbody']  )

Template function: display last name of the user

Parameters:
   $format: 


[ Top ]
level  [line 1638]

  void level( )

Template function: display user's level



[ Top ]
load_from_Request  [line 242]

  boolean load_from_Request( )

Load data from Request form fields.


API Tags:
Return:  true if loaded data seems valid.


[ Top ]
login  [line 1649]

  void login( [string $format = 'htmlbody']  )

Template function: display user's login

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
msgform_link  [line 1711]

  void msgform_link( [string $form_url = NULL], [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = '']  )

Template function: display a link to a message form for this user

Parameters:
string   $form_url:  url of the message form
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name


[ Top ]
msn  [line 1823]

  void msn( [ $format = 'htmlbody']  )

Template function: display MSN of the user

Parameters:
   $format: 


[ Top ]
nick_name  [line 1776]

  void nick_name( [ $format = 'htmlbody']  )

Template function: display nickname of the user

Parameters:
   $format: 


[ Top ]
num_posts  [line 1749]

  void num_posts( [ $format = 'htmlbody']  )

Template function: display number of user's posts

Parameters:
   $format: 


[ Top ]
preferred_name  [line 1722]

  void preferred_name( [string $format = 'htmlbody']  )

Template function: display user's preferred name

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
send_validate_email  [line 1593]

  boolean send_validate_email( [string $redirect_to_after = NULL]  )

Send an email to the user with a link to validate/confirm his email address.

If the email could get sent, it saves the used "request_id" into the user's Session.

Parameters:
string   $redirect_to_after:  URL, where to redirect the user after he clicked the validation link (gets saved in Session).

API Tags:
Return:  True, if the email could get sent; false if not


[ Top ]
set  [line 748]

  boolean set( string $parname, mixed $parvalue, [boolean $make_null = false]  )

Set param value

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter value
boolean   $make_null:  true to set to NULL if empty value

API Tags:
Return:  true, if a value has been set; false if it has not changed


Redefinition of:
DataObject::set()
Set param value

[ Top ]
setGroup  [line 836]

  void setGroup( &$Group  )

Parameters:
   &$Group: 

API Tags:
Deprecated:  by User::set_Group() since 1.9


[ Top ]
set_datecreated  [line 775]

  void set_datecreated( integer $datecreated, [ $isYMDhour = false]  )

Set date created.

Parameters:
integer   $datecreated:  seconds since Unix Epoch.
   $isYMDhour: 


[ Top ]
set_email  [line 797]

  boolean set_email( string $email  )

Set email address of the user.

If the email address has changed and we're configured to invalidate the user in this case, the user's account gets invalidated here.

Parameters:
string   $email:  email address to set for the User

API Tags:
Return:  true, if set; false if not changed


[ Top ]
set_Group  [line 819]

  boolean set_Group( Group &$Group  )

Set new Group.

Parameters:
Group   &$Group:  the Group object to put the user into

API Tags:
Return:  true if set, false if not changed


[ Top ]
url  [line 1735]

  void url( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display user's URL

Parameters:
string   $before:  string to display before the date (if changed)
string   $after:  string to display after the date (if changed)
string   $format:  Output format, see format_to_output()


[ Top ]
userfieldget_first_for_type  [line 1954]

  string userfieldget_first_for_type( $type_ID  )

Get first field for a specific type

Parameters:
   $type_ID: 

API Tags:
Return:  or NULL


[ Top ]
userfields_load  [line 1907]

  void userfields_load( )

Load userfields



[ Top ]
userfield_add  [line 1886]

  void userfield_add( $type, $val  )

Add a user field

Parameters:
   $type: 
   $val: 


[ Top ]
userfield_defs_load  [line 1932]

  void userfield_defs_load( )

Load userfields defs



[ Top ]
userfield_update  [line 1896]

  void userfield_update( $uf_ID, $val  )

Update an user field. Empty fields will be deleted on dbupdate.

Parameters:
   $uf_ID: 
   $val: 


[ Top ]
yim  [line 1814]

  void yim( [ $format = 'htmlbody']  )

Template function: display Yahoo IM of the user

Parameters:
   $format: 


[ Top ]

Documentation generated on Sat, 06 Mar 2010 04:26:24 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).