mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Fix to update password properly for all db versions/variants
This commit is contained in:
@@ -57,8 +57,12 @@ print &ui_table_row($text{'user_user'},
|
||||
$text{'user_all'}));
|
||||
|
||||
# Password field
|
||||
my $epassfield1 = $fieldmap{'Password'} || 1e10;
|
||||
my $epassfield2 = $fieldmap{'authentication_string'} || 1e10;
|
||||
print &ui_table_row($text{'user_pass'},
|
||||
&ui_radio("mysqlpass_mode", $in{'new'} ? 0 : $u->[2] ? 1 : 2,
|
||||
&ui_radio("mysqlpass_mode", $in{'new'} ? 0 :
|
||||
(($epassfield1 && !$u->[$epassfield1]) &&
|
||||
($epassfield2 && !$u->[$epassfield2])) ? 2 : 1,
|
||||
[ [ 2, $text{'user_none'} ],
|
||||
$in{'new'} ? ( ) : ( [ 1, $text{'user_leave'} ] ),
|
||||
[ 0, $text{'user_set'} ] ])." ".
|
||||
|
||||
@@ -75,10 +75,18 @@ else {
|
||||
}
|
||||
}
|
||||
elsif ($in{'mysqlpass_mode'} == 2) {
|
||||
&execute_sql_logged($master_db,
|
||||
"update user set password = NULL ".
|
||||
"where user = ? and host = ?",
|
||||
$user, $host);
|
||||
if ($fieldmap{'Password'}) {
|
||||
&execute_sql_logged($master_db,
|
||||
"update user set password = '' ".
|
||||
"where user = ? and host = ?",
|
||||
$user, $host);
|
||||
}
|
||||
if ($fieldmap{'authentication_string'}) {
|
||||
&execute_sql_logged($master_db,
|
||||
"update user set authentication_string = '' ".
|
||||
"where user = ? and host = ?",
|
||||
$user, $host);
|
||||
}
|
||||
}
|
||||
|
||||
# Save various limits
|
||||
|
||||
Reference in New Issue
Block a user