Редакция 453 |
Редакция 459 |
К новейшей редакции |
Авторство |
Сравнить с предыдущей |
Последнее изменение |
Открыть журнал
| Скачать
| RSS
<?php
/**
*
* Codename: ant-ng - generator of sources.list for Debian and
* distributives, based on Debian
* http://alex-w.org.ru/p/antng/
*
* Copyright (c) 2009 Alexander Wolf
* Dual licensed under the MIT and GNU LGPL licenses.
* http://alex-w.org.ru/p/antng/license
*
*/
require_once dirname(__FILE__)."/init.php";
// for index.php
$stepID = $secure->checkInt($_GET["step"]);
$distID = $secure->checkInt($_GET["d"]);
$versID = $secure->checkInt($_GET["v"]);
// for manager.php
$modeID = $secure->checkInt($_GET["mode"]);
$actID = $secure->checkInt($_GET["action"]);
if (preg_match("/konqueror\/(?P<major>\d+)\.(?P<minor>\d+)/i",$_SERVER["HTTP_USER_AGENT"],$konq)) {
if (($konq["major"]<4) || ($konq["major"]==4 && $konq["minor"]<3)) {
$dist_konq = $secure->checkStr($_GET["d"]);
$query = "SELECT dist_id FROM ".PREFIX
."distribution WHERE distname LIKE '".$dist_konq."'";
$fix = $db->query($query);
$fix->fetchInto($dfix);
$distID = $dfix["dist_id"];
$vers_konq = $secure->checkStr($_GET["v"]);
list($v,$n) = split(" ",$vers_konq);
$query = "SELECT version_id FROM ".PREFIX
."version WHERE version LIKE '".$v."' AND vname LIKE '".$n."'";
$fix = $db->query($query);
$fix->fetchInto($dfix);
$versID = $dfix["version_id"];
}
}
header('Content-Type: text/html; charset=utf-8');
switch($stepID) {
case '1':
$result = $core->showDistVersionsList("version", $distID, "json");
break;
case '2':
$result = "<form action='./get.php' method='post'>";
$result .= "<input type='hidden' name='d' value='".$distID."'>\n";
$result .= "<input type='hidden' name='v' value='".$versID."'>\n";
$result .= $core->showBranchesList($versID, "html");
$result .= $core->showRepList($versID, 2, "html");
$result .= $core->showRepList($versID, 3, "html");
$result .= "<input type='submit' value=' Сгенерировать файл sources.list '>\n</form>";
break;
}
switch($modeID) {
case '1':
break;
}
print $result;
?>