Latest articles
Latest articles of category




User Authentication


Login User

The variable $login holds the information if user is logged in or not.
Example Smarty code
 
{if $login eq 1}
        The user is logged in
{/if}

Example PHP code
 
if($session->logged_in)
{
    $login = 1;
}
else
{
    $login = 0;
}


Returned Variables
 
1 - Logged in user
0 - Guest

If the user is logged in, we can retrieve the username by using the variable $username
Example Smarty code
 
{$username}

Example PHP code
 
$username = $session->username;

Returned Variables
 
Returns the username of the logged in user

User Level

The variable $userlevel holds the information of user's level.

By default there are available the following user levels and cannot by changed as it is necessary for the core functionality of CMS.
 
- Users
- Authors
- Super Authors
- Administrators

Example Smarty Code
 
{$userlevel}

{$userlevel_name}

Example PHP Code

Getting the id of the user level:
 
$userlevel = $session->userlevel;

Getting the name of the user level:
 
$userlevel_name

Returned Variables
 
1 - Administrators
2 - Users
3 - Super Authors
4 - Authors

Page 1

Posted on: 23/03/2011