ExternalUser_vB Class Reference
[ExternalUser]

This class supports the proprietary vBulletin forum system <http://www.vbulletin.com>, versions 3.5 and up. More...

Inherits ExternalUser.

List of all members.

Public Member Functions

 getId ()
 This must return some identifier that stably, uniquely identifies the user.
 getName ()
 This must return the name that the user would normally use for login to the external database.
 authenticate ($password)
 Is the given password valid for the external user? The password is provided in plaintext.
 getPref ($pref)
 Retrieve the value corresponding to the given preference key.
 getGroups ()
 Return an array of identifiers for all the foreign groups that this user has.

Protected Member Functions

 initFromName ($name)
 Given a name, which is a string exactly as input by the user in the login form but with whitespace stripped, initialize this object to be the corresponding ExternalUser.
 initFromId ($id)
 Given an id, which was at some previous point in history returned by getId(), initialize this object to be the corresponding ExternalUser.
 initFromCookie ()
 Try to magically initialize the user from cookies or similar information so he or she can be logged in on just viewing the wiki.

Private Member Functions

 initFromCond ($cond)
 getDb ()
 getFields ()

Private Attributes

 $mDb
 $mRow


Detailed Description

This class supports the proprietary vBulletin forum system <http://www.vbulletin.com>, versions 3.5 and up.

It calls no functions or code, only reads from the database. Example lines to put in LocalSettings.php:

$wgExternalAuthType = 'ExternalUser_vB'; $wgExternalAuthConf = array( 'server' => 'localhost', 'username' => 'forum', 'password' => 'udE,jSqDJ<""p=fI.K9', 'dbname' => 'forum', 'tableprefix' => '', 'cookieprefix' => 'bb' );

Definition at line 38 of file vB.php.


Member Function Documentation

ExternalUser_vB::authenticate ( password  ) 

Is the given password valid for the external user? The password is provided in plaintext.

Parameters:
$password string
Returns:
bool

Reimplemented from ExternalUser.

Definition at line 119 of file vB.php.

ExternalUser_vB::getDb (  )  [private]

Definition at line 99 of file vB.php.

Referenced by initFromCond(), and initFromCookie().

ExternalUser_vB::getFields (  )  [private]

Definition at line 111 of file vB.php.

Referenced by initFromCond(), and initFromCookie().

ExternalUser_vB::getGroups (  ) 

Return an array of identifiers for all the foreign groups that this user has.

The identifiers are opaque objects that only need to be specifiable by the administrator in LocalSettings.php when configuring $wgAutopromote. They may be, for instance, strings or integers.

TODO: Support this in $wgAutopromote.

Returns:
array

Reimplemented from ExternalUser.

Definition at line 134 of file vB.php.

ExternalUser_vB::getId (  ) 

This must return some identifier that stably, uniquely identifies the user.

In a typical web application, this could be an integer representing the "user id". In other cases, it might be a string. In any event, the return value should be a string between 1 and 255 characters in length; must uniquely identify the user in the foreign database; and, if at all possible, should be permanent.

This will only ever be used to reconstruct this ExternalUser object via newFromId(). The resulting object in that case should correspond to the same user, even if details have changed in the interim (e.g., renames or preference changes).

Returns:
string

Reimplemented from ExternalUser.

Definition at line 116 of file vB.php.

ExternalUser_vB::getName (  ) 

This must return the name that the user would normally use for login to the external database.

It is subject to no particular restrictions beyond rudimentary sanity, and in particular may be invalid as a MediaWiki username. It's used to auto-generate an account name that *is* valid for MediaWiki, either with or without user input, but basically is only a hint.

Returns:
string

Reimplemented from ExternalUser.

Definition at line 117 of file vB.php.

ExternalUser_vB::getPref ( pref  ) 

Retrieve the value corresponding to the given preference key.

The most important values are:

  • emailaddress
  • language

The value must meet MediaWiki's requirements for values of this type, and will be checked for validity before use. If the preference makes no sense for the backend, or it makes sense but is unset for this user, or is unrecognized, return null.

$pref will never equal 'password', since passwords are usually hashed and cannot be directly retrieved. authenticate() is used for this instead.

TODO: Currently this is only called for 'emailaddress'; generalize! Add some config option to decide which values are grabbed on user initialization.

Parameters:
$pref string
Returns:
mixed

Reimplemented from ExternalUser.

Definition at line 126 of file vB.php.

ExternalUser_vB::initFromCond ( cond  )  [private]

Definition at line 82 of file vB.php.

References getDb(), and getFields().

Referenced by initFromId(), and initFromName().

ExternalUser_vB::initFromCookie (  )  [protected]

Try to magically initialize the user from cookies or similar information so he or she can be logged in on just viewing the wiki.

If this is impossible to do, just return false.

TODO: Actually use this.

Returns:
bool Success?

Reimplemented from ExternalUser.

Definition at line 49 of file vB.php.

References getDb(), and getFields().

ExternalUser_vB::initFromId ( id  )  [protected]

Given an id, which was at some previous point in history returned by getId(), initialize this object to be the corresponding ExternalUser.

Return true if successful, false otherwise.

Parameters:
$id string
Returns:
bool Success?

Reimplemented from ExternalUser.

Definition at line 45 of file vB.php.

References initFromCond().

ExternalUser_vB::initFromName ( name  )  [protected]

Given a name, which is a string exactly as input by the user in the login form but with whitespace stripped, initialize this object to be the corresponding ExternalUser.

Return true if successful, otherwise false.

Parameters:
$name string
Returns:
bool Success?

Reimplemented from ExternalUser.

Definition at line 41 of file vB.php.

References $name, and initFromCond().


Member Data Documentation

ExternalUser_vB::$mDb [private]

Definition at line 39 of file vB.php.

ExternalUser_vB::$mRow [private]

Definition at line 39 of file vB.php.


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

Generated on Sat Apr 30 22:57:37 2011 for MediaWiki by  doxygen 1.5.9