From 2a0971c89b4874dbccb722692209ac052f5d0590 Mon Sep 17 00:00:00 2001 From: Stan Pinte Date: Mon, 21 Mar 2005 09:34:22 +0000 Subject: [PATCH] Debugged use of global vars. --- AUTHORS | 1 + html/jrn_detail.php | 8 +------- html/priv_user.php | 9 +++++---- html/sec_pdf.php | 40 +++++++++++++++++++++++++++++++++++++ html/user_jrn.php | 5 +++++ include/user_action_fin.php | 7 ++----- scripts/add-db.sh | 6 +++++- 7 files changed, 59 insertions(+), 17 deletions(-) create mode 100755 html/sec_pdf.php diff --git a/AUTHORS b/AUTHORS index 20a8b81a8..5043b4e39 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1,2 @@ Dany De Bontridder dany.debontridder@yahoo.fr +Stan Pinte stanpinte@sauvages.be diff --git a/html/jrn_detail.php b/html/jrn_detail.php index b363b6648..0510219a8 100644 --- a/html/jrn_detail.php +++ b/html/jrn_detail.php @@ -110,13 +110,7 @@ $Res=ExecSql($cn,"select jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,". " from jrn_def where". " jrn_def_id=".$_SESSION['g_jrn']); $l_line=pg_fetch_array($Res,0); -if ( isset ($_GET["PHPSESSID"] ) ) { - $sessid=$_GET["PHPSESSID"]; -} -if ( isset ($_POST["PHPSESSID"] ) ) { - $sessid=$_POST["PHPSESSID"]; -} - +$sessid = $_REQUEST['PHPSESSID']; $search='"; echo '
'; echo '

Fiches

'; diff --git a/html/priv_user.php b/html/priv_user.php index 750d551a3..1fc83fee8 100644 --- a/html/priv_user.php +++ b/html/priv_user.php @@ -75,12 +75,13 @@ if ( isset ( $reset_passwd) ){ $Res=ExecSql($cn, "update ac_users set use_pass='$l_pass' where use_id=$uid"); echo '

Password remis à phpcompta

'; } -if ( isset ($SAVE) ){ +if ( isset ($_POST['SAVE']) ){ + $uid = $_POST['UID']; echo_debug(__FILE__,__LINE__,"SAVE is set"); // Update User $cn=DbConnect(); - $Sql="update ac_users set use_first_name='".$fname."', use_name='".$lname."' - ,use_login='".$login."',use_active=".$Actif.",use_admin=".$Admin." where + $Sql="update ac_users set use_first_name='".$_POST['fname']."', use_name='".$_POST['lname']."' + ,use_login='".$_POST['login']."',use_active=".$_POST['Actif'].",use_admin=".$_POST['Admin']." where use_id=".$uid; $Res=ExecSql($cn,$Sql); // Update Priv on Folder @@ -218,7 +219,7 @@ foreach ( $Dossier as $rDossier) { - + diff --git a/html/sec_pdf.php b/html/sec_pdf.php new file mode 100755 index 000000000..46f47b711 --- /dev/null +++ b/html/sec_pdf.php @@ -0,0 +1,40 @@ +selectFont('./addon/fonts/Helvetica.afm'); + +$pdf->ezText("hello",12,array('justification'=>'right')); +$pdf->ezStream(); + +?> diff --git a/html/user_jrn.php b/html/user_jrn.php index d50e79ef9..0efabfff9 100644 --- a/html/user_jrn.php +++ b/html/user_jrn.php @@ -105,6 +105,11 @@ if ( isset ($_GET['JRN_TYPE'] ) ) { echo '
'; } +if ( $jrn_type=='FIN' ) +{ + //show balance of all bank accounts. Let's say their ID start with 5500 +} + // if a journal is selected show the journal's menu if ( $_SESSION['g_jrn'] != -1 ) { $result=ShowJrn( "user_jrn.php?JRN_TYPE=".$jrn_type); diff --git a/include/user_action_fin.php b/include/user_action_fin.php index d9e601702..329a53d01 100644 --- a/include/user_action_fin.php +++ b/include/user_action_fin.php @@ -25,11 +25,8 @@ include_once("class_widget.php"); // phpinfo(); $cn=DbConnect($_SESSION['g_dossier']); -if ( ! isset ($_GET['action']) && ! isset ($_POST["action"]) ) { - // echo u_ShowMenuJrn($cn,$jrn_type); - exit; - - return; +if ( ! isset ($_GET['action']) && ! isset ($_POST["action"]) ) { + return; } include_once ("preference.php"); include_once ("user_common.php"); diff --git a/scripts/add-db.sh b/scripts/add-db.sh index 656b11968..477a1f297 100755 --- a/scripts/add-db.sh +++ b/scripts/add-db.sh @@ -1,7 +1,11 @@ NR_DOSSIER=$1 BACKUP_FILE=$2 +USER_NAME=$3 dropdb -h localhost -U phpcompta dossier$NR_DOSSIER createdb -h localhost -U phpcompta dossier$NR_DOSSIER psql -h localhost -U phpcompta dossier$NR_DOSSIER -f $BACKUP_FILE -psql -h localhost -U phpcompta --command "INSERT INTO ac_users (use_login, use_active, use_pass, use_admin, use_usertype) VALUES ('stan', 1, md5('plogastel'), 1, 'user')" account_repository +psql -h localhost -U phpcompta -f html/admin/sql/patch/upgrade4.sql dossier$NR_DOSSIER +psql -h localhost -U phpcompta --command "INSERT INTO ac_users (use_login, use_active, use_pass, use_admin, use_usertype) VALUES ('$USER_NAME', 1, md5('plogastel'), 1, 'user')" account_repository psql -h localhost -U phpcompta --command "INSERT INTO ac_dossier (dos_id, dos_name, dos_description) VALUES ($NR_DOSSIER, 'Sauvages', 'Comptabilité Sauvages SPRL')" account_repository +psql -h localhost -U phpcompta --command "INSERT INTO jnt_use_dos (use_id, dos_id) SELECT use_id,$NR_DOSSIER from ac_users WHERE use_login='$USER_NAME'" account_repository +