Plugin/Gebeurtenissen/Gebruiker
From Joomla! Documentation
< Plugin | Events
In een standaard Joomla installatie hebben we een aantal vooraf gedefineerde gebruiker gebeurtenissen die, wanneer geactiveerd, functies oproepen in de bijbehorende plugins.
onUserLogin
Beschrijving
Deze gebeurtenis wordt geactiveerd nadat de gebruiker is geverifieerd in het Joomla! gebruikersbestand.
Als het nodig is om de login-procedure (verificatie) af te breken, dan zult u de onUserAuthenticate in plaats daarvan moeten gebruiken.
Parameters
- $user - een associatirve array van het JAuthenticateResponse type (zie link voor array keys)
- $options - een associatieve array die de volgende sleutels bevat: ["remember"] => bool, ["return"] => string, ["entry_url"] => string
Return waarde
Boolean
Gebruikt in bestanden
- libraries/joomla/application/application.php
- plugins/user/joomla.php
Voorbeeld
- plugins/user/example.php
onUserLogout
Beschrijving
Dit evenement wordt gestart vóór de gebruiker is afgemeld van het systeem.
Als een plugin false retourneert zal het algemene uitloggen mislukken en de onUserLogoutFailure event wordt geactiveerd; als dit lukt zal het onUserAfterLogout event worden geactiveerd.
NOTE: as of 3.3.6, returning false does not work correctly, because stock components perform their logout operation during the onUserLogout event. So even if your plugin returns false, the stock ones have already run anyway. Thus, the user will be "mostly" logged out even if you return false. There is no actual way to cleanly abort logout.
Parameters
- $credentials - an associative array containing these keys: ["username"] => string, ["id"] => int
- $options - an associative array containing this key: ["clientid"] => int
Return waarde
Boolean
Used in files
- libraries/cms/application/cms.php
- plugins/user/joomla/joomla.php
- plugins/system/logout.php
- plugins/system/remember/remember.php
Voorbeeld
- plugins/user/example.php
onUserAuthenticate
Description
This event is triggered to verify that a set of login credentials is valid.
Parameters
Array of credentials. Structure:\\ ['username']\\ ['password']\\ Alternative authentication mechanisms can supply additional credentials.
Return Value
An array of JAuthenticateResponse objects detailing the results of each called plugin, including success or failure.
Gebruikt in bestanden
- libraries/joomla/user/authentication.php
- plugins/authentication/gmail.php
- plugins/authentication/joomla.php
- plugins/authentication/ldap.php
Voorbeeld
- plugins/authentication/example.php
onUserLoginFailure
Beschrijving
Deze gebeurtenis wordt geactiveerd wanneer een gebruiker authenticatie-aanvraag is mislukt door een plugin.
Parameters
Two parameters. The credentials array for the user (see onAuthenticate), and the JAuthenticateResponse that caused the failure.
Return Value
Unknown. The return value appears to be ignored in any case.
Gebruikt in bestand
- libraries/joomla/application/user/authentication.php
onUserAfterLogin
Beschrijving
Deze gebeurtenis wordt geactiveerd wanneer een gebruiker succesvol is ingelogd.
Parameters
Options is array with:
- remember
- return
- entry_url
- action
- user - JUser Object
- responseType
Retourwaarde
Boolean
Gebruikt in bestanden
- libraries/legacy/application/application.php
- libraries/cms/application/cms.php
- plugins/authentication/cookie/cookie.php
onUserBeforeSave
Description
This event is triggered before an update of a user record.
De oude en de nieuwe gebruiker parameters worden aangeboden; veel gebruikte leden zijn: gebruikersnaam, naam, e-mailadres, wachtwoord, wachtwoord_wissen.
The password array entry is the hashed password value. If the user has just changed the password, you may retrieve the cleartext password from $newUser['password_clear']. (It will be set to "" if the password has not been changed.)
Parameters
- $oldUser - An associative array of the columns in the user table (current values).
- $isnew - Boolean to identify if this is a new user (true - insert) or an existing one (false - update)
- $newUser - An associative array of the columns in the user table (new values).
Return Value
Boolean. Whether the user-save should proceed or not. Any plugin that returns false aborts the save.
Gebruikt in bestand
- libraries/joomla/user/user.php
Voorbeeld
- plugins/user/example.php
onUserAfterSave
Description
This event is triggered after an update of a user record, or when a new user has been stored in the database.
Password in $user array is already hashed at this point. You may retrieve the cleartext password using $_POST['password'].
Parameters
- $user - An associative array of the columns in the user table.
- $isnew - Boolean to identify if this is a new user (true - insert) or an existing one (false - update)
- $success - Boolean to identify if the store was successful
- $msg - Error message if store failed
Note: The old values that were just updated are not available here or afterwards. In case you need the old values, use onBeforeStoreUser().
Retourwaarde
Geen
Gebruikt in bestand
- libraries/joomla/user/user.php
Voorbeeld
- plugins/user/example.php
onUserBeforeDelete
Beschrijving
De gebeurtenis wordt geactiveerd wanneer een gebruiker wordt verwijderd uit het systeem.
Parameters
- $user - Een associatieve array van de kolommen in de user tabel.
Retourwaarde
Geen.
Gebruikt in bestanden
- libraries/joomla/user/user.php
- plugins/user/joomla.php
Voorbeeld
- plugins/user/example.php
onUserAfterDelete
Beschrijving
De gebeurtenis wordt geactiveerd wanneer een gebruiker verwijderd is uit het systeem.
Parameters
- $user - An associative array of the columns in the user table.
- $succes - Boolean to identify if the deletion was successful
- $msg - Error message if delete failed (JError object detailing the error, if any)
Retourwaarde
Geen.
Used in files
- libraries/joomla/user/user.php
- plugins/user/joomla.php
Voorbeeld
- plugins/user/example.php