Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JMediawikiUsers
+ Graphe d'héritage de JMediawikiUsers:
+ Graphe de collaboration de JMediawikiUsers:

Liste de tous les membres

Fonctions membres publiques

 login ($lgname, $lgpassword, $lgdomain=null)
 logout ()
 getUserInfo (array $ususers, array $usprop=null)
 getCurrentUserInfo (array $uiprop=null)
 getUserContribs ($ucuser=null, $ucuserprefix=null, $uclimit=null, $ucstart=null, $ucend=null, $uccontinue=null, $ucdir=null, array $ucnamespace=null, array $ucprop=null, array $ucshow=null, $uctag=null, $uctoponly=null)
 blockUser ($user, $expiry=null, $reason=null, $anononly=null, $nocreate=null, $autoblock=null, $noemail=null, $hidename=null, $allowusertalk=null, $reblock=null, $watchuser=null)
 unBlockUserByName ($user, $reason=null)
 unBlockUserByID ($id, $reason=null)
 assignGroup ($username, $add=null, $remove=null, $reason=null)
 emailUser ($target, $subject=null, $text=null, $ccme=null)
 getToken ($user, $intoken)
- Fonctions membres publiques inherited from JMediawikiObject
 __construct (JRegistry $options=null, JMediawikiHttp $client=null)
 buildParameter (array $params)
 validateResponse ($response)

Additional Inherited Members

- Fonctions membres protégées inherited from JMediawikiObject
 fetchUrl ($path)
- Attributs protégés inherited from JMediawikiObject
 $options
 $client

Description détaillée

Définition à la ligne 19 du fichier users.php.


Documentation des fonctions membres

JMediawikiUsers::assignGroup (   $username,
  $add = null,
  $remove = null,
  $reason = null 
)

Method to assign a user to a group.

Paramètres:
string$usernameUser name.
array$addAdd the user to these groups.
array$removeRemove the user from these groups.
string$reasonReason for the change.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 364 du fichier users.php.

