diff --git a/ecrire/inc_session.php3 b/ecrire/inc_session.php3
index 7f9f75e3390257ce67f2c1e845bfae72edf2ae39..acacb13dad6aa48c695fed666eae99d7865d21f7 100644
--- a/ecrire/inc_session.php3
+++ b/ecrire/inc_session.php3
@@ -183,6 +183,7 @@ function verifier_php_auth() {
 	global $PHP_AUTH_USER, $PHP_AUTH_PW;
 	if ($PHP_AUTH_USER && $PHP_AUTH_PW) {
 		include_ecrire("inc_connect.php3"); // uniquement si appel depuis espace public
+		if (!$GLOBALS['db_ok']) return;
 		$login = addslashes($PHP_AUTH_USER);
 		$result = spip_query("SELECT * FROM spip_auteurs WHERE login='$login'");
 		$row = mysql_fetch_array($result);