Редакция 449 | Редакция 452 | К новейшей редакции | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 449 | Редакция 450 | ||
---|---|---|---|
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"]); |
|
- | 33 | list($v,$n) = split(" ",$vers_konq); |
|
- | 34 | $query = "SELECT version_id FROM ".PREFIX."version WHERE version LIKE '".$v."' AND vname LIKE '".$n."'"; |
|
- | 35 | $fix = $db->query($query); |
|
- | 36 | $fix->fetchInto($dfix); |
|
- | 37 | $versID = $dfix["version_id"]; |
|
32 | }
|
38 | }
|
33 | }
|
39 | }
|
34 | 40 | ||
35 | switch($stepID) { |
41 | switch($stepID) { |
36 | case '1': |
42 | case '1': |
37 | $result = $core->showDistVersionsList("version", $distID, "json"); |
43 | $result = $core->showDistVersionsList("version", $distID, "json"); |
38 | break; |
44 | break; |
39 | case '2': |
45 | case '2': |
40 | $result = "<form action='./get.php' method='post'>"; |
46 | $result = "<form action='./get.php' method='post'>"; |
41 | $result .= "<input type='hidden' name='d' value='".$distID."'>\n"; |
47 | $result .= "<input type='hidden' name='d' value='".$distID."'>\n"; |
42 | $result .= "<input type='hidden' name='v' value='".$versID."'>\n"; |
48 | $result .= "<input type='hidden' name='v' value='".$versID."'>\n"; |
43 | $result .= $core->showBranchesList($versID, "html"); |
49 | $result .= $core->showBranchesList($versID, "html"); |
44 | $result .= $core->showRepList($versID, 2, "html"); |
50 | $result .= $core->showRepList($versID, 2, "html"); |
45 | $result .= $core->showRepList($versID, 3, "html"); |
51 | $result .= $core->showRepList($versID, 3, "html"); |
46 | $result .= "<input type='submit' value=' Сгенерировать файл sources.list '>\n</form>"; |
52 | $result .= "<input type='submit' value=' Сгенерировать файл sources.list '>\n</form>"; |
47 | break; |
53 | break; |
48 | }
|
54 | }
|
49 | 55 | ||
50 | switch($modeID) { |
56 | switch($modeID) { |
51 | case '1': |
57 | case '1': |
52 | break; |
58 | break; |
53 | }
|
59 | }
|
54 | 60 | ||
55 | print $result; |
61 | print $result; |
56 | 62 | ||
57 | ?>
|
63 | ?>
|
58 | 64 |