From 21f93ef48f9e9f21729a0b38024f31ed1cc8ecae Mon Sep 17 00:00:00 2001 From: absurdo Date: Sat, 25 Nov 2023 01:55:21 +0100 Subject: [PATCH] Added user functions --- vendor/phangoapp/leviathanutils/src/Linux.php | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/vendor/phangoapp/leviathanutils/src/Linux.php b/vendor/phangoapp/leviathanutils/src/Linux.php index 9743e4c..590e201 100644 --- a/vendor/phangoapp/leviathanutils/src/Linux.php +++ b/vendor/phangoapp/leviathanutils/src/Linux.php @@ -5,7 +5,7 @@ namespace PhangoApp\LeviathanUtils; class Linux { - static public function shell_command($arr_command, $exit_if_error=0) { + static public function shell_command($arr_command, $exit_if_error=1) { $cmd=implode(' ', $arr_command); @@ -25,7 +25,16 @@ class Linux { echo 'Error executing command '.$cmd."\n"; - exit($result); + if($exit_if_error) { + + exit($result); + + } + else { + + return $result; + + } } @@ -88,6 +97,14 @@ class Linux { if($password!='') { + $hash=crypt($password, '$6$rounds=6000$'.PhangoApp\PhaUtils\Utils\generate_random_password(15).'$'); + + $str_user.=" -p \"${hash}\""; + + } + + if($group!='') { + } @@ -96,7 +113,9 @@ class Linux { } - static public function delete_user($username) { + static public function user_delete($username) { + + }