Fixes in add user

This commit is contained in:
absurdo 2023-11-25 11:14:29 +01:00
parent 37682ffee5
commit 8e7b370647

View file

@ -93,11 +93,11 @@ class Linux {
static public function add_new_user($user, $password='', $user_directory='', $shell='/usr/sbin/nologin') {
$str_user='sudo useradd -m -s ${shell} ${username}';
$str_user="sudo useradd -m -s ${shell} ${username}";
if($password!='') {
$hash=crypt($password, '$6$rounds=6000$'.PhangoApp\PhaUtils\Utils\generate_random_password(15).'$');
$hash=crypt($password, '$6$rounds=6000$'.PhangoApp\PhaUtils\Utils\generate_random_password(10).'$');
$str_user.=" -p \"${hash}\"";