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 { |
SL/User.pm | ||
---|---|---|
161 | 161 |
|
162 | 162 |
$self->dbupdate($form); |
163 | 163 |
$self->dbupdate2($form, $dbupdater); |
164 |
SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(0); |
|
164 | 165 |
|
165 | 166 |
close(FH); |
166 | 167 |
|
... | ... | |
177 | 178 |
print $form->parse_html_template("dbupgrade/footer", { "menufile" => $menufile }); |
178 | 179 |
|
179 | 180 |
$rc = -2; |
180 |
|
|
181 | 181 |
} |
182 | 182 |
} |
183 | 183 |
|
bin/mozilla/admin.pl | ||
---|---|---|
1167 | 1167 |
} |
1168 | 1168 |
|
1169 | 1169 |
sub _apply_dbupgrade_scripts { |
1170 |
SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->parse_dbupdate_controls->apply_admin_dbupgrade_scripts(1);
|
|
1170 |
::end_of_request() if SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(1);
|
|
1171 | 1171 |
} |
1172 | 1172 |
|
1173 | 1173 |
1; |
Auch abrufbar als: Unified diff
Auth-DB auch bei Benutzerlogins aktualisieren, sofern notwendig