Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Security API > Methods

Security API: currentUserData

Scroll Prev Next More

 

Returns an array with the current user data from the Login table.

Syntax

Security::currentUserData()

Arguments

No arguments.

Return value

Returns an array with the current user data from the Login table.

 

Note: this function stores data in session variables to avoid querying the database every time it is called. Which means that if login table was update behind the scene this function will not show the most fresh data.

To ensure that a fresh copy of the data is retrieved call Security::refreshUserdata()  first.

Example

This example shows how to output the current user data:

 

$userData = Security::currentUserData();
print_r($userData );

Sample output

Array
(
   [ID] => 1
   [username] => admin
   [password] => admin
   [email] => no
   [fullname] => John
   
)

See also:

Security API: getUserData

Security screen: Security settings

About Security API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software