Редакция 207 | Редакция 219 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 207 | Редакция 217 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | 2 | ||
3 | /**
|
3 | /**
|
4 | * Project: Ant: sources.list generator
|
4 | * Project: Ant: sources.list generator
|
5 | * File: core.php
|
5 | * File: core.php
|
6 | *
|
6 | *
|
7 | * This library is free software; you can redistribute it and/or
|
7 | * This library 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 library is distributed in the hope that it will be useful,
|
12 | * This library 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 | class Core { |
24 | class Core { |
25 | 25 | ||
26 | function getRepList($distro,$version,$dblink) { |
26 | function getSourceList($distro,$version,$repos,$dblink) { |
27 | // Fetch settings
|
27 | // Fetch settings
|
28 | $query =& $dblink->query("SELECT * FROM settings"); |
28 | $query =& $dblink->query("SELECT * FROM settings"); |
29 | $settings = array(); |
29 | $settings = array(); |
30 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
30 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
31 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
31 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
32 | }; |
32 | }; |
33 | // Fetch info about distribution
|
33 | // Fetch info about distribution
|
34 | $query =& $dblink->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='$distro' AND v.version_id='$version'"); |
34 | $query =& $dblink->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='$distro' AND v.version_id='$version'"); |
35 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
35 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
36 | // Fetch repos
|
36 | // Fetch repos
|
37 | $repos=$_GET["r"]; |
- | |
38 | $porigid = -1; // Previous origin id |
37 | $porigid = -1; // Previous origin id |
39 | 38 | ||
40 | for($i=0;$i<count($repos);$i++) { |
39 | for($i=0;$i<count($repos);$i++) { |
41 | $id=$_GET["r"][$i]; |
40 | $id=$repos[$i]; |
42 | // Fetch info about origin and scheme
|
41 | // Fetch info about origin and scheme
|
43 | $sql =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE r.rep_id=".$id); |
42 | $sql =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE r.rep_id=".$id); |
44 | $sql->fetchInto($resinfo, DB_FETCHMODE_ASSOC); |
43 | $sql->fetchInto($resinfo, DB_FETCHMODE_ASSOC); |
45 | $repscheme = stripslashes($resinfo["scheme"]); |
44 | $repscheme = stripslashes($resinfo["scheme"]); |
46 | // Fetch info about sections
|
45 | // Fetch info about sections
|
47 | $querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$resinfo[rep_id]'"); |
46 | $querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$resinfo[rep_id]'"); |
48 | $sections = ""; |
47 | $sections = ""; |
49 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
48 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
50 | $sections .= stripslashes($section["sectname"])." "; |
49 | $sections .= stripslashes($section["sectname"])." "; |
51 | }
|
50 | }
|
52 | // Conversion scheme
|
51 | // Conversion scheme
|
53 | $repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
52 | $repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
54 | $repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
53 | $repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
55 | $repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
54 | $repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
56 | $repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
55 | $repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
57 | $repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
56 | $repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
58 | $repscheme = str_replace("{SECT}",$sections,$repscheme); |
57 | $repscheme = str_replace("{SECT}",$sections,$repscheme); |
59 | $repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
58 | $repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
60 | // Comment if another origin
|
59 | // Comment if another origin
|
61 | if($porigid != $resinfo["orig_id"]) { |
60 | if($porigid != $resinfo["orig_id"]) { |
62 | $result .= "### ".$resinfo["origin"]." ( ".$resinfo["desk"]." ) - ".$resinfo["homeurl"]." ###\n"; |
61 | $result .= "### ".$resinfo["origin"]." ( ".$resinfo["desk"]." ) - ".$resinfo["homeurl"]." ###\n"; |
63 | }
|
62 | }
|
64 | $porigid = $resinfo["orig_id"]; |
63 | $porigid = $resinfo["orig_id"]; |
65 | // Result
|
64 | // Result
|
66 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
65 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
67 | }
|
66 | }
|
68 | return $result; |
67 | return $result; |
69 | }
|
68 | }
|
70 | 69 | ||
71 | // For backward compatibility for Modern and Telepathy interfaces. Current getRepList() crushed his.
|
70 | // For backward compatibility for Modern and Telepathy interfaces. Current getRepList() crushed his.
|
72 | function getRepListLegacy($distro,$version,$dblink) { |
71 | function getRepListLegacy($distro,$version,$dblink) { |
73 | $query =& $dblink->query("SELECT * FROM settings"); |
72 | $query =& $dblink->query("SELECT * FROM settings"); |
74 | $settings = array(); |
73 | $settings = array(); |
75 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
74 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
76 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
75 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
77 | }; |
76 | }; |
78 | $query =& $dblink->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='$distro' AND v.version_id='$version'"); |
77 | $query =& $dblink->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='$distro' AND v.version_id='$version'"); |
79 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
78 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
80 | $query =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE v.ver_id='$version' ORDER BY r.rtype_id, r.scheme_id ASC"); |
79 | $query =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE v.ver_id='$version' ORDER BY r.rtype_id, r.scheme_id ASC"); |
81 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
80 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
82 | $repscheme = stripslashes($resinfo["scheme"]); |
81 | $repscheme = stripslashes($resinfo["scheme"]); |
83 | 82 | ||
84 | $querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE |
83 | $querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE |
85 | r.rep_id='$resinfo[rep_id]'"); |
84 | r.rep_id='$resinfo[rep_id]'"); |
86 | $sections = ""; |
85 | $sections = ""; |
87 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
86 | while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
88 | $sections .= stripslashes($section["sectname"])." "; |
87 | $sections .= stripslashes($section["sectname"])." "; |
89 | }
|
88 | }
|
90 | 89 | ||
91 | $repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
90 | $repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
92 | $repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
91 | $repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
93 | $repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
92 | $repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
94 | $repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
93 | $repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
95 | $repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
94 | $repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
96 | $repscheme = str_replace("{SECT}",$sections,$repscheme); |
95 | $repscheme = str_replace("{SECT}",$sections,$repscheme); |
97 | $repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
96 | $repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
98 | 97 | ||
99 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
98 | $result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
100 | }
|
99 | }
|
101 | return $result; |
100 | return $result; |
102 | }
|
101 | }
|
103 | 102 | ||
104 | function getInfo($message,$dblink){ |
103 | function getInfo($message,$dblink){ |
105 | $answer = array(); |
104 | $answer = array(); |
106 | 105 | ||
107 | if (preg_match("/linux/i",$message)) { |
106 | if (preg_match("/linux/i",$message)) { |
108 | $dist_id = 0; |
107 | $dist_id = 0; |
109 | $dist_info = ""; |
108 | $dist_info = ""; |
110 | $vers_id = 0; |
109 | $vers_id = 0; |
111 | $vers_info = ""; |
110 | $vers_info = ""; |
112 | $qd =& $dblink->query("SELECT * FROM distribution"); |
111 | $qd =& $dblink->query("SELECT * FROM distribution"); |
113 | while ($qd->fetchInto($res, DB_FETCHMODE_ASSOC)) { |
112 | while ($qd->fetchInto($res, DB_FETCHMODE_ASSOC)) { |
114 | if (preg_match("/".stripslashes($res["distua"])."/i",$message)) { |
113 | if (preg_match("/".stripslashes($res["distua"])."/i",$message)) { |
115 | $dist_id = $res["dist_id"]; |
114 | $dist_id = $res["dist_id"]; |
116 | $dist_info = stripslashes($res["distname"]); |
115 | $dist_info = stripslashes($res["distname"]); |
117 | $qv =& $dblink->query("SELECT * FROM version WHERE dist_id='$dist_id'"); |
116 | $qv =& $dblink->query("SELECT * FROM version WHERE dist_id='$dist_id'"); |
118 | while($qv->fetchInto($rev, DB_FETCHMODE_ASSOC)) { |
117 | while($qv->fetchInto($rev, DB_FETCHMODE_ASSOC)) { |
119 | if (preg_match("/".stripslashes($rev["vcodename"])."/i",$message)) { |
118 | if (preg_match("/".stripslashes($rev["vcodename"])."/i",$message)) { |
120 | $vers_id = $rev["version_id"]; |
119 | $vers_id = $rev["version_id"]; |
121 | $vers_info = stripslashes($rev["version"])." “".stripslashes($rev["vname"])."”"; |
120 | $vers_info = stripslashes($rev["version"])." “".stripslashes($rev["vname"])."”"; |
122 | }
|
121 | }
|
123 | }
|
122 | }
|
124 | }
|
123 | }
|
125 | }
|
124 | }
|
126 | $answer[] = "Linux"; |
125 | $answer[] = "Linux"; |
127 | $answer[] = "Судя по всему у Вас операционная система "; |
126 | $answer[] = "Судя по всему у Вас операционная система "; |
128 | if ($dist_id!=0) { |
127 | if ($dist_id!=0) { |
129 | $answer[] = $dist_id; |
128 | $answer[] = $dist_id; |
130 | $answer[] = $dist_info; |
129 | $answer[] = $dist_info; |
131 | }
|
130 | }
|
132 | if ($vers_id!=0) { |
131 | if ($vers_id!=0) { |
133 | $answer[] = $vers_id; |
132 | $answer[] = $vers_id; |
134 | $answer[] = $vers_info; |
133 | $answer[] = $vers_info; |
135 | }
|
134 | }
|
136 | 135 | ||
137 | } else { |
136 | } else { |
138 | $answer[] = "unknown"; |
137 | $answer[] = "unknown"; |
139 | $answer[] = "Ресурс рассчитан явно не на Вашу операционную систему!"; |
138 | $answer[] = "Ресурс рассчитан явно не на Вашу операционную систему!"; |
140 | }
|
139 | }
|
141 | 140 | ||
142 | return $answer; |
141 | return $answer; |
143 | }
|
142 | }
|
144 | 143 | ||
145 | function getInterfacesList($current,$dblink) { |
144 | function getInterfacesList($current,$dblink) { |
146 | $url = parse_url($current); |
145 | $url = parse_url($current); |
147 | $path = array(); |
146 | $path = array(); |
148 | $path = split("/",$url["path"]); |
147 | $path = split("/",$url["path"]); |
149 | $currentIF = str_replace(".php","",$path[count($path)-1]); |
148 | $currentIF = str_replace(".php","",$path[count($path)-1]); |
150 | $req =& $dblink->query("SELECT * FROM interfaces WHERE interface NOT LIKE '$currentIF'"); |
149 | $req =& $dblink->query("SELECT * FROM interfaces WHERE interface NOT LIKE '$currentIF'"); |
151 | $iflist = "<a href='./'>Интерфейсы</a>: "; |
150 | $iflist = "<a href='./'>Интерфейсы</a>: "; |
152 | while ($req->fetchInto($if, DB_FETCHMODE_ASSOC)) { |
151 | while ($req->fetchInto($if, DB_FETCHMODE_ASSOC)) { |
153 | $iflist .= "<a href='./".stripslashes($if["interface"]).".php'>".strtolower(stripslashes($if["interfaceinfo"]))."</a>, "; |
152 | $iflist .= "<a href='./".stripslashes($if["interface"]).".php'>".strtolower(stripslashes($if["interfaceinfo"]))."</a>, "; |
154 | }
|
153 | }
|
155 | $iflist = substr($iflist, 0, strlen($iflist)-2); |
154 | $iflist = substr($iflist, 0, strlen($iflist)-2); |
156 | return $iflist; |
155 | return $iflist; |
157 | }
|
156 | }
|
158 | 157 | ||
159 | function getCSSList($dblink) { |
158 | function getCSSList($dblink) { |
160 | $req =& $dblink->query("SELECT * FROM distribution"); |
159 | $req =& $dblink->query("SELECT * FROM distribution"); |
161 | if ($req->numRows()>0) { |
160 | if ($req->numRows()>0) { |
162 | $css = "<style type=\"text/css\">\n"; |
161 | $css = "<style type=\"text/css\">\n"; |
163 | while ($req->fetchInto($dist, DB_FETCHMODE_ASSOC)) { |
162 | while ($req->fetchInto($dist, DB_FETCHMODE_ASSOC)) { |
164 | if ($dist["distlogo"]) { |
163 | if ($dist["distlogo"]) { |
165 | $css .= ".".stripslashes($dist["distua"])." { display: inline; padding-left: 15px; background: transparent url(./img/logo/".stripslashes($dist["distua"]).".png) top left no-repeat; }\n"; |
164 | $css .= ".".stripslashes($dist["distua"])." { display: inline; padding-left: 15px; background: transparent url(./img/logo/".stripslashes($dist["distua"]).".png) top left no-repeat; }\n"; |
166 | $css .= ".".stripslashes($dist["distua"])."-em { display: inline; padding-left: 30px; background: transparent url(./img/logo/".stripslashes($dist["distua"])."-em.png) top left no-repeat; }\n"; |
165 | $css .= ".".stripslashes($dist["distua"])."-em { display: inline; padding-left: 30px; background: transparent url(./img/logo/".stripslashes($dist["distua"])."-em.png) top left no-repeat; }\n"; |
167 | } else { |
166 | } else { |
168 | $css .= ""; |
167 | $css .= ""; |
169 | }
|
168 | }
|
170 | }
|
169 | }
|
171 | $css .= "</style>"; |
170 | $css .= "</style>"; |
172 | } else { |
171 | } else { |
173 | $css = ""; |
172 | $css = ""; |
174 | }
|
173 | }
|
175 | return $css; |
174 | return $css; |
176 | }
|
175 | }
|
177 | 176 | ||
178 | function getSetting($setting, $dblink) { |
177 | function getSetting($setting, $dblink) { |
179 | $query =& $dblink->query("SELECT * FROM settings WHERE opt LIKE '".$setting."'"); |
178 | $query =& $dblink->query("SELECT * FROM settings WHERE opt LIKE '".$setting."'"); |
180 | $query->fetchInto($sett, DB_FETCHMODE_ASSOC); |
179 | $query->fetchInto($sett, DB_FETCHMODE_ASSOC); |
181 | return stripslashes($sett["optvalue"]); |
180 | return stripslashes($sett["optvalue"]); |
182 | }
|
181 | }
|
183 | 182 | ||
184 | function getUUID($param) { |
183 | function getUUID($param) { |
185 | $param_s = md5($param); |
184 | $param_s = md5($param); |
186 | $time_low = bin2hex(substr($param_s,0, 4)); |
185 | $time_low = bin2hex(substr($param_s,0, 4)); |
187 | $time_mid = bin2hex(substr($param_s,4, 2)); |
186 | $time_mid = bin2hex(substr($param_s,4, 2)); |
188 | $time_hi_and_version = bin2hex(substr($param_s,6, 2)); |
187 | $time_hi_and_version = bin2hex(substr($param_s,6, 2)); |
189 | $clock_seq_hi_and_reserved = bin2hex(substr($param_s,8, 2)); |
188 | $clock_seq_hi_and_reserved = bin2hex(substr($param_s,8, 2)); |
190 | $node = bin2hex(substr($param_s,10, 6)); |
189 | $node = bin2hex(substr($param_s,10, 6)); |
191 | 190 | ||
192 | $time_hi_and_version = hexdec($time_hi_and_version); |
191 | $time_hi_and_version = hexdec($time_hi_and_version); |
193 | $time_hi_and_version = $time_hi_and_version >> 4; |
192 | $time_hi_and_version = $time_hi_and_version >> 4; |
194 | $time_hi_and_version = $time_hi_and_version | 0x4000; |
193 | $time_hi_and_version = $time_hi_and_version | 0x4000; |
195 | 194 | ||
196 | $clock_seq_hi_and_reserved = hexdec($clock_seq_hi_and_reserved); |
195 | $clock_seq_hi_and_reserved = hexdec($clock_seq_hi_and_reserved); |
197 | $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2; |
196 | $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2; |
198 | $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000; |
197 | $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000; |
199 | 198 | ||
200 | return sprintf('%08s-%04s-%04x-%04x-%012s',$time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node); |
199 | return sprintf('%08s-%04s-%04x-%04x-%012s',$time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node); |
201 | }
|
200 | }
|
202 | 201 | ||
203 | 202 | ||
204 | function getAddsRepList($distro,$version,$dblink) { |
203 | function getRepList($distro,$version,$dblink) { |
205 | $query =& $dblink->query("SELECT * FROM settings"); |
- | |
206 | $settings = array(); |
- | |
207 | while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
- | |
208 | $settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
- | |
209 | }; |
- | |
210 | $query =& $dblink->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='$distro' AND v.version_id='$version'"); |
- | |
211 | $query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
- | |
212 | $query =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE v.ver_id='$version' ORDER BY r.rtype_id, r.scheme_id ASC"); |
204 | $query =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE v.ver_id='$version' ORDER BY r.rtype_id, r.scheme_id ASC"); |
213 | $result.="<input type='hidden' name='d' value='".$_GET["d"]."'><input type='hidden' name='v' value='".$_GET["v"]."'>"; |
- | |
- | 205 | $i=-1; |
|
214 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
206 | while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) { |
- | 207 | $i++; |
|
- | 208 | $res[0][$i]=$resinfo["rep_id"]; |
|
- | 209 | $res[1][$i]=$resinfo["repname"]; |
|
215 | if ($resinfo["default"]==true){$ch="checked";} else{$ch="";} |
210 | $res[2][$i]=$resinfo["repdescribe"]; |
216 | $result.="<input type='checkbox' name='r[]' ".$ch." value='".$resinfo["rep_id"]."'>".$resinfo["repname"]." <em>(".$resinfo["repdescribe"].")</em><br>"; |
211 | $res[3][$i]=$resinfo["defaultrep"]; |
217 | }
|
212 | }
|
218 | return $result; |
213 | return $res; |
219 | }
|
214 | }
|
220 | }
|
215 | }
|
221 | ?>
|
216 | ?>
|
222 | 217 |