$self->{action} =~ s/( |-|,|#)/_/g;
$self->{version} = "2.2.0";
- $self->{dbversion} = "2.2.0";
$main::lxdebug->leave_sub();
$rc = 0;
- if ($form->{dbversion} ne $dbversion) {
+ if (&update_available($dbversion)) {
# update the tables
open FH, ">$userspath/nologin" or die "
}
## /LINET
+sub update_available {
+ ($cur_version) = @_;
+ opendir SQLDIR, "sql/." or &error("", "$!");
+ my @upgradescripts =
+ grep(/$form->{dbdriver}-upgrade-$cur_version.*\.sql/, readdir(SQLDIR));
+ closedir SQLDIR;
+
+ return ($#upgradescripts > -1);
+}
+
sub dbupdate {
$main::lxdebug->enter_sub();