Quote:
|
Originally Posted by falko
Did you use the full path to useradd (/usr/sbin/useradd) in exec() or just useradd? It's possible that the PATH variable is different within your PHP script.
|
the exact code used is as follows
// pulls user from MySql Database
$user = get_user($UID,'','');
//building command
$command = "sudo /usr/sbin/useradd -g 100 -d ".$user['rootDir']." -k
/srv/www/htdocs/skel -s /bin/false -c \"".$user['firstName']."
".$user['lastName']."\" ".$user['userName'];
//execute command
exec($command,$return);
//getting return
if (is_array($return)){
//if return we send output to browser
print_r($return);
}
Recent comments
10 hours 31 min ago
15 hours 36 min ago
20 hours 48 sec ago
21 hours 49 min ago
1 day 12 hours ago
1 day 12 hours ago
1 day 17 hours ago
1 day 23 hours ago
2 days 33 min ago
2 days 1 hour ago