From 5e9fe828db9a23c8e98da1be3bc0e4961a6b3dde Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 22 Nov 2022 17:08:31 +0100 Subject: [adduser] Fix password change --- modules/adduser.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/adduser.inc.php b/modules/adduser.inc.php index 62cb840..20bfe47 100644 --- a/modules/adduser.inc.php +++ b/modules/adduser.inc.php @@ -47,8 +47,9 @@ class Page_AddUser extends Page if ($ok === false) { Message::addError('Login-Suffix @{{0}} ist ungültig.', $suffix); } else { - Database::exec('INSERT INTO user (userid, password, organizationid, firstname, lastname, email) ' - . ' VALUES (:userid, :password, :organization, :firstname, :lastname, :email)', array( + Database::exec('INSERT INTO user (userid, password, organizationid, firstname, lastname, email) + VALUES (:userid, :password, :organization, :firstname, :lastname, :email) + ON DUPLICATE KEY UPDATE password = VALUES(password)', array( 'userid' => $login, 'password' => Crypto::hash6($password), 'organization' => $organizationid, @@ -78,4 +79,4 @@ class Page_AddUser extends Page Render::addTemplate('adduser/_page', array('orgs' => $orgs)); } -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522