Code improve noalyss_user: isolate repository from db

This commit is contained in:
sparkyx 2025-08-10 18:29:07 +02:00
parent 894a77618f
commit 69b690c4cb
7 changed files with 509 additions and 102 deletions

View file

@ -34,6 +34,10 @@ require_once NOALYSS_INCLUDE.'/class/database.class.php';
require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
//
// for loading javascripts or style-sheet, it is needed to know the user
// global preference, but the user is not yet connected
// to a folder. So the Database is the repository
$g_user=new Noalyss_user(new Database());
set_language();
// load message for javascript
@ -43,6 +47,7 @@ if (isset ($_REQUEST['loadjs']) && $_REQUEST['loadjs']=='message')
include_once NOALYSS_INCLUDE."/lib/message_javascript.php";
return;
}
// Connect the user to the current folder and export file
$cn=Dossier::connect();
$g_user=new Noalyss_user($cn);
$gDossier=dossier::id();