Revision 588772c3
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
bin/mozilla/admin.pl | ||
---|---|---|
452 | 452 |
# check for duplicates |
453 | 453 |
if (!$form->{edit}) { |
454 | 454 |
my %members = $auth->read_all_users(); |
455 |
|
|
456 | 455 |
if ($members{$form->{login}}) { |
457 |
$form->error("$form->{login} " . $locale->text('is already a member!'));
|
|
456 |
$form->show_generic_error($locale->text('Another user with the login #1 does already exist.', $form->{login}), 'back_button' => 1);
|
|
458 | 457 |
} |
459 | 458 |
} |
460 | 459 |
|
... | ... | |
573 | 572 |
} |
574 | 573 |
} |
575 | 574 |
|
575 |
# Add new user to his groups. |
|
576 |
if (ref $form->{new_user_group_ids} eq 'ARRAY') { |
|
577 |
my $all_groups = $auth->read_groups(); |
|
578 |
my %user = $auth->read_user($form->{login}); |
|
579 |
|
|
580 |
foreach my $group_id (@{ $form->{new_user_group_ids} }) { |
|
581 |
my $group = $all_groups->{$group_id}; |
|
582 |
|
|
583 |
next if !$group; |
|
584 |
|
|
585 |
push @{ $group->{members} }, $user{id}; |
|
586 |
$auth->save_group($group); |
|
587 |
} |
|
588 |
} |
|
589 |
|
|
576 | 590 |
$form->redirect($locale->text('User saved!')); |
577 | 591 |
|
578 | 592 |
} |
579 | 593 |
|
594 |
sub save_user_as_new { |
|
595 |
$form->{login} = $form->{new_user_login}; |
|
596 |
delete @{$form}{qw(edit new_user_login)}; |
|
597 |
|
|
598 |
save_user(); |
|
599 |
} |
|
600 |
|
|
580 | 601 |
sub delete_user { |
581 | 602 |
my %members = $auth->read_all_users(); |
582 | 603 |
my $templates = $members{$form->{login}}->{templates}; |
... | ... | |
1127 | 1148 |
} |
1128 | 1149 |
|
1129 | 1150 |
sub dispatcher { |
1130 |
foreach my $action (qw(create_standard_group dont_create_standard_group)) { |
|
1151 |
foreach my $action (qw(create_standard_group dont_create_standard_group |
|
1152 |
save_user delete_user save_user_as_new)) { |
|
1131 | 1153 |
if ($form->{"action_${action}"}) { |
1132 | 1154 |
call_sub($action); |
1133 | 1155 |
return; |
Auch abrufbar als: Unified diff
Im Administrationsfrontend eine Möglichkeit zum Duplizieren von existierenden Benutzern eingebaut.
Fix für Bug 1025.