TIP_User

Introduction

User management

Source file
/Type/module/content/user.php
Extends
TIP_Content

This module provides user management to the site, allowing:

The following keys are provided by this module:

In anonymous sections, this field is not defined (it is null).

Properties

conditions_template : string

The template to run to view the registration conditions

access
protected

expiration : string

The default expiration for the cookie

access
protected

Any value accepted by the strtotime() function is valid. The expiration is the time from the first login after which the cookie will expire. The "idle" property has higher precedence over this "expiration" value.

idle : string

The idle time for the cookie or null if only "expiration" is used

access
protected

Any value accepted by the strtotime() function is valid. The idle is the time from the last activity after which the cookie will expire. This means if you set "idle" the cookie will be set on every hit to posticipate the expiration.

Methods

checkOptions (&$options)

&$options
lines
74 - 87
static
yes
access
protected

__construct ($options)

Constructor

$options
array
Properties values
lines
101 - 130
access
protected

Initializes a TIP_User instance and performs the user authentication.

Notice in this constructor no external modules can be called, because many of them (if not all) depend on TIP_User. So the eventual errors are stored in the $_constructor_error private property and processed in the postConstructor() method.

postConstructor ()

Custom post construction method

lines
138 - 150
access
protected

Overrides the default post-constructor method appending the constructor error processing.

__destruct ()

Destructor

lines
157 - 172

Updates the record of the current logged-in user, if any.

login () : bool

Login a registered user

lines
186 - 197
access
protected

Performs the login option for a specific user. The row data of the user to login must be present in the '_row' internal property: if not defined, a logout action is called.

logout () : bool

Logout the current user

lines
207 - 215
access
protected

Performs the logout option for the current user. The row data of the user to login must be present in the '_row' internal property.

getLoggedField ($field) : mixed|null

Get a field value of the logged user

$field
string
The field id
lines
226 - 229
access
public

Retrieves a field value for the current logged-in user. If no user is logged or the field is not found, it returns null.

setLoggedField ($field, $value) : bool

Set a field value of the logged user

$field
string
The field id
$value
mixed
The new field value
lines
241 - 249
access
public

Changes a field value for the current logged-in user. If no user is logged or the field is not found, it returns false.

increment ($field) : bool

Increment a field

$field
string
The field id
lines
260 - 268
access
public

Shortcut for a often used operation that increment a field value. Often used to update user statistics.

actionAdd ([$id], [$options]) : bool

Perform an add action

$id
mixed [ = null ]
The identifier of the row to duplicate
$options
array [ = array() ]
Options to pass to the form() call
lines
283 - 319
access
protected

Overrides the default add action, showing the conditions to accept before registering a new user and performing the autologin (if needed).

actionLogin ([$options]) : bool

Perform a login action

$options
array [ = array() ]
Options to pass to the form() call
lines
329 - 351
access
protected

Presents a login form and process the submitted fields accordling.

actionLogout () : bool

Perform a logout action

lines
358 - 361
access
protected

runAdminAction ($action)

$action
lines
363 - 373
access
protected

runTrustedAction ($action)

$action
lines
375 - 385
access
protected

runUntrustedAction ($action)

$action
lines
387 - 412
access
protected

runAction ($action)

$action
lines
414 - 427
access
protected
TIP_User was last modified by TiP on Mon 25 May 2009 06:22:25 PM CEST
Hosted by BerliOS Developer Logo