From b2535c5d38bedaf714a9982478bd65d45f964ccf Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 10 Feb 2022 12:37:12 +0100 Subject: [PATCH] MySQL rolePrefix fix --- debian/changelog | 2 +- package.json | 2 +- web/service.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6bb16051..8f7a5d2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.407.57) stable; urgency=low +hedera-web (1.407.58) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 4b71c84d..39aaa773 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.407.57", + "version": "1.407.58", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/web/service.php b/web/service.php index e16dfe45..70e22a4b 100644 --- a/web/service.php +++ b/web/service.php @@ -231,7 +231,7 @@ abstract class Service { return $this->userDb; $row = $this->db->getObject( - 'SELECT r.name, rc.mysqlPassword, uc.loginKey + 'SELECT r.name, rc.mysqlPassword, rc.rolePrefix, uc.loginKey FROM account.user u JOIN account.role r ON r.id = u.role JOIN account.roleConfig rc ON TRUE @@ -240,7 +240,7 @@ abstract class Service { [$user] ); - $userName = "z-{$row->name}"; + $userName = "{$row->rolePrefix}{$row->name}"; $password = base64_decode($row->mysqlPassword); $userDb = $this->app->createConnection($userName, $password, TRUE);