Редакция 459 | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 459 | Редакция 472 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | 2 | ||
3 | /**
|
3 | /**
|
4 | *
|
4 | *
|
5 | * Codename: ant-ng - generator of sources.list for Debian and
|
5 | * Codename: ant-ng - generator of sources.list for Debian and
|
6 | * distributives, based on Debian
|
6 | * distributives, based on Debian
|
7 | * http://alex-w.org.ru/p/antng/
|
7 | * http://alex-w.org.ru/p/antng/
|
8 | *
|
8 | *
|
9 | * Copyright (c) 2009 Alexander Wolf
|
9 | * Copyright (c) 2009 Alexander Wolf
|
10 | * Dual licensed under the MIT and GNU LGPL licenses.
|
10 | * Dual licensed under the MIT and GNU LGPL licenses.
|
11 | * http://alex-w.org.ru/p/antng/license
|
11 | * http://alex-w.org.ru/p/antng/license
|
12 | *
|
12 | *
|
13 | */
|
13 | */
|
14 | 14 | ||
15 | require_once dirname(__FILE__)."/init.php"; |
15 | require_once dirname(__FILE__)."/init.php"; |
16 | 16 | ||
17 | // for index.php
|
17 | // for index.php
|
18 | $stepID = $secure->checkInt($_GET["step"]); |
18 | $stepID = $secure->checkInt($_GET["step"]); |
19 | $distID = $secure->checkInt($_GET["d"]); |
19 | $distID = $secure->checkInt($_GET["d"]); |
20 | $versID = $secure->checkInt($_GET["v"]); |
20 | $versID = $secure->checkInt($_GET["v"]); |
21 | // for manager.php
|
21 | // for manager.php
|
22 | $modeID = $secure->checkInt($_GET["mode"]); |
22 | $modeID = $secure->checkInt($_GET["mode"]); |
23 | $actID = $secure->checkInt($_GET["action"]); |
23 | $actID = $secure->checkInt($_GET["action"]); |
24 | 24 | ||
25 | if (preg_match("/konqueror\/(?P<major>\d+)\.(?P<minor>\d+)/i",$_SERVER["HTTP_USER_AGENT"],$konq)) { |
25 | if (preg_match("/konqueror\/(?P<major>\d+)\.(?P<minor>\d+)/i",$_SERVER["HTTP_USER_AGENT"],$konq)) { |
26 | if (($konq["major"]<4) || ($konq["major"]==4 && $konq["minor"]<3)) { |
26 | if (($konq["major"]<4) || ($konq["major"]==4 && $konq["minor"]<3)) { |
27 | $dist_konq = $secure->checkStr($_GET["d"]); |
27 | $dist_konq = $secure->checkStr($_GET["d"]); |
28 | $query = "SELECT dist_id FROM ".PREFIX."distribution WHERE distname LIKE '".$dist_konq."'"; |
28 | $query = "SELECT dist_id FROM ".PREFIX."distribution WHERE distname LIKE '".$dist_konq."'"; |
29 | $fix = $db->query($query); |
29 | $fix = $db->query($query); |
30 | $fix->fetchInto($dfix); |
30 | $fix->fetchInto($dfix); |
31 | $distID = $dfix["dist_id"]; |
31 | $distID = $dfix["dist_id"]; |
32 | $vers_konq = $secure->checkStr($_GET["v"]); |
32 | $vers_konq = $secure->checkStr($_GET["v"]); |
33 | list($v,$n) = split(" ",$vers_konq); |
33 | list($v,$n) = split(" ",$vers_konq); |
34 | $query = "SELECT version_id FROM ".PREFIX."version WHERE version LIKE '".$v."' AND vname LIKE '".$n."'"; |
34 | $query = "SELECT version_id FROM ".PREFIX."version WHERE version LIKE '".$v."' AND vname LIKE '".$n."'"; |
35 | $fix = $db->query($query); |
35 | $fix = $db->query($query); |
36 | $fix->fetchInto($dfix); |
36 | $fix->fetchInto($dfix); |
37 | $versID = $dfix["version_id"]; |
37 | $versID = $dfix["version_id"]; |
38 | }
|
38 | }
|
39 | }
|
39 | }
|
40 | 40 | ||
41 | header('Content-Type: text/html; charset=utf-8'); |
41 | header('Content-Type: text/html; charset=utf-8'); |
42 | 42 | ||
43 | switch($stepID) { |
43 | switch($stepID) { |
44 | case '1': |
44 | case '1': |
45 | $result = $core->showDistVersionsList("version", $distID, "json"); |
45 | $result = $core->showDistVersionsList("version", $distID, "json"); |
46 | break; |
46 | break; |
47 | case '2': |
47 | case '2': |
48 | $result = "<form action='./get.php' method='post'>"; |
48 | $result = "<form action='./get.php' method='post'>"; |
49 | $result .= "<input type='hidden' name='d' value='".$distID."'>\n"; |
49 | $result .= "<input type='hidden' name='d' value='".$distID."'>\n"; |
50 | $result .= "<input type='hidden' name='v' value='".$versID."'>\n"; |
50 | $result .= "<input type='hidden' name='v' value='".$versID."'>\n"; |
51 | $result .= $core->showBranchesList($versID, "html"); |
51 | $result .= $core->showBranchesList($versID, "html"); |
52 | $result .= $core->showRepList($versID, 2, "html"); |
52 | $result .= $core->showRepList($versID, 2, "html"); |
53 | $result .= $core->showRepList($versID, 3, "html"); |
53 | $result .= $core->showRepList($versID, 3, "html"); |
54 | $result .= "<input type='submit' value=' Сгенерировать файл sources.list '>\n</form>"; |
54 | $result .= "<input type='submit' value=' Сгенерировать файл sources.list '>\n</form>"; |
55 | break; |
55 | break; |
56 | }
|
56 | }
|
57 | 57 | ||
58 | switch($modeID) { |
58 | switch($modeID) { |
59 | case '1': |
59 | case '1': |
60 | break; |
60 | break; |
61 | }
|
61 | }
|
62 | 62 | ||
63 | print $result; |
63 | print $result; |
64 | 64 | ||
65 | ?>
|
65 | ?>
|
66 | 66 |