aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-02-02 08:44:13 +0000
committerThierry Vignaud <tv@mandriva.org>2010-02-02 08:44:13 +0000
commit2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e (patch)
treed3f4bee405812f593a16860a8df9d2eecd455321
parente44a82aee646b6a7e43a0aa4b3c04e917850ec81 (diff)
downloaduserdrake-2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e.tar
userdrake-2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e.tar.gz
userdrake-2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e.tar.bz2
userdrake-2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e.tar.xz
userdrake-2a786ea9e9cbb8503a281dbd8c52b545fb4bb54e.zip
(Edit) do not crash when trying to rename a user to an already existing name
-rw-r--r--NEWS1
-rwxr-xr-xuserdrake6
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6b378d8..7155e5b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- do not crash when trying to rename a user to an already existing name
- make libuser binding i18n aware
- refactorization for readability (please test)
- use libuser translations
diff --git a/userdrake b/userdrake
index fa1a101..b8af2b2 100755
--- a/userdrake
+++ b/userdrake
@@ -1154,7 +1154,11 @@ sub Edit() {
Gtk2::Button->new($_->[0]), clicked => sub {
if (!$retv) {
if ($p <= 0) {
- UserEdit_valid($userEnt, $model, $primgid);
+ eval { UserEdit_valid($userEnt, $model, $primgid) };
+ if (my $err = $@) {
+ c::set_tagged_utf8($err);
+ RaiseError(N("An error occurred:") . "\n" . $err);
+ }
} elsif ($p == 1) {
GroupEdit_valid($groupEnt, $model, $groupname);
}