Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 873 → Rev 874

/website/repo/index.php
116,7 → 116,7
 
// is action valid?
 
if (($a !== 'search') && ($a !== 'checkup') && ($a !== 'pull')) {
if (($a !== 'search') && ($a !== 'checkup') && ($a !== 'pull') && ($a !== 'pullsrc')) {
http_response_code(404);
echo "ERROR: invalid action\r\n";
exit(0);
133,9 → 133,9
}
 
 
// pull action
// pull or pullsrc action (svp / zip)
 
if ($a === 'pull') {
if (($a === 'pull') || ($a === 'pullsrc')) {
$fname = false;
if (empty($v)) { // take first version (that's the preferred one)
$fname = array_key_first($db[$p]['versions']);
149,9 → 149,21
}
}
if (file_exists($fname)) {
header('Content-Disposition: attachment; filename="' . $fname);
header('Content-Type: application/octet-stream');
readfile($fname);
if ($a === 'pullsrc') { // is it about source?
$fname = preg_replace('/svp$/', 'zip', $fname); // replace *.svp by *.zip
if (file_exists($fname)) {
header('Content-Disposition: attachment; filename="' . $fname);
header('Content-Type: application/octet-stream');
readfile($fname);
} else {
http_response_code(404);
echo get_msg('PKG_NO_SRC', $lang) . "\r\n";
}
} else {
header('Content-Disposition: attachment; filename="' . $fname);
header('Content-Type: application/octet-stream');
readfile($fname);
}
} else {
http_response_code(404);
echo get_msg('PKG_NOT_FOUND', $lang) . "\r\n";
/website/repo/lang.php
34,6 → 34,10
$MSG['PKG_NOT_FOUND']['de'] = 'FEHLER: Paket nicht auf dem Server gefunden';
$MSG['PKG_NOT_FOUND']['pl'] = 'BŁĄD: Nie znaleziono pakietu na serwerze';
 
$MSG['PKG_NO_SRC']['en'] = 'ERROR: no sources are available for this package ';
$MSG['PKG_NO_SRC']['de'] = 'KAPUTT: nicht Quellekode gegenwart fur das Paket';
$MSG['PKG_NO_SRC']['pl'] = 'BŁĄD: brak źródeł dla tego pakietu';
 
$MSG['VER']['en'] = 'ver:';
$MSG['VER']['de'] = 'Ver:';
$MSG['VER']['pl'] = 'wer:';