Code quality : use as often as possible global $g_user instead of recreating a new User object
This commit is contained in:
parent
d86a5d4a44
commit
652cf8d4c7
50 changed files with 221 additions and 255 deletions
|
|
@ -2,10 +2,11 @@
|
|||
require_once ("class_database.php");
|
||||
require_once 'class_user.php';
|
||||
$cn=new Database($_GET['gDossier']);
|
||||
$user=new User($cn);
|
||||
$user->Check();
|
||||
$user->check_dossier($_GET['gDossier']);
|
||||
$res=$cn->exec_sql("select code,description from get_profile_menu($1) where code ~* $2 or description ~* $3 limit 8",array($user->login,$_POST['acs'],$_POST['acs']));
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
$g_user->Check();
|
||||
$g_user->check_dossier($_GET['gDossier']);
|
||||
$res=$cn->exec_sql("select code,description from get_profile_menu($1) where code ~* $2 or description ~* $3 limit 8",array($g_user->login,$_POST['acs'],$_POST['acs']));
|
||||
$nb=Database::num_row($res);
|
||||
echo "<ul>";
|
||||
for ($i = 0;$i< $nb;$i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue