Commit a0fed931 authored by Marius Burkard's avatar Marius Burkard

- fixed problem with gid/uid problem on user creation (apache2 and nginx plugin)

parent cbb25838
......@@ -606,7 +606,7 @@ class apache2_plugin {
$groupname = $data['new']['system_group'];
if($data['new']['system_group'] != '' && !$app->system->is_group($data['new']['system_group'])) {
$app->system->exec_safe('groupadd ? ?', $fixed_gid_param, $groupname);
$app->system->exec_safe('groupadd ' . $fixed_gid_param . ' ?', $groupname);
if($apache_chrooted) $app->system->exec_safe('chroot ? groupadd ?', $web_config['website_basedir'], $groupname);
$app->log('Adding the group: '.$groupname, LOGLEVEL_DEBUG);
}
......@@ -614,11 +614,11 @@ class apache2_plugin {
$username = $data['new']['system_user'];
if($data['new']['system_user'] != '' && !$app->system->is_user($data['new']['system_user'])) {
if($web_config['add_web_users_to_sshusers_group'] == 'y') {
$app->system->exec_safe('useradd -d ? -g ? ? -G sshusers ? -s /bin/false', $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
if($apache_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ? -G sshusers ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
$app->system->exec_safe('useradd -d ? -g ? ' . $fixed_uid_param . ' -G sshusers ? -s /bin/false', $data['new']['document_root'], $groupname, $username);
if($apache_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ' . $fixed_uid_param . ' -G sshusers ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $username);
} else {
$app->system->exec_safe('useradd -d ? -g ? ? ? -s /bin/false', $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
if($apache_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ? ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
$app->system->exec_safe('useradd -d ? -g ? ' . $fixed_uid_param . ' ? -s /bin/false', $data['new']['document_root'], $groupname, $username);
if($apache_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ' . $fixed_uid_param . ' ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $username);
}
$app->log('Adding the user: '.$username, LOGLEVEL_DEBUG);
}
......
......@@ -451,7 +451,7 @@ class nginx_plugin {
$groupname = $data['new']['system_group'];
if($data['new']['system_group'] != '' && !$app->system->is_group($data['new']['system_group'])) {
$app->system->exec_safe('groupadd ? ?', $fixed_gid_param, $groupname);
$app->system->exec_safe('groupadd ' . $fixed_gid_param . ' ?', $groupname);
if($nginx_chrooted) $app->system->exec_safe('chroot ? groupadd ?', $web_config['website_basedir'], $groupname);
$app->log('Adding the group: '.$groupname, LOGLEVEL_DEBUG);
}
......@@ -459,11 +459,11 @@ class nginx_plugin {
$username = $data['new']['system_user'];
if($data['new']['system_user'] != '' && !$app->system->is_user($data['new']['system_user'])) {
if($web_config['add_web_users_to_sshusers_group'] == 'y') {
$app->system->exec_safe('useradd -d ? -g ? ? -G sshusers ? -s /bin/false', $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
if($nginx_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ? -G sshusers ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
$app->system->exec_safe('useradd -d ? -g ? ' . $fixed_uid_param . ' -G sshusers ? -s /bin/false', $data['new']['document_root'], $groupname, $username);
if($nginx_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ' . $fixed_uid_param . ' -G sshusers ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $username);
} else {
$app->system->exec_safe('useradd -d ? -g ? ? ? -s /bin/false', $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
if($nginx_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ? ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $fixed_uid_param, $username);
$app->system->exec_safe('useradd -d ? -g ? ' . $fixed_uid_param . ' ? -s /bin/false', $data['new']['document_root'], $groupname, $username);
if($nginx_chrooted) $app->system->exec_safe('chroot ? useradd -d ? -g ? ' . $fixed_uid_param . ' ? -s /bin/false', $web_config['website_basedir'], $data['new']['document_root'], $groupname, $username);
}
$app->log('Adding the user: '.$username, LOGLEVEL_DEBUG);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment