-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfirmware-download.php
49 lines (43 loc) · 1.15 KB
/
firmware-download.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once "config.inc.php";
$router=$_REQUEST["router"];
$fileExtension = '';
$baseurl="./";
switch ($_REQUEST["type"]) {
case '0':
$type = 'factory';
break;
case '1':
$type = 'sysupgrade';
$fileExtension = '-sysupgrade';
break;
default:
$type = 'factory';
}
switch ($_REQUEST["choose_comunity"]) {
case '0':
$community = 'notset';
break;
case '1':
$community = 'nordlab';
break;
default:
$community = 'notset';
}
$router = $_REQUEST["router"];
if($router === '-1') {
backlink('Bitte wähle eine Router aus. Den genauen Namen und die Version deines Routers findest du auf seiner Unterseite.');
} else{
if($community == 'notset'){
backlink('Bitte gib eine Comunity an.');
}
else {
$href=$baseurl.'media/firmware/' . $community . '/' . $type . '/' . $firmware_prefix . $router . $fileExtension . '.bin';
header('Location: '.$href);
echo '<a href="'.$href.'">redirecting</a>';
}
}
function backlink($t){
echo "$t<br>\n";
echo "<br><a href=" . $_SERVER["referer"] . ">zurück</a>\n";
}