forgot to checkin update file

This commit is contained in:
Pliable Pixels 2019-05-13 10:31:09 -04:00
parent 41ae745b17
commit 87e407aa90
3 changed files with 20 additions and 2 deletions

3
db/zm_update-1.33.9.sql Normal file
View File

@ -0,0 +1,3 @@
ALTER TABLE `Users`
ADD COLUMN `TokenMinExpiry` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `MonitorIds`,
ADD COLUMN `APIEnabled` tinyint(3) UNSIGNED NOT NULL default 1 AFTER `TokenMinExpiry`;

View File

@ -26,7 +26,7 @@ Build-Depends: debhelper (>= 9), cmake
, libdata-dump-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl
, libsys-cpu-perl, libsys-meminfo-perl
, libdata-uuid-perl
, libssl-dev
, libssl-dev,libdigest-bcrypt-perl
Standards-Version: 3.9.4
Package: zoneminder
@ -52,7 +52,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
, zip
, libvlccore5 | libvlccore7 | libvlccore8, libvlc5
, libpolkit-gobject-1-0, php5-gd
, libssl
, libssl,libdigest-bcrypt-perl
Recommends: mysql-server | mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -312,6 +312,7 @@ if ( $migrateEvents ) {
if ( $freshen ) {
print( "\nFreshening configuration in database\n" );
migratePaths();
migratePasswords();
ZoneMinder::Config::loadConfigFromDB();
ZoneMinder::Config::saveConfigToDB();
}
@ -999,6 +1000,20 @@ sub patchDB {
}
sub migratePasswords {
print ("****** MIGRATION");
my $sql = "select * from Users";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
while( my $user = $sth->fetchrow_hashref() ) {
my $scheme = substr $user->{Password}, 0, 1;
if ($scheme eq "*") {
print ("*********** HOLY GODZILLA ".$user->{Username}. " uses PASSWORD");
}
}
}
sub migratePaths {
my $customConfigFile = '@ZM_CONFIG_SUBDIR@/zmcustom.conf';