Хранилища Subversion ant

Редакция

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

Редакция 209 Редакция 217
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 * Project:     Ant: sources.list generator
4
 * Project:     Ant: sources.list generator
5
 * File:        classic.php
5
 * File:        classic.php
6
 *
6
 *
7
 * This application is free software; you can redistribute it and/or
7
 * This application is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
11
 *
12
 * This application is distributed in the hope that it will be useful,
12
 * This application is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
15
 * Lesser General Public License for more details.
16
 *
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library; if not, write to the Free Software
18
 * License along with this library; if not, write to the Free Software
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 *
20
 *
21
 */
21
 */
22
22
23
23
24
require_once dirname(__FILE__)."/lib/init.php";
24
require_once dirname(__FILE__)."/lib/init.php";
25
$status = $secure->wrapInt($_GET["step"]);
25
$status = $secure->wrapInt($_GET["step"]);
26
$dist   = $secure->wrapInt($_GET["d"]);
26
$dist   = $secure->wrapInt($_GET["d"]);
27
$vers   = $secure->wrapInt($_GET["v"]);
27
$vers   = $secure->wrapInt($_GET["v"]);
-
 
28
$reps   = $_GET["r"];
28
29
29
$query =& $db->query("SELECT * FROM distribution");
30
$query =& $db->query("SELECT * FROM distribution");
30
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
31
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
31
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".$secure->stripStr($data["distua"])."'>".$secure->stripStr($data["distname"])."</span></p>\n";
32
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".$secure->stripStr($data["distua"])."'>".$secure->stripStr($data["distname"])."</span></p>\n";
32
}
33
}
33
34
34
if (!isset($status)) { $status = 0; };
35
if (!isset($status)) { $status = 0; };
35
36
36
if (isset($dist)) {
37
if (isset($dist)) {
37
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
38
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
38
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
39
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
39
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
40
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
40
                if ($version["vname"]!="") {
41
                if ($version["vname"]!="") {
41
                        $distname = "&#8220;".$secure->stripStr($version["vname"])."&#8221;";
42
                        $distname = "&#8220;".$secure->stripStr($version["vname"])."&#8221;";
42
                } else {
43
                } else {
43
                        $distname = "";
44
                        $distname = "";
44
                }
45
                }
45
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".$secure->stripStr($version["distua"])."'>".$secure->stripStr($version["distname"])." ".$secure->stripStr($version["version"])." ".$distname."</span></p>\n";
46
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".$secure->stripStr($version["distua"])."'>".$secure->stripStr($version["distname"])." ".$secure->stripStr($version["version"])." ".$distname."</span></p>\n";
46
        }
47
        }
47
}
48
}
48
49
49
if ($status==2)
50
if ($status==2)
50
{
51
{
-
 
52
        $repos = "";
51
        $repos=$core->getAddsRepList($dist,$vers,$db);
53
        $repoz=$core->getRepList($dist,$vers,$db);
-
 
54
        for($i=0;$i<count($repoz[0]);$i++) {
-
 
55
        $repos.="<input type='hidden' name='d' value='".$dist."'><input type='hidden' name='v' value='".$vers."'>";
-
 
56
        if ($resinfo["defaultrep"]==true){$ch="checked";} else{$ch="";}
-
 
57
        $repos.="<input type='checkbox' name='r[]' ".$ch." value='".$repoz[0][$i]."'>".$repoz[1][$i]." <em>(".$repoz[2][$i].")</em><br>";
-
 
58
        };
52
}
59
}
53
60
54
if ($status==3) {
61
if ($status==3) {
55
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
62
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
56
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
63
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
57
64
58
        $distname = "";
65
        $distname = "";
59
        if ($infodist["vname"]!="") {
66
        if ($infodist["vname"]!="") {
60
                $distname = "&#8220;".$secure->stripStr($infodist["vname"])."&#8221;";
67
                $distname = "&#8220;".$secure->stripStr($infodist["vname"])."&#8221;";
61
        }
68
        }
62
        $info = "<h2>Доступные репозитории для <em class='".$secure->stripStr($infodist["distua"])."-em'>".$secure->stripStr($infodist["distname"])." ".$secure->stripStr($infodist["version"])." ".$distname."</em></h2>";
69
        $info = "<h2>Репозитории для <em class='".$secure->stripStr($infodist["distua"])."-em'>".$secure->stripStr($infodist["distname"])." ".$secure->stripStr($infodist["version"])." ".$distname."</em></h2>";
63
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
70
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
64
        $result .= $core->getRepList($dist,$vers,$db);
71
        $result .= $core->getSourceList($dist,$vers,$reps,$db);
65
        $result .= "</pre>";
72
        $result .= "</pre>";
66
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
73
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
67
}
74
}
68
75
69
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
76
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
70
$smarty->assign('status',$status);
77
$smarty->assign('status',$status);
71
$smarty->assign('linux',$linux);
78
$smarty->assign('linux',$linux);
72
$smarty->assign('repos',$repos);
79
$smarty->assign('repos',$repos);
73
$smarty->assign('version',$distvers);
80
$smarty->assign('version',$distvers);
74
$smarty->assign('result',$result);
81
$smarty->assign('result',$result);
75
$smarty->assign('antversion',$core->getSetting('version',$db));
82
$smarty->assign('antversion',$core->getSetting('version',$db));
76
$smarty->assign('title',$core->getSetting('codename',$db));
83
$smarty->assign('title',$core->getSetting('codename',$db));
77
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
84
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
78
$smarty->assign('style',$core->getCSSList($db));
85
$smarty->assign('style',$core->getCSSList($db));
79
86
80
$smarty->display('classic.tpl');
87
$smarty->display('classic.tpl');
81
88
82
?>
89
?>
83
 
90