From 5bda92f0abd9783484e950804984fbc8189a803f Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 17 Feb 2024 20:43:39 +0100 Subject: [PATCH 1/3] audio-recordings.cgi: set permissions to update event --- website/agenda/planung/audio-recordings.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/agenda/planung/audio-recordings.cgi b/website/agenda/planung/audio-recordings.cgi index a908b63..bf31989 100755 --- a/website/agenda/planung/audio-recordings.cgi +++ b/website/agenda/planung/audio-recordings.cgi @@ -130,6 +130,7 @@ sub uploadRecording { if ( defined $fh ) { print STDERR "upload\n"; + $config->{access}->{write} = 1; events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploading' }); my $fileInfo = uploadFile( $config, $fh, $params->{event_id}, $user, $params->{upload} ); $params->{error} .= $fileInfo->{error} if defined $fileInfo->{error}; @@ -141,6 +142,7 @@ sub uploadRecording { $params = updateDatabase( $config, $params, $user ) ; events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploaded' }); } + $config->{access}->{write} = 0; } else { print STDERR "could not get file handle\n"; @@ -408,7 +410,6 @@ sub updateDatabase { }; #connect - $config->{access}->{write} = 1; my $dbh = db::connect($config); my $entries = audio_recordings::get( @@ -439,7 +440,6 @@ sub updateDatabase { $params->{id} = $entry->{id}; } call_hooks($config, $entry, $params); - $config->{access}->{write} = 0; $params->{action_result} = 'done!'; return $params; From 3f5e4a84fb59340583eae41e93d2b85e315dc74b Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 17 Feb 2024 20:44:02 +0100 Subject: [PATCH 2/3] db.pm: output call stack on error --- lib/calcms/db.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/calcms/db.pm b/lib/calcms/db.pm index 6d4ee4f..1e29eeb 100644 --- a/lib/calcms/db.pm +++ b/lib/calcms/db.pm @@ -52,6 +52,10 @@ sub connect($;$) { my $dbh = DBI->connect( $dsn, $username, $password, { mysql_enable_utf8 => 1 } ) || die "could not connect to database: $DBI::errstr"; $dbh->{RaiseError} = 1; + $dbh->{HandleError} = sub{ + print STDERR join(",",(caller($_))[0..3])."\n" for (1..2); + return 0; + }; $dbh->{'mysql_enable_utf8'} = 1; put( $dbh, "set character set utf8", undef ); put( $dbh, "set names utf8", undef ); From d56174f8d07ae1deda086bd7772474700e19fc8b Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 17 Feb 2024 20:57:39 +0100 Subject: [PATCH 3/3] INSTALL.md: add sox to calculate audio duration --- install/INSTALL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/INSTALL.md b/install/INSTALL.md index 538afa4..2b3ca7f 100644 --- a/install/INSTALL.md +++ b/install/INSTALL.md @@ -99,6 +99,8 @@ apt-get install libtext-wikicreole-perl liburi-escape-xs-perl perlmagick + sox + libsox-fmt-all #### Install CPAN packages