{
// Get the token.
$token = $this->getToken($username, 'unblock');
// Build the request path.
$path = '?action=userrights';
// Build the request data.
$data = array(
'username' => $username,
'token' => $token,
'add' => $add,
'remove' => $remove,
'reason' => $reason
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiUsers::blockUser (   $user,
  $expiry = null,
  $reason = null,
  $anononly = null,
  $nocreate = null,
  $autoblock = null,
  $noemail = null,
  $hidename = null,
  $allowusertalk = null,
  $reblock = null,
  $watchuser = null 
)

Method to block a user.

Paramètres:
string$userUsername, IP address or IP range you want to block.
string$expiryRelative expiry time, Default: never.
string$reasonReason for block (optional).
boolean$anononlyBlock anonymous users only.
boolean$nocreatePrevent account creation.
boolean$autoblockAutomatically block the last used IP address, and any subsequent IP addresses they try to login from.
boolean$noemailPrevent user from sending e-mail through the wiki.
boolean$hidenameHide the username from the block log.
boolean$allowusertalkAllow the user to edit their own talk page.
boolean$reblockIf the user is already blocked, overwrite the existing block.
boolean$watchuserWatch the user/IP's user and talk pages.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 258 du fichier users.php.

{
// Get the token.
$token = $this->getToken($user, 'block');
// Build the request path.
$path = '?action=unblock';
// Build the request data.
$data = array(
'user' => $user,
'token' => $token,
'expiry' => $expiry,
'reason' => $reason,
'anononly' => $anononly,
'nocreate' => $nocreate,
'autoblock' => $autoblock,
'noemail' => $noemail,
'hidename' => $hidename,
'allowusetalk' => $allowusertalk,
'reblock' => $reblock,
'watchuser' => $watchuser
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiUsers::emailUser (   $target,
  $subject = null,
  $text = null,
  $ccme = null 
)

Method to email a user.

Paramètres:
string$targetUser to send email to.
string$subjectSubject header.
string$textMail body.
boolean$ccmeSend a copy of this mail to me.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 399 du fichier users.php.

{
// Get the token.
$token = $this->getToken($target, 'emailuser');
// Build the request path.
$path = '?action=emailuser';
// Build the request data.
$data = array(
'target' => $target,
'token' => $token,
'subject' => $subject,
'text' => $text,
'ccme' => $ccme
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiUsers::getCurrentUserInfo ( array  $uiprop = null)

Method to get current user information.

Paramètres:
array$uipropWhat pieces of information to include.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 131 du fichier users.php.

{
// Build the request path.
$path = '?action=query&meta=userinfo';
if (isset($uiprop))
{
$path .= '&uiprop' . $this->buildParameter($uiprop);
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiUsers::getToken (   $user,
  $intoken 
)

Method to get access token.

Paramètres:
string$userThe User to get token.
string$intokenThe type of token.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 432 du fichier users.php.

{
// Build the request path.
$path = '?action=query&prop=info&intoken=' . $intoken . '&titles=User:' . $user;
// Send the request.
$response = $this->client->post($this->fetchUrl($path), null);
return (string) $this->validateResponse($response)->query->pages->page[$intoken . 'token'];
}
JMediawikiUsers::getUserContribs (   $ucuser = null,
  $ucuserprefix = null,
  $uclimit = null,
  $ucstart = null,
  $ucend = null,
  $uccontinue = null,
  $ucdir = null,
array  $ucnamespace = null,
array  $ucprop = null,
array  $ucshow = null,
  $uctag = null,
  $uctoponly = null 
)

Method to get user contributions.

Paramètres:
string$ucuserThe users to retrieve contributions for.
string$ucuserprefixRetrieve contibutions for all users whose names begin with this value.
integer$uclimitThe users to retrieve contributions for.
string$ucstartThe start timestamp to return from.
string$ucendThe end timestamp to return to.
boolean$uccontinueWhen more results are available, use this to continue.
string$ucdirIn which direction to enumerate.
array$ucnamespaceOnly list contributions in these namespaces.
array$ucpropInclude additional pieces of information.
array$ucshowShow only items that meet this criteria.
string$uctagOnly list revisions tagged with this tag.
string$uctoponlyOnly list changes which are the latest revision
Renvoie:
object
Depuis:
12.3

Définition à la ligne 167 du fichier users.php.

{
// Build the request path.
$path = '?action=query&list=usercontribs';
if (isset($ucuser))
{
$path .= '&ucuser=' . $ucuser;
}
if (isset($ucuserprefix))
{
$path .= '&ucuserprefix=' . $ucuserprefix;
}
if (isset($uclimit))
{
$path .= '&uclimit=' . $uclimit;
}
if (isset($ucstart))
{
$path .= '&ucstart=' . $ucstart;
}
if (isset($ucend))
{
$path .= '&ucend=' . $ucend;
}
if ($uccontinue)
{
$path .= '&uccontinue=';
}
if (isset($ucdir))
{
$path .= '&ucdir=' . $ucdir;
}
if (isset($ucnamespace))
{
$path .= '&ucnamespace=' . $this->buildParameter($ucnamespace);
}
if (isset($ucprop))
{
$path .= '&ucprop=' . $this->buildParameter($ucprop);
}
if (isset($ucshow))
{
$path .= '&ucshow=' . $this->buildParameter($ucshow);
}
if (isset($uctag))
{
$path .= '&uctag=' . $uctag;
}
if (isset($uctoponly))
{
$path .= '&uctoponly=' . $uctoponly;
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiUsers::getUserInfo ( array  $ususers,
array  $usprop = null 
)

Method to get user information.

Paramètres:
array$ususersA list of users to obtain the same information for.
array$uspropWhat pieces of information to include.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 103 du fichier users.php.

{
// Build the request path.
$path = '?action=query&list=users';
// Append users to the request.
$path .= '&ususers=' . $this->buildParameter($ususers);
if (isset($usprop))
{
$path .= '&usprop' . $this->buildParameter($usprop);
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiUsers::login (   $lgname,
  $lgpassword,
  $lgdomain = null 
)

Method to login and get authentication tokens.

Paramètres:
string$lgnameUser Name.
string$lgpasswordPassword.
string$lgdomainDomain (optional).
Renvoie:
object
Depuis:
12.3

Définition à la ligne 32 du fichier users.php.

{
// Build the request path.
$path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword;
if (isset($lgdomain))
{
$path .= '&lgdomain=' . $lgdomain;
}
// Send the request.
$response = $this->client->post($this->fetchUrl($path), null);
// Request path with login token.
$path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword . '&lgtoken=' . $this->validateResponse($response)->login['token'];
if (isset($lgdomain))
{
$path .= '&lgdomain=' . $lgdomain;
}
// Set the session cookies returned.
$headers = (array) $this->options->get('headers');
$headers['Cookie'] = !empty($headers['Cookie']) ? empty($headers['Cookie']) : '';
$headers['Cookie'] = $headers['Cookie'] . $response->headers['Set-Cookie'];
$this->options->set('headers', $headers);
// Send the request again with the token.
$response = $this->client->post($this->fetchUrl($path), null);
$response_body = $this->validateResponse($response);
$headers = (array) $this->options->get('headers');
$cookie_prefix = $response_body->login['cookieprefix'];
$cookie = $cookie_prefix . 'UserID=' . $response_body->login['lguserid'] . '; ' . $cookie_prefix
. 'UserName=' . $response_body->login['lgusername'];
$headers['Cookie'] = $headers['Cookie'] . '; ' . $response->headers['Set-Cookie'] . '; ' . $cookie;
$this->options->set('headers', $headers);
return $this->validateResponse($response);
}
JMediawikiUsers::logout ( )

Method to logout and clear session data.

Renvoie:
object
Depuis:
12.3

Définition à la ligne 80 du fichier users.php.

{
// Build the request path.
$path = '?action=login';
// @TODO clear internal data as well
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiUsers::unBlockUserByID (   $id,
  $reason = null 
)

Method to unblock a user.

Paramètres:
int$idUsername, IP address or IP range you want to unblock.
string$reasonReason for unblock (optional).
Renvoie:
object
Depuis:
12.3

Définition à la ligne 330 du fichier users.php.

{
// Get the token.
$token = $this->getToken($id, 'unblock');
// Build the request path.
$path = '?action=unblock';
// Build the request data.
// TODO: $data doesn't seem to be used!
$data = array(
'id' => $id,
'token' => $token,
'reason' => $reason,
);
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiUsers::unBlockUserByName (   $user,
  $reason = null 
)

Method to unblock a user.

Paramètres:
string$userUsername, IP address or IP range you want to unblock.
string$reasonReason for unblock (optional).
Renvoie:
object
Depuis:
12.3

Définition à la ligne 299 du fichier users.php.

{
// Get the token.
$token = $this->getToken($user, 'unblock');
// Build the request path.
$path = '?action=unblock';
// Build the request data.
$data = array(
'user' => $user,
'token' => $token,
'reason' => $reason,
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}

La documentation de cette classe a été générée à partir du fichier suivant :