Merge branch 'master' into hotfix-Ticket-#097414-traducción-meensaje-de-error
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Andrés 2023-06-20 12:01:38 +00:00
commit 59242daa79
3 changed files with 2 additions and 42 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (23.6.10) stable; urgency=low
hedera-web (23.6.11) stable; urgency=low
* Initial Release.

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "23.6.10",
"version": "23.6.11",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -1,40 +0,0 @@
<?php
class Account {
static function trySync($db, $userName, $password = NULL) {
$sync = $db->getValue(
'SELECT COUNT(*) > 0 FROM account.userSync WHERE name = #',
[$userName]
);
if ($sync)
self::sync($db, $userName, $password);
}
static function sync($db, $userName, $password = NULL) {
$bcryptPassword = password_hash($password, PASSWORD_BCRYPT);
$userId = $db->getValue(
'SELECT id FROM account.user WHERE `name` = #',
[$userName]
);
$db->query(
'UPDATE account.user SET
bcryptPassword = #
WHERE id = #',
[$bcryptPassword, $userId]
);
$hasAccount = $db->getValue(
'SELECT COUNT(*) > 0
FROM account.user u
JOIN account.account a ON u.id = a.id
WHERE u.name = #',
[$userName]
);
if (!$hasAccount)
$db->query('DELETE FROM account.userSync WHERE name = #',
[$userName]
);
}
}