From be89d5f1957d159df4289494c7cab9722e8dc9a5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 19 Sep 2014 23:45:16 +0000 Subject: renamed listdropboxes to listshows loading show list diff --git a/README b/README index 3cd567e..91173dd 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ add the following to the virtualhost config: Include /etc/rivendell/apache.conf - + SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders diff --git a/index.html b/index.html index 5b3d00d..5e7fbaf 100644 --- a/index.html +++ b/index.html @@ -42,6 +42,17 @@ $('#alertbox').html('
×

' + heading + '

' + message + '
'); } + function updateShowsList(data, status, req) { + alert(data); + } + + var shows_list = []; + function app_shows_init() { + shows_list = []; + data = { LOGIN_NAME: username, PASSWORD: token }; + $.post("/listshows.cgi", data, updateShowsList, "xml") + } + function selectApp(app) { switch(app) { case "musicpools": @@ -56,6 +67,7 @@ $('#app-musicpools').hide(); $('#nav-btn-musicpools').removeClass('active'); app = 'shows'; + app_shows_init(); } sessionStorage.setItem("app", app); } @@ -178,8 +190,7 @@
   -
@@ -192,22 +203,22 @@
-

Democracy Now!

+

 
- Tag: Dienstag + Tag:
- Rythmus: wöchentlich + Rythmus:
- Startzeit: 00:00 + Startzeit:
- Dauer: 30 Minuten + Dauer:
 
diff --git a/listdrobpoxes.cgi b/listdrobpoxes.cgi deleted file mode 100755 index 7ef0bcf..0000000 --- a/listdrobpoxes.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl - -use strict; -use CGI; -use File::Basename; -use lib dirname( __FILE__ ) . '/lib'; -use rddb; - -binmode(STDIN, ":utf8"); -binmode(STDOUT, ":utf8"); -binmode(STDERR, ":utf8"); - -my $status = 'ERROR'; -my $errorstring = 'unknown'; -my $responsecode = 500; -my @dropboxes = (); - -my $q = CGI->new; -my $username = $q->param('LOGIN_NAME'); -my $token = $q->param('PASSWORD'); - -my $dbh; -($dbh, $status, $errorstring) = rddb::opendb(); -if(defined $dbh) { - my $result; - ($result, $status, $errorstring) = rddb::check_token($dbh, $username, $token); - if($result == 1) { - $responsecode = 200; - @dropboxes = rddb::get_dropboxes($dbh, $username); - } elsif($result == 0) { - $responsecode = 403; - } else { - $responsecode = 500; - } - rddb::closedb($dbh); -} - -print "Content-type: application/xml; charset=UTF-8\n\n"; - -if($responsecode != 200) { - print "\n"; - print " " . $responsecode . "\n"; - print " " . $errorstring . "\n"; - print "\n"; -} else { - print "\n"; - for my $href (@dropboxes) { - print " \n"; - print " " . $href->{'GROUP'} . "\n"; - print " " . $href->{'GROUPDESC'} . "\n"; - print " " . $href->{'TYPE'} . "\n"; - print " " . $href->{'SHOWID'} . "\n"; - print " " . $href->{'NORMLEVEL'} . "\n"; - print " " . $href->{'TRIMLEVEL'} . "\n"; - print " " . $href->{'PARAM'} . "\n"; - if($href->{'TYPE'} eq "show") { - print " " . $href->{'SHOWTITLE'} . "\n"; - print " " . $href->{'RHYTHM'} . "\n"; - print " " . $href->{'DOW'} . "\n"; - print " " . $href->{'STARTTIME'} . "\n"; - print " " . $href->{'LENGTH'} . "\n"; - } - print " \n"; - } - print "\n"; -} diff --git a/listshows.cgi b/listshows.cgi new file mode 100755 index 0000000..7ef0bcf --- /dev/null +++ b/listshows.cgi @@ -0,0 +1,66 @@ +#!/usr/bin/perl + +use strict; +use CGI; +use File::Basename; +use lib dirname( __FILE__ ) . '/lib'; +use rddb; + +binmode(STDIN, ":utf8"); +binmode(STDOUT, ":utf8"); +binmode(STDERR, ":utf8"); + +my $status = 'ERROR'; +my $errorstring = 'unknown'; +my $responsecode = 500; +my @dropboxes = (); + +my $q = CGI->new; +my $username = $q->param('LOGIN_NAME'); +my $token = $q->param('PASSWORD'); + +my $dbh; +($dbh, $status, $errorstring) = rddb::opendb(); +if(defined $dbh) { + my $result; + ($result, $status, $errorstring) = rddb::check_token($dbh, $username, $token); + if($result == 1) { + $responsecode = 200; + @dropboxes = rddb::get_dropboxes($dbh, $username); + } elsif($result == 0) { + $responsecode = 403; + } else { + $responsecode = 500; + } + rddb::closedb($dbh); +} + +print "Content-type: application/xml; charset=UTF-8\n\n"; + +if($responsecode != 200) { + print "\n"; + print " " . $responsecode . "\n"; + print " " . $errorstring . "\n"; + print "\n"; +} else { + print "\n"; + for my $href (@dropboxes) { + print " \n"; + print " " . $href->{'GROUP'} . "\n"; + print " " . $href->{'GROUPDESC'} . "\n"; + print " " . $href->{'TYPE'} . "\n"; + print " " . $href->{'SHOWID'} . "\n"; + print " " . $href->{'NORMLEVEL'} . "\n"; + print " " . $href->{'TRIMLEVEL'} . "\n"; + print " " . $href->{'PARAM'} . "\n"; + if($href->{'TYPE'} eq "show") { + print " " . $href->{'SHOWTITLE'} . "\n"; + print " " . $href->{'RHYTHM'} . "\n"; + print " " . $href->{'DOW'} . "\n"; + print " " . $href->{'STARTTIME'} . "\n"; + print " " . $href->{'LENGTH'} . "\n"; + } + print " \n"; + } + print "\n"; +} -- cgit v0.10.2