diff --git a/html/admin_repo.php b/html/admin_repo.php
index 3ec416b79..d41d5fd89 100644
--- a/html/admin_repo.php
+++ b/html/admin_repo.php
@@ -25,7 +25,10 @@ include_once("debug.php");
html_page_start($g_UserProperty['use_theme']);
echo_debug(__FILE__,__LINE__,"entering admin_repo");
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
if ($g_UserProperty['use_admin'] != 1) {
html_page_stop();
return;
@@ -132,11 +135,14 @@ $template="";
// show all dossiers
if ( $Res != null ) {
- echo "
';
+ echo '
';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
diff --git a/html/show_tva.php b/html/show_tva.php
index 1beaa01f6..73745f3d0 100644
--- a/html/show_tva.php
+++ b/html/show_tva.php
@@ -23,7 +23,10 @@ include_once ("ac_common.php");
html_page_start($g_UserProperty['use_theme']);
include_once ("postgres.php");
/* Admin. Dossier */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
if ( ! isset ( $g_dossier ) ) {
echo "You must choose a Dossier ";
diff --git a/html/stock.php b/html/stock.php
index b2813b650..33dd66837 100644
--- a/html/stock.php
+++ b/html/stock.php
@@ -34,7 +34,10 @@ if ( ! isset ( $g_dossier ) ) {
}
include_once ("postgres.php");
/* Admin. Dossier */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
// Synchronize rights
SyncRight($g_dossier,$g_user);
@@ -168,4 +171,4 @@ if ( $a != null ) {
}
echo '
';
html_page_stop();
-?>
\ No newline at end of file
+?>
diff --git a/html/style-light.css b/html/style-light.css
index e1ae38ea1..5aa0089b3 100644
--- a/html/style-light.css
+++ b/html/style-light.css
@@ -100,12 +100,22 @@ div.debit{
border-style:solid;
border-width:1pt;
}
+div.recherche{
+ position: absolute;
+ top:100px;
+ left:100px;
+ width:700px;
+ font-size:9px;
+ font-family:sans-serif;
+
+}
div.redcontent{
position: absolute;
- top:150px;
+ top:100px;
left:250px;
- width:600px;
- font-size:12px;
+ width:700px;
+ font-size:9px;
+ font-family:sans-serif;
}
div.u_redcontent{
@@ -113,7 +123,8 @@ div.u_redcontent{
top:130px;
left:150px;
width:700px;
- font-size:9pt;
+ font-size:9px;
+ font-family:sans-serif;
}
div.ccontent{
diff --git a/html/test.php b/html/test.php
index b01bfdc8f..ab6666849 100644
--- a/html/test.php
+++ b/html/test.php
@@ -58,11 +58,6 @@ foreach (array('magic_quotes_gpc','magic_quotes_runtime') as $a) {
}
}
-if ( ini_get('register_globals') != true )
- print ("
register_globals has a bad value !!!
");
- else
- print 'register_globals : Ok
';
-
if ( ereg("\.\.\/include",ini_get('include_path')) == false )
print ("
include_path incorrect !!!".ini_get('include_path')."
");
else
diff --git a/html/user_advanced.php b/html/user_advanced.php
index 9b55fd35b..590196d94 100644
--- a/html/user_advanced.php
+++ b/html/user_advanced.php
@@ -28,12 +28,21 @@ if ( ! isset ( $g_dossier ) ) {
}
include_once ("postgres.php");
/* Admin. Dossier */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
include_once ("postgres.php");
echo_debug(__FILE__,__LINE__,"user is $g_user");
-/* CheckUser */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
// We don't check permissions here in fact, permission are tested in the
// functions
diff --git a/html/user_compta.php b/html/user_compta.php
index f5cc66519..cc6b2a681 100644
--- a/html/user_compta.php
+++ b/html/user_compta.php
@@ -35,8 +35,14 @@ if ( isset ( $dos ) ) {
}
include_once ("postgres.php");
echo_debug(__FILE__,__LINE__,"user is $g_user");
-/* CheckUser */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
// Synchronize rights
SyncRight($g_dossier,$g_user);
diff --git a/html/user_login.php b/html/user_login.php
index 88dfaf48b..346eca329 100644
--- a/html/user_login.php
+++ b/html/user_login.php
@@ -20,7 +20,10 @@
// $Revision$
include_once ("ac_common.php");
include_once("postgres.php");
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
html_page_start($g_UserProperty['use_theme']);
include_once("user_menu.php");
//u_ShowMenu($g_UserProperty['use_admin']);
diff --git a/html/user_pref.php b/html/user_pref.php
index 9bfbdf15c..075adb676 100644
--- a/html/user_pref.php
+++ b/html/user_pref.php
@@ -46,7 +46,10 @@ if ( isset ($g_jrn) ) {
}
/* Admin. Dossier */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
// show the top menu depending of the use_style
// comta style
diff --git a/html/user_sec.php b/html/user_sec.php
index df53cfb4a..dc21f2267 100644
--- a/html/user_sec.php
+++ b/html/user_sec.php
@@ -28,7 +28,10 @@ if ( ! isset ( $g_dossier ) ) {
}
include_once ("postgres.php");
/* Admin. Dossier */
-CheckUser();
+$rep=DbConnect();
+include_once ("class_user.php");
+$User=new cl_user($rep);
+$User->Check();
include_once ("top_menu_compta.php");
ShowMenuCompta($g_dossier,$g_UserProperty);
diff --git a/include/compta_menu.php b/include/compta_menu.php
index d4597e233..9e7b9b29f 100644
--- a/include/compta_menu.php
+++ b/include/compta_menu.php
@@ -108,9 +108,12 @@ function c_ShowMenuJrnUser($p_dossier,$p_user)
echo '
';
include_once("postgres.php");
+ include_once("class_user.php");
+
$l_jrn=sprintf("dossier%d",$p_dossier);
$Cn=DbConnect($l_jrn);
- if ( CheckAdmin() ==0) {
+ $User=new cl_user($Cn);
+ if ( $User->Admin() ==0) {
$Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
jrn_deb_max_line,jrn_cred_max_line
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
@@ -131,7 +134,7 @@ function c_ShowMenuJrnUser($p_dossier,$p_user)
for ($i=0;$i<$Max;$i++) {
$l_line=pg_fetch_array($Ret,$i);
// Admin have always rights
- if ( CheckAdmin() == 0 ){
+ if ( $User->Admin() == 0 ){
$right=CheckJrn($p_dossier,$p_user,$l_line['jrn_def_id']);
}else {
$right=3;
diff --git a/include/postgres.php b/include/postgres.php
index 7af2eea8a..61aca6066 100644
--- a/include/postgres.php
+++ b/include/postgres.php
@@ -31,7 +31,7 @@
* Automatically redirect
*
++*/
-function CheckUser()
+/* obsolete function CheckUser()
{
global $g_user,$g_pass,$IsValid;
echo_debug(__FILE__,__LINE__,"CheckUser");
@@ -66,6 +66,7 @@ function CheckUser()
return $ret;
}
+*/
/*++
* function : ShowDossier
* Parameter : p_type string : all for all dossiers lim for only the
@@ -75,7 +76,7 @@ function CheckUser()
* Show the folder where user have access
++*/
function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) {
- global $g_user;
+ $l_user=$_SESSION['g_user'];
if ( $p_max == 0 ) {
$l_step="";
} else {
@@ -90,7 +91,7 @@ function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) {
natural join ac_dossier
natural join ac_users
inner join priv_user on priv_jnt=jnt_id where
- use_login='".$g_user."' and priv_priv !='NO'
+ use_login='".$l_user."' and priv_priv !='NO'
order by dos_name ";
$p_Num=CountSql($cn,$l_sql);
}
@@ -110,13 +111,15 @@ function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) {
}
// Check if the user has admin right
// to be complete
-function CheckAdmin() {
- global $g_user,$g_pass;
+/* obsolete function CheckAdmin() {
+ $l_user=$_SESSION($g_user);
+ $l_pass=$_SESSION($g_pass);
+
$res=0;
- if ( $g_user != 'phpcompta') {
- $pass5=md5($g_pass);
- $sql="select use_id from ac_users where use_login='$g_user'
+ if ( $l_user != 'phpcompta') {
+ $pass5=md5($l_pass);
+ $sql="select use_id from ac_users where use_login='$l_user'
and use_active=1 and use_admin=1 and use_pass='$pass5'";
$cn=DbConnect();
@@ -126,6 +129,8 @@ function CheckAdmin() {
return $isAdmin;
}
+*/
+
/* function DbConnect
* purpose : connect to the database
* parameter : p_db : db_name
@@ -407,4 +412,4 @@ function GetArray($p_cn,$p_sql) {
echo_debug(__FILE__,__LINE__,var_export($array,true));
return $array;
}
-?>
\ No newline at end of file
+?>
diff --git a/include/top_menu_compta.php b/include/top_menu_compta.php
index 67cb51b4a..79c5ff1d0 100644
--- a/include/top_menu_compta.php
+++ b/include/top_menu_compta.php
@@ -145,7 +145,7 @@ function ShowMenuComptaRight($p_dossier=0,$p_auser,$p_more="")
* - none
*
*/
-function ShowMenuAdminGlobalRight($p_dossier=0)
+/* obsolete function ShowMenuAdminGlobalRight($p_dossier=0)
{
include_once("ac_common.php");
echo '
";
echo '
';
}
+*/
/* function ShowMenuPcmn($p_start=1)
* Purpose : Show the menu from the pcmn page
*
diff --git a/include/user_menu.php b/include/user_menu.php
index 8fc32f095..2af38e69f 100644
--- a/include/user_menu.php
+++ b/include/user_menu.php
@@ -232,6 +232,7 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn)
{
include_once ("debug.php");
include_once("constant.php");
+ include_once("class_user.php");
echo_debug(__FILE__,__LINE__,"U_SHOWMENUJRNUSER PTYPE=$p_type");
// echo '