Хранилища Subversion ant

Редакция

Редакция 680 | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

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