2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Use builtin sha256 function

This commit is contained in:
Adam Zammit
2023-04-26 14:53:51 +10:00
parent e81372bbca
commit fb74ee3c65
5 changed files with 5 additions and 497 deletions

View File

@@ -93,8 +93,7 @@ if (isset($_POST['client']) && !empty($_POST['client']))
/* rewrite 'password' only if not blank in edit mode */
if (isset($_GET['edit']) && $_GET['edit'] >0 && isset($_POST['password']) && !empty($_POST['password'])) {
include_once("../include/sha256.php");
$sql .=",`password` = '" . SHA256::hashing($_POST['password']) . "'";
$sql .=",`password` = '" . hash('sha256',$_POST['password']) . "'";
}
$sql .= "WHERE `uid` = $uid";
@@ -111,11 +110,9 @@ if (isset($_POST['client']) && !empty($_POST['client']))
if ($db->Execute($sql)) {
include_once("../include/sha256.php");
//Insert into lime_users
$sql = "INSERT INTO users (`users_name`,`password`,`full_name`,`superadmin`,`email`)
VALUES ($client, '" . SHA256::hashing($_POST['password']) . "', $firstname ,0,$email)";
VALUES ($client, '" . hash('sha256',$_POST['password']) . "', $firstname ,0,$email)";
if ($db->Execute($sql)) $a = T_("Added") . ": " . $client; else $a = T_("Error adding client");
}