b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.10) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: User

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

Class User

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

Inherited From DataObject

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

Inherited From DataObject

DataObject::DataObject()
Constructor
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::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::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.

[ Top ]
Property Summary
mixed   $aim  
boolean   $allow_msgform  
mixed   $blog_post_statuses   Blog posts statuses permissions
mixed   $browser  
array   $cache_perms   Cache for perms.
mixed   $datecreated  
mixed   $domain  
mixed   $email  
mixed   $firstname  
NULL|Group   $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   $nickname  
mixed   $notify  
mixed   $pass  
mixed   $showonline  
mixed   $url  
boolean   $validated  
mixed   $yim  
integer|NULL   $_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_perm()   Check permission for this user
boolean   check_perm_blogusers()   Check permission for this user on a specified blog
boolean   check_perm_catsusers()   Check permission for this user on a set of specified categories
void   dbdelete()   Delete user and dependencies from database
boolean   dbinsert()   Insert object into DB based on previously recorded changes
boolean   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
Group   &get_Group()   Get the Group of the 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.
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   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
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
void   preferred_name_return()   Return 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
void   yim()   Template function: display Yahoo IM of the user

[ Top ]
Properties
mixed   $aim [line 58]

[ Top ]
boolean   $allow_msgform [line 71]

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

Blog posts statuses permissions


[ Top ]
mixed   $browser [line 63]

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

Cache for perms.

API Tags:
Access:  protected


[ Top ]
mixed   $datecreated [line 64]

[ Top ]
mixed   $domain [line 62]

[ Top ]
mixed   $email [line 55]

[ Top ]
mixed   $firstname [line 50]

[ Top ]
NULL|Group   $Group [line 96]
API Tags:
See:  User::get_Group()
Access:  protected


[ Top ]
integer   $group_ID [line 89]

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


[ Top ]
mixed   $icq [line 57]

[ Top ]
mixed   $idmode [line 53]

[ Top ]
mixed   $ip [line 61]

[ Top ]
mixed   $lastname [line 51]

[ Top ]
mixed   $level [line 65]

[ Top ]
mixed   $locale [line 54]

[ Top ]
mixed   $login [line 48]

[ Top ]
mixed   $msn [line 59]

[ Top ]
mixed   $nickname [line 52]

[ Top ]
mixed   $notify [line 66]

[ Top ]
mixed   $pass [line 49]

[ Top ]
mixed   $showonline [line 67]

[ Top ]
mixed   $url [line 56]

[ Top ]
boolean   $validated [line 76]

[ Top ]
mixed   $yim [line 60]

[ Top ]
integer|NULL   $_num_posts [line 83]

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

API Tags:
Access:  protected


[ Top ]
Methods
Constructor User  [line 116]

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

Constructor

Parameters:
object DB   $db_row:  row


[ Top ]
aim  [line 1120]

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

Template function: display AIM of the user.

NOTE: Replaces spaces with '+' ?!?

Parameters:
   $format: 


[ Top ]
callback_optionsForIdMode  [line 850]

  void callback_optionsForIdMode( $value  )

Parameters:
   $value: 


[ Top ]
check_perm  [line 473]

  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...)

API Tags:
Return:  0 if permission denied


[ Top ]
check_perm_blogusers  [line 641]

  boolean check_perm_blogusers( string $permname, string $permlevel, integer $perm_target_blog  )

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

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


[ Top ]
check_perm_catsusers  [line 590]

  boolean check_perm_catsusers( string $permname, string $permlevel, array &$perm_target_cats  )

Check permission for this user on a set of specified categories

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

Parameters:
string   $permname:  Permission name, can be one of the following:
  • cat_post_statuses
  • more to come later...
string   $permlevel:  Permission level
array   &$perm_target_cats:  Array of target cat IDs

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


[ Top ]
dbdelete  [line 769]

  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 723]

  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 746]

  boolean dbupdate( )

Update the DB based on previously recorded changes.

Triggers the plugin event AfterUserUpdate.


API Tags:
Return:  true on success


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

[ Top ]
email  [line 1100]

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

Template function: display email of the user

Parameters:
   $format: 


[ Top ]
first_name  [line 1073]

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

Template function: display first name of the user

Parameters:
   $format: 


[ Top ]
get  [line 207]

  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_Group  [line 448]

  Group &get_Group( )

Get the Group of the user.


API Tags:
Return:  (by reference)


[ Top ]
get_media_dir  [line 277]

  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

[ Top ]
get_media_url  [line 329]

  string get_media_url( )

Get the URL to the media folder


API Tags:
Return:  the URL


[ Top ]
get_msgform_link  [line 962]

  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_num_posts  [line 253]

  integer get_num_posts( )

Get the number of posts for the user.



[ Top ]
get_preferred_name  [line 232]

  string get_preferred_name( )

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



[ Top ]
icq  [line 1109]

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

Template function: display ICQ of the user

Parameters:
   $format: 


[ Top ]
last_name  [line 1082]

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

Template function: display last name of the user

Parameters:
   $format: 


[ Top ]
level  [line 935]

  void level( )

Template function: display user's level



[ Top ]
login  [line 946]

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

Template function: display user's login

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


[ Top ]
msgform_link  [line 1008]

  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 1138]

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

Template function: display MSN of the user

Parameters:
   $format: 


[ Top ]
nick_name  [line 1091]

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

Template function: display nickname of the user

Parameters:
   $format: 


[ Top ]
num_posts  [line 1064]

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

Template function: display number of user's posts

Parameters:
   $format: 


[ Top ]
preferred_name  [line 1019]

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

Template function: display user's preferred name

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


[ Top ]
preferred_name_return  [line 1037]

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

Return user's preferred name

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


[ Top ]
send_validate_email  [line 890]

  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 350]

  boolean set( string $parname, mixed $parvalue  )

Set param value

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter 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 435]

  void setGroup( &$Group  )

Parameters:
   &$Group: 

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


[ Top ]
set_datecreated  [line 374]

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

Set date created.

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


[ Top ]
set_email  [line 396]

  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 418]

  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 1050]

  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 ]
yim  [line 1129]

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

Template function: display Yahoo IM of the user

Parameters:
   $format: 


[ Top ]

Documentation generated on Tue, 20 May 2008 01:46:34 +0200 by phpDocumentor 1.4.2