Merge branch 'master' of github.com:seblucas/cops

This commit is contained in:
George Litos 2015-10-29 19:46:06 +02:00
commit 62a7034ab8
4 changed files with 41 additions and 25 deletions

View File

@ -15,10 +15,17 @@ DirectoryIndex index.php
###########################################
# On WAMP one user had to add this line in his httpd.conf
# None of the abose was working
# None of the above was working
###########################################
#XSendFilePath <YourCalibrePath>
###########################################
# If you want to use user based configuration with
# apache 2.4 + php-fpm enable this
# https://github.com/seblucas/cops/issues/213
###########################################
#SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&db=$2&type=epub [L]

3
README
View File

@ -39,6 +39,9 @@ If you want to use the OPDS feed don't forget to specify feed.php at the end of
On any Debian base Linux you can use :
aptitude install php5-gd php5-sqlite php5-json
On Centos you may have to add :
yum install php-xml
= Install =
1. Extract the zip file to a folder in web space (visible to the web server).

View File

@ -1201,6 +1201,9 @@ abstract class Base
global $config;
if (self::isMultipleDatabaseEnabled ()) {
if (is_null ($database)) $database = GetUrlParam (DB, 0);
if (!is_null($database) && !preg_match('/^\d+$/', $database)) {
return self::error ($database);
}
$array = array_keys ($config['calibre_directory']);
return $array[$database];
}
@ -1211,6 +1214,9 @@ abstract class Base
global $config;
if (self::isMultipleDatabaseEnabled ()) {
if (is_null ($database)) $database = GetUrlParam (DB, 0);
if (!is_null($database) && !preg_match('/^\d+$/', $database)) {
return self::error ($database);
}
$array = array_values ($config['calibre_directory']);
return $array[$database];
}
@ -1222,11 +1228,11 @@ abstract class Base
return self::getDbDirectory ($database) .'metadata.db';
}
private static function error () {
private static function error ($database) {
if (php_sapi_name() != "cli") {
header("location: checkconfig.php?err=1");
}
throw new Exception('Database not found.');
throw new Exception("Database <{$database}> not found.");
}
public static function getDb ($database = NULL) {
@ -1238,10 +1244,10 @@ abstract class Base
self::$db->sqliteCreateFunction ('normAndUp', 'normAndUp', 1);
}
} else {
self::error ();
self::error ($database);
}
} catch (Exception $e) {
self::error ();
self::error ($database);
}
}
return self::$db;

View File

@ -17,12 +17,12 @@
"bookword.one":"1 boek",
"bookword.title":"Boeken",
"cog.alternate":"Zoeken, sorteren en filters",
"content.series":"Series:",
"content.series.data":"Boek {0} in de {1} serie",
"content.series":"Reeksen:",
"content.series.data":"Boek {0} in de {1} reeks",
"content.summary":"Samenvatting",
"customize.email":"E-mailadres ontvanger (om boeken te versturen per elektronische post)",
"customize.fancybox":"Gebruik een Lightbox",
"customize.filter":"Zet filteren op tag aan",
"customize.filter":"Zet filteren op label aan",
"customize.ignored":"Niet opgenomen categorieën",
"customize.paging":"Maximaal aantal boeken per pagina (-1 voor oneindig aantal)",
"customize.style":"Opmaak COPS gebruikersomgeving",
@ -62,28 +62,28 @@
"search.result.author":"Zoekresultaat voor *{0}* in auteurs",
"search.result.book":"Zoekresultaat voor *{0}* in boeken",
"search.result.publisher":"Zoekresultaat voor *{0}* in uitgevers",
"search.result.series":"Zoekresultaat voor *{0}* in series",
"search.result.tag":"Zoekresultaat voor *{0}* in tags",
"search.result.series":"Zoekresultaat voor *{0}* in reeksen",
"search.result.tag":"Zoekresultaat voor *{0}* in labels",
"search.sortorder.asc":"A-Z",
"search.sortorder.desc":"Z-A",
"series.alphabetical.many":"Alfabetische index van {0} series",
"series.alphabetical.none":"Alfabetische index van absoluut geen enkele serie",
"series.alphabetical.one":"Alfabetische index van 1 serie",
"series.title":"Series",
"seriesword.many":"{0} series",
"seriesword.none":"Geen series",
"seriesword.one":"1 serie",
"series.alphabetical.many":"Alfabetische index van {0} reeksen",
"series.alphabetical.none":"Alfabetische index van absoluut geen enkele reeks",
"series.alphabetical.one":"Alfabetische index van 1 reeks",
"series.title":"Reeksen",
"seriesword.many":"{0} reeksen",
"seriesword.none":"Geen reeks",
"seriesword.one":"1 reeks",
"sort.alternate":"Sorteren",
"splitByLetter.book.other":"Andere boeken",
"splitByLetter.letter":"{0} beginnend met {1}",
"tags.alphabetical.many":"Alfabetische index van {0} tags",
"tags.alphabetical.none":"Alfabetische index van absoluut geen enkele tag",
"tags.alphabetical.one":"Alfabetische index van 1 tag",
"tags.title":"Tags",
"tagword.many":"{0} tags",
"tagword.none":"Geen tag",
"tagword.one":"1 tag",
"tagword.title":"Tags",
"tags.alphabetical.many":"Alfabetische index van {0} labels",
"tags.alphabetical.none":"Alfabetische index van absoluut geen enkele label",
"tags.alphabetical.one":"Alfabetische index van 1 label",
"tags.title":"Labels",
"tagword.many":"{0} labels",
"tagword.none":"Geen label",
"tagword.one":"1 label",
"tagword.title":"Labels",
"languages.abk":"Abchazisch",
"languages.aaf":"Afar",
"languages.afr":"Afrikaans",