Comparison

plugins/mod_admin_shell.lua @ 12992:651813914151

mod_admin_shell: Enable user after creation with role Fixes that otherwise the user was created in a disabled state and left as such.
author Kim Alvefur <zash@zash.se>
date Sun, 26 Mar 2023 16:45:34 +0200
parent 12991:6d7e3d5463d8
child 12993:623fbb5f9b05
comparison
equal deleted inserted replaced
12991:6d7e3d5463d8 12992:651813914151
1531 if password then 1531 if password then
1532 local ok, err = um.set_password(username, password, host, nil); 1532 local ok, err = um.set_password(username, password, host, nil);
1533 if not ok then 1533 if not ok then
1534 return nil, "Could not set password for user: "..err; 1534 return nil, "Could not set password for user: "..err;
1535 end 1535 end
1536
1537 local ok, err = um.enable_user(username, host);
1538 if not ok and err ~= "method-not-implemented" then
1539 return nil, "Could not enable user: "..err;
1540 end
1536 end 1541 end
1537 else 1542 else
1538 local ok, err = um.create_user(username, password, host); 1543 local ok, err = um.create_user(username, password, host);
1539 if not ok then 1544 if not ok then
1540 return nil, "Could not create user: "..err; 1545 return nil, "Could not create user: "..err;