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; |
locale/de/admin | ||
---|---|---|
13 | 13 |
'Administration' => 'Administration', |
14 | 14 |
'Advance turnover tax return' => 'Umsatzsteuervoranmeldung', |
15 | 15 |
'All reports' => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)', |
16 |
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.', |
|
16 | 17 |
'Attempt to call an undefined sub named \'%s\'' => 'Es wurde versucht, eine nicht definierte Unterfunktion namens \'%s\' aufzurufen.', |
17 | 18 |
'Authentification database creation' => 'Anlegen der Datenbank zur Benutzerauthentifizierung', |
18 | 19 |
'Authentification tables creation' => 'Anlegen der Tabellen zur Benutzerauthentifizierung', |
... | ... | |
192 | 193 |
'config/authentication.pl: Missing parameters in "LDAP_config". Required parameters are "host", "attribute" and "base_dn".' => 'config/authentication.pl: Fehlende Parameter in "LDAP_config". Benötigt werden "host", "attribute" und "base_dn".', |
193 | 194 |
'customer' => 'Kunde', |
194 | 195 |
'invoice' => 'Rechnung', |
195 |
'is already a member!' => 'ist bereits ein Mitglied!', |
|
196 | 196 |
'no' => 'nein', |
197 | 197 |
'packing_list' => 'Versandliste', |
198 | 198 |
'pick_list' => 'Entnahmeliste', |
... | ... | |
271 | 271 |
'save_group' => 'save_group', |
272 | 272 |
'save_group_membership' => 'save_group_membership', |
273 | 273 |
'save_user' => 'save_user', |
274 |
'save_user_as_new' => 'save_user_as_new', |
|
274 | 275 |
'select_part' => 'select_part', |
275 | 276 |
'select_part_internal' => 'select_part_internal', |
276 | 277 |
'set_longdescription' => 'set_longdescription', |
locale/de/all | ||
---|---|---|
172 | 172 |
'Amount' => 'Betrag', |
173 | 173 |
'Amount Due' => 'Betrag f?llig', |
174 | 174 |
'Annotations' => 'Anmerkungen', |
175 |
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.', |
|
175 | 176 |
'Ansprechpartner' => 'Ansprechpartner', |
176 | 177 |
'Ap aging on %s' => 'Offene Verbindlichkeiten zum %s', |
177 | 178 |
'Application Error. No Format given' => 'Fehler in der Anwendung. Das Ausgabeformat fehlt.', |
... | ... | |
1113 | 1114 |
'Please ask your administrator to create warehouses and bins.' => 'Bitten Sie Ihren Administrator, dass er Lager und Lagerplätze anlegt.', |
1114 | 1115 |
'Please enter a license key.' => 'Bitte geben Sie einen Lizenzschl?ssel an.', |
1115 | 1116 |
'Please enter a number of licenses.' => 'Bitte geben Sie die Anzahl Lizenzschl?ssel an.', |
1117 |
'Please enter the login for the new user.' => 'Bitte geben Sie das Login f?r den neuen Benutzer ein.', |
|
1116 | 1118 |
'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage für die neue Datenbank benutzt wird:', |
1117 | 1119 |
'Please enter the name of the dataset you want to restore the backup in.' => 'Bitte geben Sie den Namen der Datenbank ein, in der Sie die Sicherung wiederherstellen wollen.', |
1118 | 1120 |
'Please enter the taxnumber in the administration menu userpreferences' => 'Bitte bei den Einstellungen des aktuellen Benutzers im Administrationsmodul |
... | ... | |
1820 | 1822 |
'history search engine' => 'Historien Suchmaschine', |
1821 | 1823 |
'invoice' => 'Rechnung', |
1822 | 1824 |
'invoice_list' => 'debitorenbuchungsliste', |
1823 |
'is already a member!' => 'ist bereits ein Mitglied!', |
|
1824 | 1825 |
'lead deleted!' => 'Kundenquelle gel?scht', |
1825 | 1826 |
'lead saved!' => 'Kundenquelle geichert', |
1826 | 1827 |
'list' => 'auflisten', |
templates/webpages/admin/edit_user_de.html | ||
---|---|---|
1 | 1 |
[% USE HTML %]<body class="admin"> |
2 | 2 |
|
3 | 3 |
<script type="text/javascript" src="js/common.js"></script> |
4 |
<script type="text/javascript" src="js/jquery.js"></script> |
|
4 | 5 |
<script type="text/javascript"> |
5 | 6 |
<!-- |
6 | 7 |
function open_connection_test_window() { |
... | ... | |
19 | 20 |
--> |
20 | 21 |
</script> |
21 | 22 |
|
22 |
<form name="Form" method="post" action="admin.pl"> |
|
23 |
<form name="Form" id="Form" method="post" action="admin.pl">
|
|
23 | 24 |
|
24 | 25 |
<div class="listtop" width="100%">[% title %]</div> |
25 | 26 |
|
... | ... | |
29 | 30 |
<table> |
30 | 31 |
<tr> |
31 | 32 |
<th align="right">Anmeldung</th> |
32 |
<td>[% IF edit %]<input type="hidden" name="login" value="[% HTML.escape(myc_login) %]">[% HTML.escape(myc_login) %][% ELSE %]<input name="login" value="[% HTML.escape(myc_login) %]">[% END %]</td> |
|
33 |
<td> |
|
34 |
[%- IF edit %] |
|
35 |
<input type="hidden" name="login" value="[% HTML.escape(myc_login) %]">[% HTML.escape(myc_login) %] |
|
36 |
[%- ELSE %] |
|
37 |
<input name="login" value="[% HTML.escape(myc_login) %]"> |
|
38 |
[%- END %] |
|
39 |
</td> |
|
33 | 40 |
</tr> |
34 | 41 |
|
35 | 42 |
<tr> |
... | ... | |
280 | 287 |
|
281 | 288 |
<input name="callback" type="hidden" value="admin.pl?action=list_users"> |
282 | 289 |
|
283 |
<input type="submit" class="submit" name="action" value="Speichern"> |
|
290 |
<input type="hidden" name="action" value="dispatcher"> |
|
291 |
<input type="submit" class="submit" name="action_save_user" value="Speichern"> |
|
284 | 292 |
|
285 | 293 |
[% IF edit %] |
286 |
<input type="submit" class="submit" name="action" value="L?schen"> |
|
294 |
[% FOREACH row = GROUPS %] |
|
295 |
<input type="hidden" name="new_user_group_ids[]" value="[% HTML.escape(row.id) %]"> |
|
296 |
[% END %] |
|
297 |
<input type="hidden" name="new_user_login" id="new_user_login" value=""> |
|
298 |
<input type="hidden" name="action_save_user_as_new" id="action_save_user_as_new" value=""> |
|
299 |
<input type="button" class="submit" id="save_as_new_button" value="als neu speichern"> |
|
300 |
<input type="submit" class="submit" name="action_delete_user" value="L?schen"> |
|
287 | 301 |
<input type="hidden" name="edit" value="1"> |
288 | 302 |
[% END %] |
289 | 303 |
|
290 | 304 |
</form> |
291 | 305 |
|
306 |
<script type="text/javascript"> |
|
307 |
<!-- |
|
308 |
$(document).ready(function() { |
|
309 |
$("#save_as_new_button").click(function() { |
|
310 |
var new_user_login = prompt('Bitte geben Sie das Login f?r den neuen Benutzer ein.', ''); |
|
311 |
if (!new_user_login || (new_user_login == '')) |
|
312 |
return; |
|
313 |
|
|
314 |
$("#action_save_user_as_new").attr('value', '1'); |
|
315 |
$("#new_user_login").attr('value', new_user_login); |
|
316 |
$("#Form").submit(); |
|
317 |
}); |
|
318 |
}); |
|
319 |
--> |
|
320 |
</script> |
|
321 |
|
|
292 | 322 |
</body> |
293 | 323 |
</html> |
templates/webpages/admin/edit_user_master.html | ||
---|---|---|
1 | 1 |
[% USE HTML %]<body class="admin"> |
2 | 2 |
|
3 | 3 |
<script type="text/javascript" src="js/common.js"></script> |
4 |
<script type="text/javascript" src="js/jquery.js"></script> |
|
4 | 5 |
<script type="text/javascript"> |
5 | 6 |
<!-- |
6 | 7 |
function open_connection_test_window() { |
... | ... | |
19 | 20 |
--> |
20 | 21 |
</script> |
21 | 22 |
|
22 |
<form name="Form" method="post" action="admin.pl"> |
|
23 |
<form name="Form" id="Form" method="post" action="admin.pl">
|
|
23 | 24 |
|
24 | 25 |
<div class="listtop" width="100%">[% title %]</div> |
25 | 26 |
|
... | ... | |
29 | 30 |
<table> |
30 | 31 |
<tr> |
31 | 32 |
<th align="right"><translate>Login</translate></th> |
32 |
<td>[% IF edit %]<input type="hidden" name="login" value="[% HTML.escape(myc_login) %]">[% HTML.escape(myc_login) %][% ELSE %]<input name="login" value="[% HTML.escape(myc_login) %]">[% END %]</td> |
|
33 |
<td> |
|
34 |
[%- IF edit %] |
|
35 |
<input type="hidden" name="login" value="[% HTML.escape(myc_login) %]">[% HTML.escape(myc_login) %] |
|
36 |
[%- ELSE %] |
|
37 |
<input name="login" value="[% HTML.escape(myc_login) %]"> |
|
38 |
[%- END %] |
|
39 |
</td> |
|
33 | 40 |
</tr> |
34 | 41 |
|
35 | 42 |
<tr> |
... | ... | |
280 | 287 |
|
281 | 288 |
<input name="callback" type="hidden" value="admin.pl?action=list_users"> |
282 | 289 |
|
283 |
<input type="submit" class="submit" name="action" value="<translate>Save</translate>"> |
|
290 |
<input type="hidden" name="action" value="dispatcher"> |
|
291 |
<input type="submit" class="submit" name="action_save_user" value="<translate>Save</translate>"> |
|
284 | 292 |
|
285 | 293 |
[% IF edit %] |
286 |
<input type="submit" class="submit" name="action" value="<translate>Delete</translate>"> |
|
294 |
[% FOREACH row = GROUPS %] |
|
295 |
<input type="hidden" name="new_user_group_ids[]" value="[% HTML.escape(row.id) %]"> |
|
296 |
[% END %] |
|
297 |
<input type="hidden" name="new_user_login" id="new_user_login" value=""> |
|
298 |
<input type="hidden" name="action_save_user_as_new" id="action_save_user_as_new" value=""> |
|
299 |
<input type="button" class="submit" id="save_as_new_button" value="<translate>Save as new</translate>"> |
|
300 |
<input type="submit" class="submit" name="action_delete_user" value="<translate>Delete</translate>"> |
|
287 | 301 |
<input type="hidden" name="edit" value="1"> |
288 | 302 |
[% END %] |
289 | 303 |
|
290 | 304 |
</form> |
291 | 305 |
|
306 |
<script type="text/javascript"> |
|
307 |
<!-- |
|
308 |
$(document).ready(function() { |
|
309 |
$("#save_as_new_button").click(function() { |
|
310 |
var new_user_login = prompt('<translate>Please enter the login for the new user.</translate>', ''); |
|
311 |
if (!new_user_login || (new_user_login == '')) |
|
312 |
return; |
|
313 |
|
|
314 |
$("#action_save_user_as_new").attr('value', '1'); |
|
315 |
$("#new_user_login").attr('value', new_user_login); |
|
316 |
$("#Form").submit(); |
|
317 |
}); |
|
318 |
}); |
|
319 |
--> |
|
320 |
</script> |
|
321 |
|
|
292 | 322 |
</body> |
293 | 323 |
</html> |
Auch abrufbar als: Unified diff
Im Administrationsfrontend eine Möglichkeit zum Duplizieren von existierenden Benutzern eingebaut.
Fix für Bug 1025.