- Correction bug [#1666] Message d'erreur lors d'une requête Ajax lorsque

l'utilisateur n'est pas (ou plus) authentifié.
This commit is contained in:
Benjamin Renard 2008-05-14 09:05:06 +00:00
parent 9b0fb18008
commit 3eeb385d90
2 changed files with 243 additions and 238 deletions

View file

@ -83,7 +83,7 @@ var LSform = new Class({
LSdebug(data);
if ( data ) {
if ( typeof(data.LSerror) != "undefined" ) {
varLSdefault.loadingImgHide();
varLSdefault.loadingImgHide(data.imgload);
varLSdefault.displayError(data.LSerror);
return;
}
@ -198,7 +198,7 @@ var LSform = new Class({
var data = Json.evaluate(responseText);
if ( data ) {
if ( typeof(data.LSerror) != "undefined" ) {
varLSdefault.loadingImgHide();
varLSdefault.loadingImgHide(data.imgload);
varLSdefault.displayError(data.LSerror);
return;
}
@ -236,7 +236,7 @@ var LSform = new Class({
var data = Json.evaluate(responseText);
if ( data ) {
if ( typeof(data.LSerror) != "undefined" ) {
varLSdefault.loadingImgHide();
varLSdefault.loadingImgHide(data.imgload);
varLSdefault.displayError(data.LSerror);
return;
}

View file

@ -7,10 +7,11 @@ $GLOBALS['LSsession'] = new LSsession();
if ($_REQUEST['template'] != 'login') {
if ( !$GLOBALS['LSsession'] -> startLSsession() ) {
echo json_encode(array('LSerror' => 'LSsession : Impossible d\'initialiser la LSsession.' ));
$_ERRORS = 'LSsession : Impossible d\'initialiser la LSsession.';
}
}
$data=NULL;
if (!isset($_ERRORS)) {
switch($_REQUEST['template']) {
case 'login':
switch($_REQUEST['action']) {
@ -306,10 +307,14 @@ switch($_REQUEST['template']) {
}
break;
}
}
if ($GLOBALS['LSerror']->errorsDefined()) {
$data['LSerror'] = $GLOBALS['LSerror']->getErrors();
}
else if (isset($_ERRORS)) {
$data['LSerror'] = $_ERRORS;
}
if (isset($_REQUEST['imgload'])) {
$data['imgload'] = $_REQUEST['imgload'];