Latest articles
Latest articles of category




User Authentication


In this section it is described the variables that store the necessary information for the users statuses.

Admin User

The variable $admin holds the information if the user is admin.

Example Smarty code
 
{if $admin eq 1}
     The user is administrator
{/if}

Example PHP code
 
if($session->isAdmin())
{  
     $admin = 1;
}

Returned Variables
 
1 - Administrator
0 - User

LDAP

If you have installed the LDAP module, the authentication is taken place through this functionality.

Example PHP Code
 
$loginLdap = $_SESSION['loginLdap'];

$usernameLdap = $_SESSION['usernameLdap'];

Example Smarty Code

{$loginLdap}

{$usernameLdap}


Returned Variables
 
0 - User is not logged in

1 - User is logged in

The username of the user under LDAP

- The $forCheckLdap holds the information if the LDAP module is installed and enabled.

Example PHP Code
 
if($forCheckLdap=='1')
{
  //do something
}

Returned Variables
 
0 - LDAP is not installed or enabled

1 - LDAP is installed and enabled

- The $loginLdap holds the information if the user is logged in or not

Example PHP Code
 
if($loginLdap=='1')
{
  // do something
}

Returned Variables
 
0 - The user is not logged in

1 - The user is logged in

- The $adminLdap holds the information if the user that is logged in under LDAP is Administrator

Example PHP Code
 
if($adminLdap =='1')
{
  //do something
}

Returned Variables
 
0 - User

1 - Administrator

- The $suAuthorsLdap holds the information if the user that is logged in under LDAP is Super Author

Example PHP Code
 
if($suAuthorsLdap)
{
  // do something
}

Returned Variables
 
0 - User

1 - Super Authors level

- The $authorsLdap holds the information if the user that is logged in under LDAP is Author

Example PHP Code
 
if($authorsLdap=='1')
{
   // do something
}

Returned Variables
 
0 - User

1 - Authors level

Page 2

Posted on: 23/03/2011