[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 12/12: Save the current user in a PostgreSQL
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 12/12: Save the current user in a PostgreSQL session variable noalyss.user_login |
Date: |
Wed, 16 Nov 2022 14:39:21 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 1a1bcd56720403cd4ec9ef9c2d05ab6972a31d64
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Nov 14 22:35:40 2022 +0100
Save the current user in a PostgreSQL session variable noalyss.user_login
---
include/class/noalyss_user.class.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/class/noalyss_user.class.php
b/include/class/noalyss_user.class.php
index b75cbf5e1..5eb0a0c05 100644
--- a/include/class/noalyss_user.class.php
+++ b/include/class/noalyss_user.class.php
@@ -66,7 +66,7 @@ class Noalyss_User
* @brief put user_login into Postgres config (session), it can be used
for tracking users activities
* @return void
*/
- protected function set_session_var()
+ public function set_session_var()
{
$this->db->exec_sql(sprintf("select
set_config('noalyss.user_login','%s',false)",
Database::escape_string($_SESSION[SESSION_KEY.'g_user'])));
@@ -132,7 +132,11 @@ class Noalyss_User
$this->id=-1;
$this->lang=(isset($_SESSION[SESSION_KEY.'g_lang']))?$_SESSION[SESSION_KEY.'g_lang']:'fr_FR.utf8';
$this->access_mode=$_SESSION[SESSION_KEY."access_mode"];
- $cn=new Database();
+ $cn=new Database();
+
+ // share user login with the repository
+ $cn->exec_sql(sprintf("select
set_config('noalyss.user_login','%s',false)",
+ Database::escape_string($_SESSION[SESSION_KEY.'g_user'])));
if ($this->can_connect() == 0 || $this->load()==-1 )
{
- [Noalyss-commit] [noalyss] 02/12: code cleaning : rename search_poste to search_accounting, (continued)
- [Noalyss-commit] [noalyss] 02/12: code cleaning : rename search_poste to search_accounting, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 03/12: TVA javascript : add callback function, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 08/12: Set current user in PostGresql session (config) so it can be directly used directly by triggers and pgplsql to track user's changes, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 09/12: Fix typo due to code cleaning, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 06/12: Add function __toString, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 04/12: INUM , IText and ITVAPopup add the attribute (for javascript), Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 01/12: WYSIWYG Editor integration and improve of waiting_box, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 05/12: set require to falser and add function __toString, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 10/12: useless file, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 11/12: Clean code : dead code, improve debug, comments, Dany De Bontridder, 2022/11/16
- [Noalyss-commit] [noalyss] 12/12: Save the current user in a PostgreSQL session variable noalyss.user_login,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 07/12: Tag : add color when selected, Dany De Bontridder, 2022/11/16