Revision 2da6fbfb
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
347 | 347 |
sub apply_admin_dbupgrade_scripts { |
348 | 348 |
my ($self, $called_from_admin) = @_; |
349 | 349 |
|
350 |
return if !$self->{auth}; |
|
350 |
return 0 if !$self->{auth};
|
|
351 | 351 |
|
352 | 352 |
my $dbh = $::auth->dbconnect; |
353 | 353 |
my @unapplied_scripts = $self->unapplied_upgrade_scripts($dbh); |
354 | 354 |
|
355 |
return if !@unapplied_scripts; |
|
355 |
return 0 if !@unapplied_scripts;
|
|
356 | 356 |
|
357 | 357 |
my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET; |
358 | 358 |
$self->{form}->{login} ||= 'admin'; |
359 | 359 |
|
360 | 360 |
map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $self->{all_controls} }; |
361 | 361 |
|
362 |
$self->{form}->{title} = $::locale->text('Dataset upgrade'); |
|
363 |
$self->{form}->header; |
|
362 |
if ($called_from_admin) { |
|
363 |
$self->{form}->{title} = $::locale->text('Dataset upgrade'); |
|
364 |
$self->{form}->header; |
|
365 |
} |
|
366 |
|
|
364 | 367 |
print $self->{form}->parse_html_template("dbupgrade/header", { dbname => $::auth->{DB_config}->{db} }); |
365 | 368 |
|
366 | 369 |
foreach my $control (@unapplied_scripts) { |
... | ... | |
370 | 373 |
$self->process_file($dbh, "sql/$self->{dbdriver}-upgrade2-auth/$control->{file}", $control, $db_charset); |
371 | 374 |
} |
372 | 375 |
|
373 |
print $self->{form}->parse_html_template("dbupgrade/footer", { is_admin => $called_from_admin }); |
|
374 |
::end_of_request(); |
|
376 |
print $self->{form}->parse_html_template("dbupgrade/footer", { is_admin => 1 }) if $called_from_admin; |
|
377 |
|
|
378 |
return 1; |
|
375 | 379 |
} |
376 | 380 |
|
377 | 381 |
sub _check_for_loops { |
Auch abrufbar als: Unified diff
Auth-DB auch bei Benutzerlogins aktualisieren, sofern notwendig