Skip to content
Snippets Groups Projects
Commit 67d4867f authored by Iqbal's avatar Iqbal
Browse files

Added decrypting function.

parent 848490b1
No related merge requests found
...@@ -39,9 +39,11 @@ class User { ...@@ -39,9 +39,11 @@ class User {
public static function GetAllUsernameAndPassword(PDO $conn) { public static function GetAllUsernameAndPassword(PDO $conn) {
try { try {
include('../controller/Controller.php');
$users = $conn->query("SELECT username, password FROM user")->fetchAll(); $users = $conn->query("SELECT username, password FROM user")->fetchAll();
foreach ($users as $record) { foreach ($users as $record) {
$result[$record['username']] = $record['password']; $result[$record['username']] = simpleCrypt($record['password'], 'd');
} }
return $result; return $result;
} catch (PDOException $e) { } catch (PDOException $e) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment