LSsession :

- Add subDnIsEnabled() function and use it in getSubDnLdapServer()
  - Add debuging support for smarty
  - Change in the detection of the session for safety
This commit is contained in:
Benjamin Renard 2009-10-25 23:34:06 +00:00
parent 58e8bed57d
commit 8e498f34fa
2 changed files with 26 additions and 9 deletions

View file

@ -137,6 +137,10 @@ class LSsession {
$GLOBALS['Smarty'] -> force_compile = TRUE;
// recompile template if it is changed
$GLOBALS['Smarty'] -> compile_check = TRUE;
if (isset($_REQUEST['debug_smarty'])) {
// debug smarty
$GLOBALS['Smarty'] -> debugging = true;
}
}
$GLOBALS['Smarty'] -> assign('LS_CSS_DIR',LS_CSS_DIR);
@ -439,7 +443,7 @@ class LSsession {
$_POST['LSsession_user'] = 'a determiner plus tard';
}
if(isset($_SESSION['LSsession'])) {
if(isset($_SESSION['LSsession']['dn'])) {
// Session existante
self :: $topDn = $_SESSION['LSsession']['topDn'];
self :: $dn = $_SESSION['LSsession']['dn'];
@ -845,6 +849,21 @@ class LSsession {
}
}
/**
* Use this function to know if subDn is enabled for the curent LdapServer
*
* @retval boolean
**/
public static function subDnIsEnabled() {
if (!isset(self :: $ldapServer['subDn'])) {
return;
}
if ( !is_array(self :: $ldapServer['subDn']) ) {
return;
}
return true;
}
/**
* Retourne les sous-dns du serveur Ldap courant
*
@ -854,10 +873,7 @@ class LSsession {
if (self :: cacheSudDn() && isset(self :: $_subDnLdapServer[self :: $ldapServerId])) {
return self :: $_subDnLdapServer[self :: $ldapServerId];
}
if (!isset(self :: $ldapServer['subDn'])) {
return;
}
if ( !is_array(self :: $ldapServer['subDn']) ) {
if (!self::subDnIsEnabled()) {
return;
}
$return=array();
@ -1981,10 +1997,9 @@ class LSsession {
LSerror :: defineError('LSsession_04',
_("LSsession : Failed to load LSobject type %{type} : unknon type.")
);
// no longer used
/*LSerror :: defineError(1005,
_("LSsession : Object type use for authentication is unknow (%{type}).")
);*/
LSerror :: defineError('LSsession_05',
_("LSsession : Failed to load LSclass %{class}.")
);
LSerror :: defineError('LSsession_06',
_("LSsession : Login or password incorrect.")
);

View file

@ -8,6 +8,8 @@
<div id='LSdebug_txt'>{if $LSdebug != ''}{$LSdebug}{/if}</div>
<div id="_smarty_console"></div>
<div id='LSlang_select'>
{foreach from=$LSlanguages item=lang}
<img src='{$LS_IMAGES_DIR}/{$lang}.png' alt='{$lang}' title='{$lang}'/>