phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: User

Source Location: /qp_inc/users/model/_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   $allow_msgform  
mixed   $blog_post_statuses  
mixed   $browser  
mixed   $cache_perms  
mixed   $datecreated  
mixed   $domain  
mixed   $email  
mixed   $firstname  
mixed   $Group  
mixed   $group_ID  
mixed   $idmode  
mixed   $ip  
mixed   $lastname  
mixed   $level  
mixed   $locale  
mixed   $login  
mixed   $nickname  
mixed   $notify  
string   $pass   The user's password. This is a salted hash.
mixed   $showonline  
mixed   $url  
mixed   $validated  
mixed   $_num_posts  

[ Top ]
Method Summary
User   User()   Constructor
void   callback_optionsForIdMode()   dummy docblock makes error-free autodocs
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
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.
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   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   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   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

[ Top ]
Properties
mixed   $allow_msgform [line 68]

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

[ Top ]
mixed   $browser [line 65]

[ Top ]
mixed   $cache_perms = array() [line 76]

[ Top ]
mixed   $datecreated [line 66]

[ Top ]
mixed   $domain [line 64]

[ Top ]
mixed   $email [line 61]

[ Top ]
mixed   $firstname [line 56]

[ Top ]
mixed   $Group [line 74]

[ Top ]
mixed   $group_ID [line 73]

[ Top ]
mixed   $idmode [line 59]

[ Top ]
mixed   $ip [line 63]

[ Top ]
mixed   $lastname [line 57]

[ Top ]
mixed   $level [line 67]

[ Top ]
mixed   $locale [line 60]

[ Top ]
mixed   $login [line 44]

[ Top ]
mixed   $nickname [line 58]

[ Top ]
mixed   $notify [line 69]

[ Top ]
string   $pass [line 55]

The user's password. This is a salted hash.

Hash is calculated as follows: SHA1( login + MD5( cleartext_password ) )

API Tags:
See:  User::set()
See:  User::check_password()


[ Top ]
mixed   $showonline [line 70]

[ Top ]
mixed   $url [line 62]

[ Top ]
mixed   $validated [line 71]

[ Top ]
mixed   $_num_posts [line 72]

[ Top ]
Methods
Constructor User  [line 83]

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

Constructor

Parameters:
object DB   $db_row:  row


[ Top ]
callback_optionsForIdMode  [line 1013]

  void callback_optionsForIdMode( $value  )

dummy docblock makes error-free autodocs

Parameters:
   $value: 


[ Top ]
check_password  [line 470]

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

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

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

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

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

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

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

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

Template function: display email of the user

Parameters:
   $format: 


[ Top ]
first_name  [line 1216]

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

Template function: display first name of the user

Parameters:
   $format: 


[ Top ]
get  [line 170]

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

  Group &get_Group( )

Get the Group of the user.


API Tags:
Return:  (by reference)


[ Top ]
get_media_dir  [line 241]

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

  string get_media_url( )

Get the URL to the media folder


API Tags:
Return:  the URL


[ Top ]
get_msgform_link  [line 1123]

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

  void get_msgform_url( $formurl  )

Get message form url

Parameters:
   $formurl: 

API Tags:
Usedby:  Item::msgform_link()


[ Top ]
get_num_posts  [line 216]

  integer get_num_posts( )

Get the number of posts for the user.



[ Top ]
get_preferred_name  [line 195]

  string get_preferred_name( )

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



[ Top ]
get_userpage_url  [line 330]

  void get_userpage_url( [ $blogurl = NULL]  )

Get user page url

Parameters:
   $blogurl: 


[ Top ]
last_name  [line 1225]

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

Template function: display last name of the user

Parameters:
   $format: 


[ Top ]
level  [line 1096]

  void level( )

Template function: display user's level



[ Top ]
login  [line 1107]

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

Template function: display user's login

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


[ Top ]
msgform_link  [line 1169]

  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 ]
nick_name  [line 1234]

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

Template function: display nickname of the user

Parameters:
   $format: 


[ Top ]
num_posts  [line 1207]

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

Template function: display number of user's posts

Parameters:
   $format: 


[ Top ]
preferred_name  [line 1180]

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

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

  boolean set( string $parname, mixed $parvalue  )

Set param value

Note: To set the 'pass'word, $parvalue has to be the MD5()'ed password.

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 ]
set_datecreated  [line 388]

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

Set date created.

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


[ Top ]
set_email  [line 410]

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

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

  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 ]