summaryrefslogtreecommitdiff
path: root/useradm.php
diff options
context:
space:
mode:
Diffstat (limited to 'useradm.php')
-rw-r--r--useradm.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/useradm.php b/useradm.php
index e9005a8..30a7a06 100644
--- a/useradm.php
+++ b/useradm.php
@@ -66,7 +66,11 @@
$sth->execute([$user]);
if ($line = $sth->fetch()) {
- print "User already exists.\n";
+ print "User already exists, updating password.\n";
+
+ $sth = $dbh->prepare("UPDATE epube_users SET pass = ? WHERE user = ?");
+ $sth->execute([$pass_hash, $user]);
+
} else {
$sth = $dbh->prepare("INSERT INTO epube_users (user, pass)
VALUES (?, ?)");