EmbientPlugin Class Reference

Inheritance diagram for EmbientPlugin:

Inheritance graph
[legend]
List of all members.

Detailed Description

Provide an interface to the passive system as a plugin.

Definition at line 43 of file embient.plugin.php.

Public Member Functions

 EmbientPlugin ($systemname)
 Class constructor.
 Init ($cfg)
 plugin initialisation
 Login ($username)
 Login the user to system.
 Logout ($username)
 Logout the user from target system.
 Add ($user)
 Add new user to the system.
 Update ($username, $user)
 Update user with new information.
 Delete ($username)
 Delete the user from the system.

Public Attributes

 $user
 System specific user info that can be directly loaded from or saved to database.
 $name
 Name of this system.

Protected Member Functions

 _Load ($username)
 Load user information from database into $this->user variable.
 _ConvertUserInfo ($embientuser, $default=true)
 Convert user info from common format to plugin format.

Protected Attributes

 $_common_fields
 list of Embient user info fields.

Private Attributes

 $_db
 $_mapping = array()
 User fields mapping.


Constructor & Destructor Documentation

EmbientPlugin::EmbientPlugin systemname  ) 
 

Class constructor.

Parameters:
$systemname string - name of this system

Definition at line 107 of file embient.plugin.php.


Member Function Documentation

EmbientPlugin::_ConvertUserInfo embientuser,
default = true
[protected]
 

Convert user info from common format to plugin format.

Convert system common user information to systm specific user info and load it to plugin's user info.

Parameters:
$embientuser associative array of Embient user information
$default bool - load default value, if value missing?

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 231 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::_Load username  )  [protected]
 

Load user information from database into $this->user variable.

Parameters:
$username name of of user to be loaded
Returns:
true - success, false - failed

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 212 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::Add user  ) 
 

Add new user to the system.

Parameters:
$user associative array of new user information

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 164 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::Delete username  ) 
 

Delete the user from the system.

Parameters:
$username string - user name on the system
Returns:
true - success, false - failed

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 193 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::Init cfg  ) 
 

plugin initialisation

Typically, the target system need to override this function with its own initialisation code, and make a call to this function to finalise the initialisation.

Parameters:
$cfg associative array of the configurations for this system loaded from config.xml
Returns:
true - if success, false - if failed

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 129 of file embient.plugin.php.

EmbientPlugin::Login username  ) 
 

Login the user to system.

Parameters:
$username string - user name on the system

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 140 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::Logout username  ) 
 

Logout the user from target system.

Returns:
true - success, false - failed

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 152 of file embient.plugin.php.

Here is the call graph for this function:

EmbientPlugin::Update username,
user
 

Update user with new information.

Parameters:
$username login name of user to be updated.
$user associative array of new user information

Reimplemented in EmbientDrupal, and EmbientSMF.

Definition at line 178 of file embient.plugin.php.

Here is the call graph for this function:


Member Data Documentation

EmbientPlugin::$_common_fields [protected]
 

Initial value:

 array
      (
        'name',
        'passwd',
        'mail',
        'firstname',
        'lastname',
        'signature',
        'timezone',
      )
list of Embient user info fields.

This is the list of fileds those are common between system. It represent the information in Embient style and need to map to system specific name using plugin's _ConvertUserInfo methods.

The fields are:

  • name -> user login name
  • passwd -> user loing password
  • mail -> user email
  • firstname -> user's first name
  • lastname -> user's last name
  • signature -> user's signature
  • timezone -> number of seconds from GMT, e.g., 25200 for GMT+7 and -25200 for GMT -7

Definition at line 88 of file embient.plugin.php.

EmbientPlugin::$_db [private]
 

Database engine used by this system

Definition at line 54 of file embient.plugin.php.

EmbientPlugin::$_mapping = array() [private]
 

User fields mapping.

Mapping table between Embient user fields, and this sytem's user fields. The array is in the format of "EmbientFieldName" => "SystemFieldName". For example:

  $_map = array( 'name' => 'memberName', ...
See EmbientPlugin::_common_fields for the fields list.

Definition at line 67 of file embient.plugin.php.

EmbientPlugin::$name
 

Name of this system.

Definition at line 49 of file embient.plugin.php.

EmbientPlugin::$user
 

System specific user info that can be directly loaded from or saved to database.

Definition at line 46 of file embient.plugin.php.


The documentation for this class was generated from the following file:
Generated on Fri Feb 10 15:05:56 2006 for Embient by  doxygen 1.4.6-NO