aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-08-07 13:30:20 +0200
committerAngelo Naselli <anaselli@linux.it>2014-08-07 13:30:20 +0200
commit7fd88fef131326a259b02d9b0b7d10f79172e79c (patch)
tree567afbad3e2eb26042ffc411f2134c74a7cd2b95 /lib
parent4e770af4ee003bf6c7e81f61e627dc5cdcf2995d (diff)
downloadmanatools-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar
manatools-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.gz
manatools-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.bz2
manatools-7fd88fef131326a259b02d9b0b7d10f79172e79c.tar.xz
manatools-7fd88fef131326a259b02d9b0b7d10f79172e79c.zip
Fixed home creation if home already exists (crashed in userdrake)
Diffstat (limited to 'lib')
-rw-r--r--lib/AdminPanel/Module/Users.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm
index c937cd5a..33d2ade1 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;
}