mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: move user preferences dashboard and twofactor out of users table (#6286)
* fix: move user preferences dashboard and twofactor out of users table This allows them to work with any authentication method Add set_user_pref() and get_user_pref() helper functions * fix edit users for other users * Fix updated_at default timestamp * Update and rename 183.sql to 184.sql * removed commented out debug
This commit is contained in:
committed by
Neil Lathwood
parent
98e8e7e407
commit
4b9f3f37d7
@@ -50,12 +50,12 @@ function auth_usermanagement()
|
||||
}
|
||||
|
||||
|
||||
function adduser($username, $password, $level, $email = '', $realname = '', $can_modify_passwd = 1, $description = '', $twofactor = 0)
|
||||
function adduser($username, $password, $level, $email = '', $realname = '', $can_modify_passwd = 1, $description = '')
|
||||
{
|
||||
if (!user_exists($username)) {
|
||||
$hasher = new PasswordHash(8, false);
|
||||
$encrypted = $hasher->HashPassword($password);
|
||||
$userid = dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description, 'twofactor' => $twofactor), 'users');
|
||||
$userid = dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description), 'users');
|
||||
if ($userid == false) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user