Pluf_User Class Reference

Inheritance diagram for Pluf_User:

Pluf_Model

List of all members.

Public Member Functions

 init ()
 __toString ()
 preDelete ()
 setPassword ($password)
 checkPassword ($password)
 checkCreditentials ($login, $password)
 preSave ($create=false)
 isAnonymous ()
 getAllPermissions ($force=false)
 hasPerm ($perm, $obj=null)
 hasAppPerms ($app)
 setMessage ($message)
 getAndDeleteMessages ()
 getProfile ()

Public Attributes

 $_model = 'Pluf_User'
 $session_key = '_PX_Pluf_User_auth'
 $_cache_perms = null


Detailed Description

User Model.

Member Function Documentation

Pluf_User::init (  ) 

Reimplemented from Pluf_Model.

Pluf_User::__toString (  ) 

String representation of the user.

Reimplemented from Pluf_Model.

Pluf_User::preDelete (  ) 

Predelete to drop the row level permissions.

[signal]

Pluf_User::preDelete

[sender]

Pluf_User

[description]

This signal allows an application to perform special operations at the deletion of a user.

[parameters]

array('user' => $user)

Reimplemented from Pluf_Model.

Pluf_User::setPassword ( password  ) 

Set the password of a user.

You need to manually save the user to store the password in the database. The supported algorithms are md5, crc32 and sha1, sha1 being the default.

Parameters:
string New password
Returns:
bool Success

Pluf_User::checkPassword ( password  ) 

Check if the password of a user matches with the one in the database.

Parameters:
string Password
Returns:
bool True if success

Pluf_User::checkCreditentials ( login,
password 
)

Check if the login creditentials are valid.

Parameters:
string Login
string Password
Returns:
mixed False or matching user

Pluf_User::preSave ( create = false  ) 

Set the last_login and date_joined before creating.

Reimplemented from Pluf_Model.

Pluf_User::isAnonymous (  ) 

Check if a user is anonymous.

Returns:
bool True if the user is anonymous.

Pluf_User::getAllPermissions ( force = false  ) 

Get all the permissions of a user.

Parameters:
bool Force the reload of the list of permissions (false)
Returns:
array List of permissions

Pluf_User::hasPerm ( perm,
obj = null 
)

Check if a user as a permission.

Parameters:
string Permission
Object Object for row level permission (null)
Returns:
bool True if the user has the permission.

Pluf_User::hasAppPerms ( app  ) 

Check if a user one or more application permission.

Returns:
bool True if the user has some.

Pluf_User::setMessage ( message  ) 

Set a message.

The user must not be anonymous.

Parameters:
string Message
Returns:
bool Success

Pluf_User::getAndDeleteMessages (  ) 

Get messages and delete them.

The user must not be anonymous.

Returns:
mixed False if anonymous, else ArrayObject

Pluf_User::getProfile (  ) 

Get profile.

Retrieve the profile of the current user. If not profile in the database a Pluf_Exception_DoesNotExist exception is thrown, just catch it and create a profile.

Returns:
Pluf_Model User profile


Member Data Documentation

Pluf_User::$_model = 'Pluf_User'

Reimplemented from Pluf_Model.

Pluf_User::$session_key = '_PX_Pluf_User_auth'

If the session contains this key with a numeric id in. The corresponding user is loaded.

Pluf_User::$_cache_perms = null

Cache of the permissions.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen