b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.8) [ 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  
mixed   $datecreated  
mixed   $domain  
mixed   $email  
mixed   $firstname  
NULL|Group   $Group  
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
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
boolean   setGroup()   Set new Group.
void   set_datecreated()   Set date created.
boolean   set_email()   Set email address of the user.
void   url()   Template function: display user's URL
void   yim()   Template function: display Yahoo IM of the user

[ Top ]
Properties
mixed   $aim [line 61]

[ Top ]
boolean   $allow_msgform [line 69]

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

Blog posts statuses permissions


[ Top ]
mixed   $browser [line 58]

[ Top ]
mixed   $datecreated [line 59]

[ Top ]
mixed   $domain [line 57]

[ Top ]
mixed   $email [line 54]

[ Top ]
mixed   $firstname [line 50]

[ Top ]
NULL|Group   $Group [line 88]

[ Top ]
mixed   $icq [line 53]

[ Top ]
mixed   $idmode [line 65]

[ Top ]
mixed   $ip [line 56]

[ Top ]
mixed   $lastname [line 51]

[ Top ]
mixed   $level [line 60]

[ Top ]
mixed   $locale [line 64]

[ Top ]
mixed   $login [line 48]

[ Top ]
mixed   $msn [line 62]

[ Top ]
mixed   $nickname [line 52]

[ Top ]
mixed   $notify [line 70]

[ Top ]
mixed   $pass [line 49]

[ Top ]
mixed   $showonline [line 71]

[ Top ]
mixed   $url [line 55]

[ Top ]
boolean   $validated [line 76]

[ Top ]
mixed   $yim [line 63]

[ 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 101]

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

Constructor

Parameters:
object DB   $db_row:  row


[ Top ]
aim  [line 1049]

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

Template function: display AIM of the user.

NOTE: Replaces spaces with '+' ?!?

Parameters:
   $format: 


[ Top ]
callback_optionsForIdMode  [line 779]

  void callback_optionsForIdMode( $value  )

Parameters:
   $value: 


[ Top ]
check_perm  [line 431]

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

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

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

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

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

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

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

Template function: display email of the user

Parameters:
   $format: 


[ Top ]
first_name  [line 1002]

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

Template function: display first name of the user

Parameters:
   $format: 


[ Top ]
get  [line 192]

  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_media_dir  [line 261]

  mixed get_media_dir( )

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.


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

  string get_media_url( )

Get the URL to the media folder


API Tags:
Return:  the URL


[ Top ]
get_msgform_link  [line 891]

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

  integer get_num_posts( )

Get the number of posts for the user.



[ Top ]
get_preferred_name  [line 217]

  string get_preferred_name( )

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



[ Top ]
icq  [line 1038]

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

Template function: display ICQ of the user

Parameters:
   $format: 


[ Top ]
last_name  [line 1011]

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

Template function: display last name of the user

Parameters:
   $format: 


[ Top ]
level  [line 864]

  void level( )

Template function: display user's level



[ Top ]
login  [line 875]

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

Template function: display user's login

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


[ Top ]
msgform_link  [line 937]

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

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

Template function: display MSN of the user

Parameters:
   $format: 


[ Top ]
nick_name  [line 1020]

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

Template function: display nickname of the user

Parameters:
   $format: 


[ Top ]
num_posts  [line 993]

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

Template function: display number of user's posts

Parameters:
   $format: 


[ Top ]
preferred_name  [line 948]

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

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

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

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

  boolean setGroup( 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 ]
set_datecreated  [line 358]

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

Set date created.

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


[ Top ]
set_email  [line 380]

  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 ]
url  [line 979]

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

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

Template function: display Yahoo IM of the user

Parameters:
   $format: 


[ Top ]

Documentation generated on Tue, 18 Dec 2007 23:23:47 +0100 by phpDocumentor 1.4.0