diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-08-07 13:30:20 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-08-07 13:30:20 +0200 |
commit | 7fd88fef131326a259b02d9b0b7d10f79172e79c (patch) | |
tree | 567afbad3e2eb26042ffc411f2134c74a7cd2b95 | |
parent | 4e770af4ee003bf6c7e81f61e627dc5cdcf2995d (diff) | |
download | colin-keep-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar colin-keep-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.gz colin-keep-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.bz2 colin-keep-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.xz colin-keep-7fd88fef131326a259b02d9b0b7d10f79172e79c.zip |
Fixed home creation if home already exists (crashed in userdrake)
-rw-r--r-- | lib/AdminPanel/Module/Users.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm index c937cd5..33d2ade 100644 --- a/lib/AdminPanel/Module/Users.pm +++ b/lib/AdminPanel/Module/Users.pm @@ -988,9 +988,15 @@ sub addUserDialog { } my $userEnt = $continue && $self->ctx->InitUser($username, $is_system); if ($continue && $createHome->value()) { - $dontcreatehomedir = 0; my $homedir = $homeDir->value(); - $userEnt and $userEnt->HomeDir($homedir); + if ( -d $homedir) { + $errorString = $self->loc->N("Home directory <%s> already exists.\nPlease uncheck the home creation option, or change the directory path name", $homedir); + $continue = 0; + } + else { + $dontcreatehomedir = 0; + $userEnt and $userEnt->HomeDir($homedir); + } } else { $dontcreatehomedir = 1; } |