Added user functions
This commit is contained in:
parent
824999f165
commit
21f93ef48f
1 changed files with 22 additions and 3 deletions
25
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
25
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
|
|
@ -5,7 +5,7 @@ namespace PhangoApp\LeviathanUtils;
|
||||||
|
|
||||||
class Linux {
|
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);
|
$cmd=implode(' ', $arr_command);
|
||||||
|
|
||||||
|
|
@ -25,7 +25,16 @@ class Linux {
|
||||||
|
|
||||||
echo 'Error executing command '.$cmd."\n";
|
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!='') {
|
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) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue