From af21d4a54a5653e9557687a54e29dd2ab8e75677 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 13 Dec 2015 16:54:40 +0000 Subject: [PATCH] Fix some scrut issues --- html/includes/authentication/radius.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/includes/authentication/radius.inc.php b/html/includes/authentication/radius.inc.php index 663d2b7298..113c7b6600 100644 --- a/html/includes/authentication/radius.inc.php +++ b/html/includes/authentication/radius.inc.php @@ -16,7 +16,6 @@ function authenticate($username, $password) { } $rad = $radius->AccessRequest($username,$password); if($rad === true) { - $user_authenticated = 1; adduser($username); return 1; } @@ -52,7 +51,9 @@ function auth_usermanagement() { function adduser($username, $password, $level=1, $email='', $realname='', $can_modify_passwd=0, $description='', $twofactor=0) { // Check to see if user is already added in the database if (!user_exists($username)) { - $userid = dbInsert(array('username' => $username, 'realname' => '', 'email' => '', 'descr' => '', 'level' => $level, 'can_modify_passwd' => 0, 'twofactor' => 0), 'users'); + $hasher = new PasswordHash(8, false); + $encrypted = $hasher->HashPassword($password); + $userid = dbInsert(array('username' => $username, 'password' => $encrypted, 'realname' => $realname, 'email' => $email, 'descr' => $description, 'level' => $level, 'can_modify_passwd' => $can_modify_passwd, 'twofactor' => $twofactor), 'users'); if ($userid == false) { return false; } @@ -83,7 +84,7 @@ function get_userid($username) { } -function deluser() { +function deluser($username) { dbDelete('bill_perms', '`user_name` = ?', array($username)); dbDelete('devices_perms', '`user_name` = ?', array($username)); dbDelete('ports_perms', '`user_name` = ?', array($username));