noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 30/86: RECONCILE : remove direct access to


From: dwm
Subject: [Noalyss-commit] [noalyss] 30/86: RECONCILE : remove direct access to
Date: Thu, 19 Sep 2024 02:41:51 -0400 (EDT)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit 2cd3b8f35b7fa107976da12f69fc1df9ed788b6c
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Sep 4 22:02:00 2024 +0200

    RECONCILE : remove direct access to
---
 include/impress_rec.inc.php | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/include/impress_rec.inc.php b/include/impress_rec.inc.php
index fbd85718b..b8fba55dd 100644
--- a/include/impress_rec.inc.php
+++ b/include/impress_rec.inc.php
@@ -23,9 +23,9 @@
  * \brief print the all the operation reconciled or not, with or without the 
same amount
  */
 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
-require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
-global $g_user;
 
+global $g_user;
+$http=new HttpInput();
 /**
  *@file
  */
@@ -44,12 +44,21 @@ echo '<br/>';
 /*
  * Limit by date, default current exercice
  */
-list($start,$end)=$g_user->get_limit_current_exercice();
+$error=0;
 $dstart=new IDate('p_start');
-$dstart->value=(isset($_REQUEST['p_start']))?$_REQUEST['p_start']:$start;
-
 $dend=new IDate('p_end');
-$dend->value=(isset($_REQUEST['p_end']))?$_REQUEST['p_end']:$end;
+list($start,$end)=$g_user->get_limit_current_exercice();
+
+try {
+    $dstart->value=$http->request('p_start','date',$start);
+
+    $dend->value=$http->request('p_end','date',$end);
+
+} catch (\Exception $e) {
+    echo_warning('Date invalide');
+    $error=1;
+
+}
 
 echo "Opérations entre ".$dstart->input()." jusque ".$dend->input();
 echo '<ol style="list-style-type:none;">';
@@ -82,6 +91,7 @@ echo '</div>';
 echo '</div>';
 echo '<div class="content">';
 if ( ! isset($_GET['vis'])) return;
+if ($error == 1) return;
 $acc_reconciliation=new Acc_Reconciliation($cn);
 $acc_reconciliation->a_jrn=$r_jrn;
 $acc_reconciliation->start_day=$dstart->value;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]