4 # useradmin_create_user(&details)
5 # Setup SSH and GNUPG for new users
6 sub useradmin_create_user
8 if ($config{'sync_create'} && &has_command($config{'keygen_path'}) &&
9 -d $_[0]->{'home'} && !-d "$_[0]->{'home'}/.ssh") {
11 local $type = $config{'sync_type'} ? "-t $config{'sync_type'}" :
12 $version{'type'} eq 'openssh' &&
13 $version{'number'} >= 3.2 ? "-t rsa1" : "";
14 if ($config{'sync_pass'} && $_[0]->{'passmode'} == 3) {
15 $cmd = "$config{'keygen_path'} $type -P \"$_[0]->{'plainpass'}\"";
18 $cmd = "$config{'keygen_path'} $type -P \"\"";
20 &system_logged("echo '' | su $_[0]->{'user'} -c '$cmd' >/dev/null 2>&1");
21 if ($config{'sync_auth'}) {
22 if (-r "$_[0]->{'home'}/.ssh/identity.pub") {
23 &system_logged("cp $_[0]->{'home'}/.ssh/identity.pub $_[0]->{'home'}/.ssh/authorized_keys");
26 &system_logged("cp $_[0]->{'home'}/.ssh/id_dsa.pub $_[0]->{'home'}/.ssh/authorized_keys");
28 &system_logged("chown $_[0]->{'uid'}:$_[0]->{'gid'} $_[0]->{'home'}/.ssh/authorized_keys");
33 # useradmin_delete_user(&details)
34 sub useradmin_delete_user
38 # useradmin_modify_user(&details)
39 sub useradmin_modify_user