class JMediawikiUsers extends JMediawikiObject

MediaWiki API Users class for the Joomla Platform.

Methods

__construct( Registry $options = null, JMediawikiHttp $client = null)

Constructor.

string
buildParameter( array $params)

Method to build request parameters from a string array.

Object
validateResponse( JHttpresponse $response)

Method to validate response for errors

object
login( string $lgname, string $lgpassword, string $lgdomain = null)

Method to login and get authentication tokens.

object
logout()

Method to logout and clear session data.

object
getUserInfo( array $ususers, array $usprop = null)

Method to get user information.

object
getCurrentUserInfo( array $uiprop = null)

Method to get current user information.

object
getUserContribs( string $ucuser = null, string $ucuserprefix = null, integer $uclimit = null, string $ucstart = null, string $ucend = null, boolean $uccontinue = null, string $ucdir = null, array $ucnamespace = null, array $ucprop = null, array $ucshow = null, string $uctag = null, string $uctoponly = null)

Method to get user contributions.

object
blockUser( string $user, string $expiry = null, string $reason = null, boolean $anononly = null, boolean $nocreate = null, boolean $autoblock = null, boolean $noemail = null, boolean $hidename = null, boolean $allowusertalk = null, boolean $reblock = null, boolean $watchuser = null)

Method to block a user.

object
unBlockUserByName( string $user, string $reason = null)

Method to unblock a user.

object
unBlockUserById( int $id, string $reason = null)

Method to unblock a user.

object
assignGroup( string $username, array $add = null, array $remove = null, string $reason = null)

Method to assign a user to a group.

object
emailUser( string $target, string $subject = null, string $text = null, boolean $ccme = null)

Method to email a user.

object
getToken( string $user, string $intoken)

Method to get access token.

Details

__construct( Registry $options = null, JMediawikiHttp $client = null)

Constructor.

Parameters

Registry $options Mediawiki options object.
JMediawikiHttp $client The HTTP client object.

string buildParameter( array $params)

Method to build request parameters from a string array.

Parameters

array $params string array that contains the parameters

Return Value

string request parameter

Object validateResponse( JHttpresponse $response)

Method to validate response for errors

Parameters

JHttpresponse $response reponse from the mediawiki server

Return Value

Object

Exceptions

DomainException

object login( string $lgname, string $lgpassword, string $lgdomain = null)

Method to login and get authentication tokens.

Parameters

string $lgname User Name.
string $lgpassword Password.
string $lgdomain Domain (optional).

Return Value

object

object logout()

Method to logout and clear session data.

Return Value

object

object getUserInfo( array $ususers, array $usprop = null)

Method to get user information.

Parameters

array $ususers A list of users to obtain the same information for.
array $usprop What pieces of information to include.

Return Value

object

object getCurrentUserInfo( array $uiprop = null)

Method to get current user information.

Parameters

array $uiprop What pieces of information to include.

Return Value

object

object getUserContribs( string $ucuser = null, string $ucuserprefix = null, integer $uclimit = null, string $ucstart = null, string $ucend = null, boolean $uccontinue = null, string $ucdir = null, array $ucnamespace = null, array $ucprop = null, array $ucshow = null, string $uctag = null, string $uctoponly = null)

Method to get user contributions.

Parameters

string $ucuser The users to retrieve contributions for.
string $ucuserprefix Retrieve contibutions for all users whose names begin with this value.
integer $uclimit The users to retrieve contributions for.
string $ucstart The start timestamp to return from.
string $ucend The end timestamp to return to.
boolean $uccontinue When more results are available, use this to continue.
string $ucdir In which direction to enumerate.
array $ucnamespace Only list contributions in these namespaces.
array $ucprop Include additional pieces of information.
array $ucshow Show only items that meet this criteria.
string $uctag Only list revisions tagged with this tag.
string $uctoponly Only list changes which are the latest revision

Return Value

object

object blockUser( string $user, string $expiry = null, string $reason = null, boolean $anononly = null, boolean $nocreate = null, boolean $autoblock = null, boolean $noemail = null, boolean $hidename = null, boolean $allowusertalk = null, boolean $reblock = null, boolean $watchuser = null)

Method to block a user.

Parameters

string $user Username, IP address or IP range you want to block.
string $expiry Relative expiry time, Default: never.
string $reason Reason for block (optional).
boolean $anononly Block anonymous users only.
boolean $nocreate Prevent account creation.
boolean $autoblock Automatically block the last used IP address, and any subsequent IP addresses they try to login from.
boolean $noemail Prevent user from sending email through the wiki.
boolean $hidename Hide the username from the block log.
boolean $allowusertalk Allow the user to edit their own talk page.
boolean $reblock If the user is already blocked, overwrite the existing block.
boolean $watchuser Watch the user/IP's user and talk pages.

Return Value

object

object unBlockUserByName( string $user, string $reason = null)

Method to unblock a user.

Parameters

string $user Username, IP address or IP range you want to unblock.
string $reason Reason for unblock (optional).

Return Value

object

object unBlockUserById( int $id, string $reason = null)

Method to unblock a user.

Parameters

int $id Username, IP address or IP range you want to unblock.
string $reason Reason for unblock (optional).

Return Value

object

object assignGroup( string $username, array $add = null, array $remove = null, string $reason = null)

Method to assign a user to a group.

Parameters

string $username User name.
array $add Add the user to these groups.
array $remove Remove the user from these groups.
string $reason Reason for the change.

Return Value

object

object emailUser( string $target, string $subject = null, string $text = null, boolean $ccme = null)

Method to email a user.

Parameters

string $target User to send email to.
string $subject Subject header.
string $text Mail body.
boolean $ccme Send a copy of this mail to me.

Return Value

object

object getToken( string $user, string $intoken)

Method to get access token.

Parameters

string $user The User to get token.
string $intoken The type of token.

Return Value

object