Back to the module list

Authentication of the user

In the index.php page of the project, create the few lines :

require ("domframework/authentication.php");
$route = new \route;
$authentication = new \authentication ($route);
$authentication->appName = "Application !";
$authentication->authMethods = array ("ldap");
$authentication->authServers = array ("authldap"=>array (
                                       ),
);
$authentication->routes ();
');

In the REST part, add :

$route->output = "rest";
$route->viewClass =\'\views\rest\';
try
{
  $authREST = $authentication->verifAuthREST ();
}
catch (Exception $e)
{
  $route->error ($e);
}
');

In the HTML part, add :

$route->output = "html";
$route->viewClass =\'\views\general\';
try
{
  $authHTML = $authentication->verifAuthHTML ();
}
catch (Exception $e)
{
  $route->error ($e);
}
');