Added utilities for make random strings
This commit is contained in:
parent
479040930c
commit
824999f165
2 changed files with 16 additions and 3 deletions
|
|
@ -3,10 +3,15 @@
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"url": "./vendor/phangoapp/leviathanutils"
|
"url": "./vendor/phangoapp/leviathanutils"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://bitbucket.org/phangoapp/phautils.git"
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"phangoapp/leviathanutils": "dev-master"
|
"phangoapp/leviathanutils": "dev-master",
|
||||||
|
"phangoapp/phautils": "dev-master"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
12
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
|
|
@ -82,13 +82,21 @@ class Linux {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function add_new_user() {
|
static public function add_new_user($user, $password='', $group='', $user_directory='', $shell='/usr/sbin/nologin') {
|
||||||
|
|
||||||
|
$str_user='sudo useradd -m -s ${shell} ${username}';
|
||||||
|
|
||||||
|
if($password!='') {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Linux::shell_command([$str_user]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function delete_user() {
|
static public function delete_user($username) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue