Редакция 179 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 179 | Редакция 180 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | 2 | ||
3 | /**
|
3 | /**
|
4 | * Project: Ant: sources.list generator
|
4 | * Project: Ant: sources.list generator
|
5 | * File: process.php
|
5 | * File: process.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__)."/sign-valid.php"; |
24 | require_once dirname(__FILE__)."/sign-valid.php"; |
25 | 25 | ||
26 | $mode = abs(intval($_POST["mode"])); |
26 | $mode = abs(intval($_POST["mode"])); |
27 | $act = abs(intval($_POST["act"])); |
27 | $act = abs(intval($_POST["act"])); |
28 | 28 | ||
29 | $go = "./admin.php"; |
29 | $go = "./admin.php"; |
30 | 30 | ||
31 | switch ($mode) { |
31 | switch ($mode) { |
32 | case '0': |
32 | case '0': |
33 | break; |
33 | break; |
34 | case '1': |
34 | case '1': |
35 | switch ($act) { |
35 | switch ($act) { |
36 | case '0': |
36 | case '0': |
37 | break; |
37 | break; |
38 | case '1': |
38 | case '1': |
39 | // Добавление нового дистрибутива
|
39 | // Добавление нового дистрибутива
|
40 | $distname = mysql_real_escape_string($_POST["distName"]); |
40 | $distname = mysql_real_escape_string($_POST["distName"]); |
41 | $distua = mysql_real_escape_string($_POST["distUA"]); |
41 | $distua = mysql_real_escape_string($_POST["distUA"]); |
42 | $disttype = abs(intval($_POST["distType"])); |
42 | $disttype = abs(intval($_POST["distType"])); |
43 | 43 | ||
44 | $distlogo = 0; |
44 | $distlogo = 0; |
45 | if ($_FILES["distLOGO"]["type"]!=0) { |
45 | if ($_FILES["distLOGO"]["type"]!=0) { |
46 | $folder = dirname(__FILE__)."/img/logo/".stripslashes($distua)."-orig.png"; |
46 | $folder = dirname(__FILE__)."/img/logo/".stripslashes($distua)."-orig.png"; |
47 | $folderN = dirname(__FILE__)."/img/logo/".stripslashes($distua).".png"; |
47 | $folderN = dirname(__FILE__)."/img/logo/".stripslashes($distua).".png"; |
48 | $folderEM = dirname(__FILE__)."/img/logo/".stripslashes($distua)."-em.png"; |
48 | $folderEM = dirname(__FILE__)."/img/logo/".stripslashes($distua)."-em.png"; |
49 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
49 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
50 | chmod($folder, 0644); |
50 | chmod($folder, 0644); |
51 | list($width, $height) = GetImageSize($folder); |
51 | list($width, $height) = GetImageSize($folder); |
52 | $percent = 32/$height; |
52 | $percent = 32/$height; |
53 | $newwidth = $width * $percent; |
53 | $newwidth = $width * $percent; |
54 | $newheight = $height * $percent; |
54 | $newheight = $height * $percent; |
55 | 55 | ||
56 | $output = ImageCreateTrueColor($newwidth, $newheight); |
56 | $output = ImageCreateTrueColor($newwidth, $newheight); |
57 | $source = ImageCreateFromPNG($folder); |
57 | $source = ImageCreateFromPNG($folder); |
58 | 58 | ||
59 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
59 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
60 | ImagePNG($output, $folderEM); |
60 | ImagePNG($output, $folderEM); |
61 | 61 | ||
62 | $percent = 15/$height; |
62 | $percent = 15/$height; |
63 | $newwidth = $width * $percent; |
63 | $newwidth = $width * $percent; |
64 | $newheight = $height * $percent; |
64 | $newheight = $height * $percent; |
65 | 65 | ||
66 | $output = ImageCreateTrueColor($newwidth, $newheight); |
66 | $output = ImageCreateTrueColor($newwidth, $newheight); |
67 | 67 | ||
68 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
68 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
69 | ImagePNG($output, $folderN); |
69 | ImagePNG($output, $folderN); |
70 | 70 | ||
71 | unlink($folder); |
71 | unlink($folder); |
72 | $distlogo = 1; |
72 | $distlogo = 1; |
73 | }
|
73 | }
|
74 | }
|
74 | }
|
75 | 75 | ||
76 | $res =& $db->query("INSERT INTO distribution SET distname='$distname', distua='$distua', disttype='$disttype', distlogo='$distlogo'"); |
76 | $res =& $db->query("INSERT INTO distribution SET distname='$distname', distua='$distua', disttype='$disttype', distlogo='$distlogo'"); |
77 | 77 | ||
78 | // ChangeLog recording
|
78 | // ChangeLog recording
|
79 | $res =& $db->query("SELECT * FROM dtype WHERE type_id='$disttype'"); |
79 | $res =& $db->query("SELECT * FROM dtype WHERE type_id='$disttype'"); |
80 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
80 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
81 | $title = "Добавлен новый дистрибутив"; |
81 | $title = "Добавлен новый дистрибутив"; |
82 | $dinfo = "В Ant добавлена поддержка основанного на ".stripslashes($log["type"])."-пакетах дистрибутива ".$distname."."; |
82 | $dinfo = "В Ant добавлена поддержка основанного на ".stripslashes($log["type"])."-пакетах дистрибутива ".$distname."."; |
83 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
83 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
84 | 84 | ||
85 | $go .= "?mode=".$mode."&action=0"; |
85 | $go .= "?mode=".$mode."&action=0"; |
86 | 86 | ||
87 | break; |
87 | break; |
88 | case '2': |
88 | case '2': |
89 | // Правка существующего дистрибутива
|
89 | // Правка существующего дистрибутива
|
90 | $distname = mysql_real_escape_string($_POST["distName"]); |
90 | $distname = mysql_real_escape_string($_POST["distName"]); |
91 | $distua = mysql_real_escape_string($_POST["distUA"]); |
91 | $distua = mysql_real_escape_string($_POST["distUA"]); |
92 | $disttype = abs(intval($_POST["distType"])); |
92 | $disttype = abs(intval($_POST["distType"])); |
93 | $distID = abs(intval($_POST["distID"])); |
93 | $distID = abs(intval($_POST["distID"])); |
94 | 94 | ||
95 | if ($_FILES["distLOGO"]["type"]!='') { |
95 | if ($_FILES["distLOGO"]["type"]!='') { |
96 | $folder = dirname(__FILE__)."/img/logo/".$distua."-orig.png"; |
96 | $folder = dirname(__FILE__)."/img/logo/".$distua."-orig.png"; |
97 | $folderN = dirname(__FILE__)."/img/logo/".$distua.".png"; |
97 | $folderN = dirname(__FILE__)."/img/logo/".$distua.".png"; |
98 | $folderEM = dirname(__FILE__)."/img/logo/".$distua."-em.png"; |
98 | $folderEM = dirname(__FILE__)."/img/logo/".$distua."-em.png"; |
99 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
99 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
100 | chmod ($folder, 0644); |
100 | chmod ($folder, 0644); |
101 | list($width, $height) = GetImageSize($folder); |
101 | list($width, $height) = GetImageSize($folder); |
102 | $percent = 32/$height; |
102 | $percent = 32/$height; |
103 | $newwidth = $width * $percent; |
103 | $newwidth = $width * $percent; |
104 | $newheight = $height * $percent; |
104 | $newheight = $height * $percent; |
105 | 105 | ||
106 | $output = ImageCreateTrueColor($newwidth, $newheight); |
106 | $output = ImageCreateTrueColor($newwidth, $newheight); |
107 | $black = ImageColorAllocate($output, 0, 0, 0); |
107 | $black = ImageColorAllocate($output, 0, 0, 0); |
108 | $source = ImageCreateFromPNG($folder); |
108 | $source = ImageCreateFromPNG($folder); |
109 | 109 | ||
110 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
110 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
111 | ImageColorTransparent($output, $black); |
111 | ImageColorTransparent($output, $black); |
112 | ImagePNG($output, $folderEM); |
112 | ImagePNG($output, $folderEM); |
113 | 113 | ||
114 | $percent = 15/$height; |
114 | $percent = 15/$height; |
115 | $newwidth = $width * $percent; |
115 | $newwidth = $width * $percent; |
116 | $newheight = $height * $percent; |
116 | $newheight = $height * $percent; |
117 | 117 | ||
118 | $output = ImageCreateTrueColor($newwidth, $newheight); |
118 | $output = ImageCreateTrueColor($newwidth, $newheight); |
119 | $black = ImageColorAllocate($output, 0, 0, 0); |
119 | $black = ImageColorAllocate($output, 0, 0, 0); |
120 | 120 | ||
121 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
121 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
122 | ImageColorTransparent($output, $black); |
122 | ImageColorTransparent($output, $black); |
123 | ImagePNG($output, $folderN); |
123 | ImagePNG($output, $folderN); |
124 | 124 | ||
125 | unlink($folder); |
125 | unlink($folder); |
126 | 126 | ||
127 | $res =& $db->query("UPDATE distribution SET distlogo='1' WHERE dist_id='$distID'"); |
127 | $res =& $db->query("UPDATE distribution SET distlogo='1' WHERE dist_id='$distID'"); |
128 | 128 | ||
129 | }
|
129 | }
|
130 | }
|
130 | }
|
131 | 131 | ||
132 | $res =& $db->query("UPDATE distribution SET distname='$distname', distua='$distua', disttype='$disttype' WHERE dist_id='$distID'"); |
132 | $res =& $db->query("UPDATE distribution SET distname='$distname', distua='$distua', disttype='$disttype' WHERE dist_id='$distID'"); |
133 | 133 | ||
134 | $go .= "?mode=".$mode."&action=0"; |
134 | $go .= "?mode=".$mode."&action=0"; |
135 | 135 | ||
136 | break; |
136 | break; |
137 | case '3': |
137 | case '3': |
138 | // Удаление существующего дистрибутива
|
138 | // Удаление существующего дистрибутива
|
139 | $distID = abs(intval($_POST["distID"])); |
139 | $distID = abs(intval($_POST["distID"])); |
140 | $distUA = $_POST["distUA"]; |
140 | $distUA = $_POST["distUA"]; |
141 | 141 | ||
142 | $folder1 = dirname(__FILE__)."/img/logo/".$distUA."-em.png"; |
142 | $folder1 = dirname(__FILE__)."/img/logo/".$distUA."-em.png"; |
143 | $folder2 = dirname(__FILE__)."/img/logo/".$distUA.".png"; |
143 | $folder2 = dirname(__FILE__)."/img/logo/".$distUA.".png"; |
144 | 144 | ||
145 | if (file_exists($folder1)) { unlink($folder1); } |
145 | if (file_exists($folder1)) { unlink($folder1); } |
146 | if (file_exists($folder2)) { unlink($folder2); } |
146 | if (file_exists($folder2)) { unlink($folder2); } |
147 | 147 | ||
148 | $res =& $db->query("SELECT * FROM distribution d JOIN dtype t ON d.disttype=t.type_id WHERE d.dist_id='$distID'"); |
148 | $res =& $db->query("SELECT * FROM distribution d JOIN dtype t ON d.disttype=t.type_id WHERE d.dist_id='$distID'"); |
149 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
149 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
150 | 150 | ||
151 | $res =& $db->query("DELETE FROM distribution WHERE dist_id='$distID'"); |
151 | $res =& $db->query("DELETE FROM distribution WHERE dist_id='$distID'"); |
152 | $res =& $db->query("DELETE FROM sect2dist WHERE dist_id='$distID'"); |
152 | $res =& $db->query("DELETE FROM sect2dist WHERE dist_id='$distID'"); |
153 | $res =& $db->query("DELETE FROM version WHERE dist_id='$distID'"); |
153 | $res =& $db->query("DELETE FROM version WHERE dist_id='$distID'"); |
154 | 154 | ||
155 | // ChangeLog recording
|
155 | // ChangeLog recording
|
156 | $title = "Удаление поддержки дистрибутива"; |
156 | $title = "Удаление поддержки дистрибутива"; |
157 | $dinfo = "Из Ant удалена поддержка основанного на ".stripslashes($log["type"])."-пакетах дистрибутива ".stripslashes($log["distname"])."."; |
157 | $dinfo = "Из Ant удалена поддержка основанного на ".stripslashes($log["type"])."-пакетах дистрибутива ".stripslashes($log["distname"])."."; |
158 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
158 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
159 | 159 | ||
160 | $go .= "?mode=".$mode."&action=0"; |
160 | $go .= "?mode=".$mode."&action=0"; |
161 | 161 | ||
162 | break; |
162 | break; |
163 | }
|
163 | }
|
164 | break; |
164 | break; |
165 | case '2': |
165 | case '2': |
166 | switch ($act) { |
166 | switch ($act) { |
167 | case '0': |
167 | case '0': |
168 | break; |
168 | break; |
169 | case '1': |
169 | case '1': |
170 | // Добавление новой версии дистрибутива
|
170 | // Добавление новой версии дистрибутива
|
171 | $versname = mysql_real_escape_string($_POST["versNam"]); |
171 | $versname = mysql_real_escape_string($_POST["versNam"]); |
172 | $versnumb = mysql_real_escape_string($_POST["versNum"]); |
172 | $versnumb = mysql_real_escape_string($_POST["versNum"]); |
173 | $verscode = mysql_real_escape_string($_POST["versCN"]); |
173 | $verscode = mysql_real_escape_string($_POST["versCN"]); |
174 | $distname = abs(intval($_POST["distName"])); |
174 | $distname = abs(intval($_POST["distName"])); |
175 | 175 | ||
176 | $res =& $db->query("INSERT INTO version SET dist_id='$distname', vname='$versname', version='$versnumb', vcodename='$verscode'"); |
176 | $res =& $db->query("INSERT INTO version SET dist_id='$distname', vname='$versname', version='$versnumb', vcodename='$verscode'"); |
177 | 177 | ||
178 | // ChangeLog recording
|
178 | // ChangeLog recording
|
179 | $res =& $db->query("SELECT * FROM distribution WHERE dist_id='$distname'"); |
179 | $res =& $db->query("SELECT * FROM distribution WHERE dist_id='$distname'"); |
180 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
180 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
181 | $title = "Добавлена новая версия ".$log["distname"]; |
181 | $title = "Добавлена новая версия ".$log["distname"]; |
182 | $dinfo = "В Ant добавлена поддержка новой версии дистрибутива ".$log["distname"]." – ".$versnumb; |
182 | $dinfo = "В Ant добавлена поддержка новой версии дистрибутива ".$log["distname"]." – ".$versnumb; |
183 | if ($versname!="") { |
183 | if ($versname!="") { |
184 | $dinfo .= " с кодовым названием “".$versname."”."; |
184 | $dinfo .= " с кодовым названием “".$versname."”."; |
185 | } else { |
185 | } else { |
186 | $dinfo .= "."; |
186 | $dinfo .= "."; |
187 | }
|
187 | }
|
188 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
188 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
189 | 189 | ||
190 | $go .= "?mode=".$mode."&action=0"; |
190 | $go .= "?mode=".$mode."&action=0"; |
191 | 191 | ||
192 | break; |
192 | break; |
193 | case '2': |
193 | case '2': |
194 | // Правка имеющейся версии дистрибутива
|
194 | // Правка имеющейся версии дистрибутива
|
195 | $versname = mysql_real_escape_string($_POST["versNam"]); |
195 | $versname = mysql_real_escape_string($_POST["versNam"]); |
196 | $versnumb = mysql_real_escape_string($_POST["versNum"]); |
196 | $versnumb = mysql_real_escape_string($_POST["versNum"]); |
197 | $verscode = mysql_real_escape_string($_POST["versCN"]); |
197 | $verscode = mysql_real_escape_string($_POST["versCN"]); |
198 | $distname = abs(intval($_POST["distName"])); |
198 | $distname = abs(intval($_POST["distName"])); |
199 | $versID = abs(intval($_POST["versID"])); |
199 | $versID = abs(intval($_POST["versID"])); |
200 | 200 | ||
201 | $res =& $db->query("UPDATE version SET dist_id='$distname', vname='$versname', version='$versnumb', vcodename='$verscode' WHERE version_id='$versID'"); |
201 | $res =& $db->query("UPDATE version SET dist_id='$distname', vname='$versname', version='$versnumb', vcodename='$verscode' WHERE version_id='$versID'"); |
202 | 202 | ||
203 | $go .= "?mode=".$mode."&action=0"; |
203 | $go .= "?mode=".$mode."&action=0"; |
204 | 204 | ||
205 | break; |
205 | break; |
206 | case '3': |
206 | case '3': |
207 | // Удаление существующей версии дистрибутива
|
207 | // Удаление существующей версии дистрибутива
|
208 | $versID = abs(intval($_POST["versID"])); |
208 | $versID = abs(intval($_POST["versID"])); |
209 | 209 | ||
210 | $res =& $db->query("SELECT * FROM version v JOIN distribution d ON v.dist_id=d.dist_id WHERE v.version_id='$versID'"); |
210 | $res =& $db->query("SELECT * FROM version v JOIN distribution d ON v.dist_id=d.dist_id WHERE v.version_id='$versID'"); |
211 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
211 | $res->fetchInto($log, DB_FETCHMODE_ASSOC); |
212 | 212 | ||
213 | $res =& $db->query("DELETE FROM version WHERE version_id='$versID'"); |
213 | $res =& $db->query("DELETE FROM version WHERE version_id='$versID'"); |
214 | $res =& $db->query("DELETE FROM ver2rep WHERE ver_id='$versID'"); |
214 | $res =& $db->query("DELETE FROM ver2rep WHERE ver_id='$versID'"); |
215 | 215 | ||
216 | // ChangeLog recording
|
216 | // ChangeLog recording
|
217 | $title = "Удалена поддержка ".$log["distname"]." ".$log["version"]; |
217 | $title = "Удалена поддержка ".$log["distname"]." ".$log["version"]; |
218 | $dinfo = "Из Ant удалена поддержка версии ".$log["version"]."{CNAME} дистрибутива ".$log["distname"]."."; |
218 | $dinfo = "Из Ant удалена поддержка версии ".$log["version"]."{CNAME} дистрибутива ".$log["distname"]."."; |
219 | if ($log["vname"]!="") { |
219 | if ($log["vname"]!="") { |
220 | $dinfo = str_replace("{CNAME}","(“".$log["vname"]."”)",$dinfo); |
220 | $dinfo = str_replace("{CNAME}","(“".$log["vname"]."”)",$dinfo); |
221 | } else { |
221 | } else { |
222 | $dinfo = str_replace("{CNAME}","",$dinfo); |
222 | $dinfo = str_replace("{CNAME}","",$dinfo); |
223 | }
|
223 | }
|
224 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
224 | $res =& $db->query("INSERT INTO changelog SET log_record=NOW(), log_title='$title', log_desc='$dinfo'"); |
225 | 225 | ||
226 | $go .= "?mode=".$mode."&action=0"; |
226 | $go .= "?mode=".$mode."&action=0"; |
227 | 227 | ||
228 | break; |
228 | break; |
229 | }
|
229 | }
|
230 | case '3': |
230 | case '3': |
231 | switch ($act) { |
231 | switch ($act) { |
232 | case '0': |
232 | case '0': |
233 | break; |
233 | break; |
234 | case '1': |
234 | case '1': |
235 | // Добавление нового источника
|
235 | // Добавление нового источника
|
236 | $origin = mysql_real_escape_string($_POST["origin"]); |
236 | $origin = mysql_real_escape_string($_POST["origin"]); |
237 | $res =& $db->query("INSERT INTO origin SET origin='$origin'"); |
237 | $res =& $db->query("INSERT INTO origin SET origin='$origin'"); |
238 | $go .= "?mode=".$mode."&action=0"; |
238 | $go .= "?mode=".$mode."&action=0"; |
239 | break; |
239 | break; |
240 | case '2': |
240 | case '2': |
241 | // Правка существующего источника
|
241 | // Правка существующего источника
|
242 | $origin = mysql_real_escape_string($_POST["origin"]); |
242 | $origin = mysql_real_escape_string($_POST["origin"]); |
243 | $id = abs(intval($_POST["originID"])); |
243 | $id = abs(intval($_POST["originID"])); |
244 | $res =& $db->query("UPDATE origin SET origin='$origin' WHERE origin_id='$id'"); |
244 | $res =& $db->query("UPDATE origin SET origin='$origin' WHERE origin_id='$id'"); |
245 | $go .= "?mode=$mode&action=0"; |
245 | $go .= "?mode=$mode&action=0"; |
246 | break; |
246 | break; |
247 | case '3': |
247 | case '3': |
248 | // Удаление существующего источника
|
248 | // Удаление существующего источника
|
249 | $id = abs(intval($_POST["originID"])); |
249 | $id = abs(intval($_POST["originID"])); |
250 | $res =& $db->query("DELETE FROM rep2orig WHERE origin_id='$id'"); |
250 | $res =& $db->query("DELETE FROM rep2orig WHERE origin_id='$id'"); |
251 | $res =& $db->query("DELETE FROM origin WHERE origin_id='$id'"); |
251 | $res =& $db->query("DELETE FROM origin WHERE origin_id='$id'"); |
252 | $go .= "?mode=".$mode."&action=0"; |
252 | $go .= "?mode=".$mode."&action=0"; |
253 | break; |
253 | break; |
254 | }
|
254 | }
|
255 | break; |
255 | break; |
256 | case '4': |
256 | case '4': |
257 | switch ($act) { |
257 | switch ($act) { |
258 | case '0': |
258 | case '0': |
259 | break; |
259 | break; |
260 | case '1': |
260 | case '1': |
261 | break; |
261 | break; |
262 | case '2': |
262 | case '2': |
263 | // Добавление нового репозитория
|
263 | // Добавление нового репозитория
|
264 | $versID = abs(intval($_POST["vers"])); |
264 | $versID = abs(intval($_POST["vers"])); |
265 | $repname = mysql_real_escape_string($_POST["repName"]); |
265 | $repname = mysql_real_escape_string($_POST["repName"]); |
266 | $repinfo = mysql_real_escape_string($_POST["repInfo"]); |
266 | $repinfo = mysql_real_escape_string($_POST["repInfo"]); |
267 | $repsche = abs(intval($_POST["scheme"])); |
267 | $repsche = abs(intval($_POST["scheme"])); |
268 | $reptype = abs(intval($_POST["rtype"])); |
268 | $reptype = abs(intval($_POST["rtype"])); |
269 | $reproot = abs(intval($_POST["rootFolder"])); |
269 | $reproot = abs(intval($_POST["rootFolder"])); |
270 | 270 | ||
271 | $res =& $db->query("INSERT INTO repository SET repname='$repname', repdescribe='$repinfo', scheme_id='$repsche', rtype_id='$reptype', root_id='$reproot'"); |
271 | $res =& $db->query("INSERT INTO repository SET repname='$repname', repdescribe='$repinfo', scheme_id='$repsche', rtype_id='$reptype', root_id='$reproot'"); |
272 | $res =& $db->query("SELECT rep_id FROM repository ORDER BY rep_id DESC LIMIT 1"); |
272 | $res =& $db->query("SELECT rep_id FROM repository ORDER BY rep_id DESC LIMIT 1"); |
273 | $res->fetchInto($rep, DB_FETCHMODE_ASSOC); |
273 | $res->fetchInto($rep, DB_FETCHMODE_ASSOC); |
274 | $rep_id = $rep["rep_id"]; |
274 | $rep_id = $rep["rep_id"]; |
275 | 275 | ||
276 | $res =& $db->query("INSERT INTO ver2rep SET ver_id='$versID', rep_id='$rep_id'"); |
276 | $res =& $db->query("INSERT INTO ver2rep SET ver_id='$versID', rep_id='$rep_id'"); |
277 | 277 | ||
278 | for ($i=0;$i<count($_POST["sect"]);$i++) { |
278 | for ($i=0;$i<count($_POST["sect"]);$i++) { |
279 | $res =& $db->query("INSERT INTO sect2rep SET sect_id='".$_POST["sect"][$i]."', rep_id='$rep_id'"); |
279 | $res =& $db->query("INSERT INTO sect2rep SET sect_id='".$_POST["sect"][$i]."', rep_id='$rep_id'"); |
280 | }
|
280 | }
|
281 | 281 | ||
282 | $go .= "?mode=".$mode."&action=0"; |
282 | $go .= "?mode=".$mode."&action=0"; |
283 | 283 | ||
284 | break; |
284 | break; |
285 | case '3': |
285 | case '3': |
286 | // Правка репозитория
|
286 | // Правка репозитория
|
287 | $repID = abs(intval($_POST["rep"])); |
287 | $repID = abs(intval($_POST["rep"])); |
288 | $repname = mysql_real_escape_string($_POST["repName"]); |
288 | $repname = mysql_real_escape_string($_POST["repName"]); |
289 | $repinfo = mysql_real_escape_string($_POST["repInfo"]); |
289 | $repinfo = mysql_real_escape_string($_POST["repInfo"]); |
290 | $repsche = abs(intval($_POST["scheme"])); |
290 | $repsche = abs(intval($_POST["scheme"])); |
291 | $reptype = abs(intval($_POST["rtype"])); |
291 | $reptype = abs(intval($_POST["rtype"])); |
292 | $reproot = abs(intval($_POST["rootFolder"])); |
292 | $reproot = abs(intval($_POST["rootFolder"])); |
293 | 293 | ||
294 | $res =& $db->query("UPDATE repository SET repname='$repname', repdescribe='$repinfo', scheme_id='$repsche', rtype_id='$reptype', root_id='$reproot' WHERE rep_id='$repID'"); |
294 | $res =& $db->query("UPDATE repository SET repname='$repname', repdescribe='$repinfo', scheme_id='$repsche', rtype_id='$reptype', root_id='$reproot' WHERE rep_id='$repID'"); |
295 | $res =& $db->query("DELETE FROM sect2rep WHERE rep_id='$repID'"); |
295 | $res =& $db->query("DELETE FROM sect2rep WHERE rep_id='$repID'"); |
296 | for ($i=0;$i<count($_POST["sect"]);$i++) { |
296 | for ($i=0;$i<count($_POST["sect"]);$i++) { |
297 | $res =& $db->query("INSERT INTO sect2rep SET sect_id='".$_POST["sect"][$i]."', rep_id='$repID'"); |
297 | $res =& $db->query("INSERT INTO sect2rep SET sect_id='".$_POST["sect"][$i]."', rep_id='$repID'"); |
298 | }
|
298 | }
|
299 | 299 | ||
300 | $go .= "?mode=".$mode."&action=0"; |
300 | $go .= "?mode=".$mode."&action=0"; |
301 | 301 | ||
302 | break; |
302 | break; |
303 | case '4': |
303 | case '4': |
304 | // Удаление репозитория
|
304 | // Удаление репозитория
|
305 | $repID = abs(intval($_POST["rep"])); |
305 | $repID = abs(intval($_POST["rep"])); |
306 | 306 | ||
307 | $res =& $db->query("DELETE FROM repository WHERE rep_id='$repID'"); |
307 | $res =& $db->query("DELETE FROM repository WHERE rep_id='$repID'"); |
308 | $res =& $db->query("DELETE FROM sect2rep WHERE rep_id='$repID'"); |
308 | $res =& $db->query("DELETE FROM sect2rep WHERE rep_id='$repID'"); |
309 | $res =& $db->query("DELETE FROM ver2rep WHERE rep_id='$repID'"); |
309 | $res =& $db->query("DELETE FROM ver2rep WHERE rep_id='$repID'"); |
310 | 310 | ||
311 | $go .= "?mode=".$mode."&action=0"; |
311 | $go .= "?mode=".$mode."&action=0"; |
312 | 312 | ||
313 | break; |
313 | break; |
314 | }
|
314 | }
|
315 | break; |
315 | break; |
316 | case '5': |
316 | case '5': |
317 | switch ($act) { |
317 | switch ($act) { |
318 | case '0': |
318 | case '0': |
319 | break; |
319 | break; |
320 | case '1': |
320 | case '1': |
321 | // Создание секции
|
321 | // Создание секции
|
322 | $sectname = mysql_real_escape_string($_POST["sectName"]); |
322 | $sectname = mysql_real_escape_string($_POST["sectName"]); |
323 | $sectinfo = mysql_real_escape_string($_POST["sectInfo"]); |
323 | $sectinfo = mysql_real_escape_string($_POST["sectInfo"]); |
324 | 324 | ||
325 | $req =& $db->query("INSERT INTO section SET sectname='$sectname', sectinfo='$sectinfo'"); |
325 | $req =& $db->query("INSERT INTO section SET sectname='$sectname', sectinfo='$sectinfo'"); |
326 | $req =& $db->query("SELECT sect_id FROM section ORDER BY sect_id DESC LIMIT 1"); |
326 | $req =& $db->query("SELECT sect_id FROM section ORDER BY sect_id DESC LIMIT 1"); |
327 | $req->fetchInto($sect, DB_FETCHMODE_ASSOC); |
327 | $req->fetchInto($sect, DB_FETCHMODE_ASSOC); |
328 | 328 | ||
329 | for($i=0;$i<count($_POST["dist"]);$i++) { |
329 | for($i=0;$i<count($_POST["dist"]);$i++) { |
330 | $req =& $db->query("INSERT INTO sect2dist SET dist_id='".$_POST["dist"][$i]."', sect_id='".$sect["sect_id"]."'"); |
330 | $req =& $db->query("INSERT INTO sect2dist SET dist_id='".$_POST["dist"][$i]."', sect_id='".$sect["sect_id"]."'"); |
331 | }
|
331 | }
|
332 | 332 | ||
333 | $go .= "?mode=".$mode."&act=0"; |
333 | $go .= "?mode=".$mode."&act=0"; |
334 | 334 | ||
335 | break; |
335 | break; |
336 | case '2': |
336 | case '2': |
337 | // Правка секции
|
337 | // Правка секции
|
338 | $sectID = abs(intval($_POST["sectID"])); |
338 | $sectID = abs(intval($_POST["sectID"])); |
339 | $sectname = mysql_real_escape_string($_POST["sectName"]); |
339 | $sectname = mysql_real_escape_string($_POST["sectName"]); |
340 | $sectinfo = mysql_real_escape_string($_POST["sectInfo"]); |
340 | $sectinfo = mysql_real_escape_string($_POST["sectInfo"]); |
341 | 341 | ||
342 | $req =& $db->query("UPDATE section SET sectname='$sectname', sectinfo='$sectinfo' WHERE sect_id='$sectID'"); |
342 | $req =& $db->query("UPDATE section SET sectname='$sectname', sectinfo='$sectinfo' WHERE sect_id='$sectID'"); |
343 | $req =& $db->query("DELETE FROM sect2dist WHERE sect_id='$sectID'"); |
343 | $req =& $db->query("DELETE FROM sect2dist WHERE sect_id='$sectID'"); |
344 | 344 | ||
345 | for($i=0;$i<count($_POST["dist"]);$i++) { |
345 | for($i=0;$i<count($_POST["dist"]);$i++) { |
346 | $req =& $db->query("INSERT INTO sect2dist SET dist_id='".$_POST["dist"][$i]."', sect_id='".$sectID."'"); |
346 | $req =& $db->query("INSERT INTO sect2dist SET dist_id='".$_POST["dist"][$i]."', sect_id='".$sectID."'"); |
347 | }
|
347 | }
|
348 | 348 | ||
349 | $go .= "?mode=".$mode."&action=0"; |
349 | $go .= "?mode=".$mode."&action=0"; |
350 | 350 | ||
351 | break; |
351 | break; |
352 | case '3': |
352 | case '3': |
353 | // Удаление секции
|
353 | // Удаление секции
|
354 | $sectID = abs(intval($_POST["sectID"])); |
354 | $sectID = abs(intval($_POST["sectID"])); |
355 | 355 | ||
356 | $req =& $db->query("DELETE FROM section WHERE sect_id='$sectID'"); |
356 | $req =& $db->query("DELETE FROM section WHERE sect_id='$sectID'"); |
357 | $req =& $db->query("DELETE FROM sect2dist WHERE sect_id='$sectID'"); |
357 | $req =& $db->query("DELETE FROM sect2dist WHERE sect_id='$sectID'"); |
358 | $req =& $db->query("DELETE FROM sect2rep WHERE sect_id='$sectID'"); |
358 | $req =& $db->query("DELETE FROM sect2rep WHERE sect_id='$sectID'"); |
359 | 359 | ||
360 | $go .= "?mode=".$mode."&action=0"; |
360 | $go .= "?mode=".$mode."&action=0"; |
361 | 361 | ||
362 | break; |
362 | break; |
363 | }
|
363 | }
|
364 | break; |
364 | break; |
365 | case '6': |
365 | case '6': |
366 | switch ($act) { |
366 | switch ($act) { |
367 | case '0': |
367 | case '0': |
368 | break; |
368 | break; |
369 | case '1': |
369 | case '1': |
370 | // Добавление новой схемы
|
370 | // Добавление новой схемы
|
371 | $scheme = mysql_real_escape_string($_POST["scheme"]); |
371 | $scheme = mysql_real_escape_string($_POST["scheme"]); |
372 | - | ||
373 | $req =& $db->query("INSERT INTO scheme SET scheme='$scheme'"); |
372 | $req =& $db->query("INSERT INTO scheme SET scheme='$scheme'"); |
374 | - | ||
375 | $go .= "?mode=".$mode."&act=0"; |
373 | $go .= "?mode=".$mode."&act=0"; |
376 | - | ||
377 | break; |
374 | break; |
378 | case '2': |
375 | case '2': |
379 | // Правка схемы
|
376 | // Правка схемы
|
380 | $schemeID = abs(intval($_POST["schemeID"])); |
377 | $schemeID = abs(intval($_POST["schemeID"])); |
381 | $scheme = mysql_real_escape_string($_POST["scheme"]); |
378 | $scheme = mysql_real_escape_string($_POST["scheme"]); |
382 | - | ||
383 | $req =& $db->query("UPDATE scheme SET scheme='$scheme' WHERE scheme_id='$schemeID'"); |
379 | $req =& $db->query("UPDATE scheme SET scheme='$scheme' WHERE scheme_id='$schemeID'"); |
384 | - | ||
385 | $go .= "?mode=".$mode."&act=0"; |
380 | $go .= "?mode=".$mode."&act=0"; |
386 | - | ||
387 | break; |
381 | break; |
388 | case '3': |
382 | case '3': |
389 | // Удаление схемы
|
383 | // Удаление схемы
|
390 | $schemeID = abs(intval($_POST["schemeID"])); |
384 | $schemeID = abs(intval($_POST["schemeID"])); |
391 | - | ||
392 | $req =& $db->query("DELETE FROM scheme WHERE scheme_id='$schemeID'"); |
385 | $req =& $db->query("DELETE FROM scheme WHERE scheme_id='$schemeID'"); |
393 | - | ||
394 | $go .= "?mode=".$mode."&act=0"; |
386 | $go .= "?mode=".$mode."&act=0"; |
395 | - | ||
396 | break; |
387 | break; |
397 | }
|
388 | }
|
398 | break; |
389 | break; |
- | 390 | case '7': |
|
- | 391 | switch ($act) { |
|
- | 392 | case '0': |
|
- | 393 | break; |
|
- | 394 | case '1': |
|
- | 395 | // Добавление нового типа репозитория
|
|
- | 396 | $rtype = mysql_real_escape_string($_POST["rtype"]); |
|
- | 397 | $req =& $db->query("INSERT INTO rtype SET rtype='$rtype'"); |
|
- | 398 | $go .= "?mode=".$mode."&act=0"; |
|
- | 399 | break; |
|
- | 400 | case '2': |
|
- | 401 | // Правка существующего типа репозитория
|
|
- | 402 | $rtypeID = abs(intval($_POST["rtypeID"])); |
|
- | 403 | $rtype = mysql_real_escape_string($_POST["rtype"]); |
|
- | 404 | $req =& $db->query("UPDATE rtype SET rtype='$rtype' WHERE rtype_id='$rtypeID'"); |
|
- | 405 | $go .= "?mode=".$mode."&act=0"; |
|
- | 406 | break; |
|
- | 407 | case '3': |
|
- | 408 | // Удаление типа репозитория
|
|
- | 409 | $rtypeID = abs(intval($_POST["rtypeID"])); |
|
- | 410 | $req =& $db->query("DELETE FROM rtype WHERE rtype_id='$rtypeID'"); |
|
- | 411 | $go .= "?mode=".$mode."&act=0"; |
|
- | 412 | break; |
|
399 | 413 | }
|
|
- | 414 | break; |
|
- | 415 | case '8': |
|
- | 416 | switch ($act) { |
|
- | 417 | case '0': |
|
- | 418 | break; |
|
- | 419 | case '1': |
|
- | 420 | // Создание корневой папки репозиториев
|
|
- | 421 | $root = mysql_real_escape_string($_POST["rootFolder"]); |
|
- | 422 | $req =& $db->query("INSERT INTO root SET root_folder='$root'"); |
|
- | 423 | $go .= "?mode=".$mode."&act=0"; |
|
- | 424 | break; |
|
- | 425 | case '2': |
|
- | 426 | // Редактирование корневой папки репозиториев
|
|
- | 427 | $root_id = abs(intval($_POST["rootID"])); |
|
- | 428 | $root_fd = mysql_real_escape_string($_POST["rootFolder"]); |
|
- | 429 | $req =& $db->query("UPDATE root SET root_folder='$root_fd' WHERE root_id='$root_id'"); |
|
- | 430 | $go .= "?mode=".$mode."&act=0"; |
|
- | 431 | break; |
|
- | 432 | case '3': |
|
- | 433 | // Удаление корневой папки репозиториев
|
|
- | 434 | $root_id = abs(intval($_POST["rootID"])); |
|
- | 435 | $req =& $db->query("DELETE FROM root WHERE root_id='$root_id'"); |
|
- | 436 | $go .= "?mode=".$mode."&act=0"; |
|
- | 437 | break; |
|
400 | 438 | }
|
|
- | 439 | break; |
|
401 | case '20': |
440 | case '20': |
402 | switch ($act) { |
441 | switch ($act) { |
403 | case '0': |
442 | case '0': |
404 | break; |
443 | break; |
405 | case '1': |
444 | case '1': |
406 | // Добавление новой настройки Ant
|
445 | // Добавление новой настройки Ant
|
407 | $option = mysql_real_escape_string($_POST["setoption"]); |
446 | $option = mysql_real_escape_string($_POST["setoption"]); |
408 | $value = mysql_real_escape_string($_POST["setvalue"]); |
447 | $value = mysql_real_escape_string($_POST["setvalue"]); |
409 | $req =& $db->query("INSERT INTO settings SET opt='$option', optvalue='$value'"); |
448 | $req =& $db->query("INSERT INTO settings SET opt='$option', optvalue='$value'"); |
410 | $go .= "?mode=".$mode."&act=0"; |
449 | $go .= "?mode=".$mode."&act=0"; |
411 | break; |
450 | break; |
412 | case '2': |
451 | case '2': |
413 | // Правка настройки Ant
|
452 | // Правка настройки Ant
|
414 | $optID = abs(intval($_POST["optID"])); |
453 | $optID = abs(intval($_POST["optID"])); |
415 | $option = mysql_real_escape_string($_POST["setoption"]); |
454 | $option = mysql_real_escape_string($_POST["setoption"]); |
416 | $value = mysql_real_escape_string($_POST["setvalue"]); |
455 | $value = mysql_real_escape_string($_POST["setvalue"]); |
417 | $req =& $db->query("UPDATE settings SET opt='$option', optvalue='$value' WHERE opt_id='$optID'"); |
456 | $req =& $db->query("UPDATE settings SET opt='$option', optvalue='$value' WHERE opt_id='$optID'"); |
418 | $go .= "?mode=".$mode."&act=0"; |
457 | $go .= "?mode=".$mode."&act=0"; |
419 | break; |
458 | break; |
420 | case '3': |
459 | case '3': |
421 | // Удаление настройки
|
460 | // Удаление настройки
|
422 | $optID = abs(intval($_POST["optID"])); |
461 | $optID = abs(intval($_POST["optID"])); |
423 | $req =& $db->query("DELETE FROM settings WHERE opt_id='$optID'"); |
462 | $req =& $db->query("DELETE FROM settings WHERE opt_id='$optID'"); |
424 | $go .= "?mode=".$mode."&act=0"; |
463 | $go .= "?mode=".$mode."&act=0"; |
425 | break; |
464 | break; |
426 | }
|
465 | }
|
427 | break; |
466 | break; |
428 | case '21': |
467 | case '21': |
429 | switch ($act) { |
468 | switch ($act) { |
430 | case '0': |
469 | case '0': |
431 | break; |
470 | break; |
432 | case '1': |
471 | case '1': |
433 | // Добавление интерфейса
|
472 | // Добавление интерфейса
|
434 | $ifname = mysql_real_escape_string($_POST["ifname"]); |
473 | $ifname = mysql_real_escape_string($_POST["ifname"]); |
435 | $ifinfo = mysql_real_escape_string($_POST["ifinfo"]); |
474 | $ifinfo = mysql_real_escape_string($_POST["ifinfo"]); |
436 | $ifname = str_replace(".php","",$ifname); |
475 | $ifname = str_replace(".php","",$ifname); |
437 | $req =& $db->query("INSERT INTO interfaces SET interface='$ifname', interfaceinfo='$ifinfo'"); |
476 | $req =& $db->query("INSERT INTO interfaces SET interface='$ifname', interfaceinfo='$ifinfo'"); |
- | 477 | $go .= "?mode=".$mode."&act=0"; |
|
438 | break; |
478 | break; |
439 | case '2': |
479 | case '2': |
440 | // Правка интерфейса
|
480 | // Правка интерфейса
|
441 | $ifname = mysql_real_escape_string($_POST["ifname"]); |
481 | $ifname = mysql_real_escape_string($_POST["ifname"]); |
442 | $ifinfo = mysql_real_escape_string($_POST["ifinfo"]); |
482 | $ifinfo = mysql_real_escape_string($_POST["ifinfo"]); |
443 | $if = abs(intval($_POST["if"])); |
483 | $if = abs(intval($_POST["if"])); |
444 | $ifname = str_replace(".php","",$ifname); |
484 | $ifname = str_replace(".php","",$ifname); |
445 | $req =& $db->query("UPDATE interfaces SET interface='$ifname', interfaceinfo='$ifinfo' WHERE if_id='$if'"); |
485 | $req =& $db->query("UPDATE interfaces SET interface='$ifname', interfaceinfo='$ifinfo' WHERE if_id='$if'"); |
446 | $go .= "?mode=".$mode."&act=0"; |
486 | $go .= "?mode=".$mode."&act=0"; |
447 | break; |
487 | break; |
448 | case '3': |
488 | case '3': |
449 | // Удаление интерфейса
|
489 | // Удаление интерфейса
|
450 | $if = abs(intval($_POST["if"])); |
490 | $if = abs(intval($_POST["if"])); |
451 | $req =& $db->query("DELETE FROM interfaces WHERE if_id='$if'"); |
491 | $req =& $db->query("DELETE FROM interfaces WHERE if_id='$if'"); |
- | 492 | $go .= "?mode=".$mode."&act=0"; |
|
452 | break; |
493 | break; |
453 | }
|
494 | }
|
454 | break; |
495 | break; |
455 | case '22': |
496 | case '22': |
456 | switch ($act) { |
497 | switch ($act) { |
457 | case '0': |
498 | case '0': |
458 | // Смена пароля
|
499 | // Смена пароля
|
459 | // $OID = abs(intval($_POST["OID"]));
|
500 | // $OID = abs(intval($_POST["OID"]));
|
460 | $oldpass = mysql_real_escape_string($_POST["oldPW"]); |
501 | $oldpass = mysql_real_escape_string($_POST["oldPW"]); |
461 | $newpass1 = mysql_real_escape_string($_POST["newPW1"]); |
502 | $newpass1 = mysql_real_escape_string($_POST["newPW1"]); |
462 | $newpass2 = mysql_real_escape_string($_POST["newPW2"]); |
503 | $newpass2 = mysql_real_escape_string($_POST["newPW2"]); |
463 | 504 | ||
464 | $errpwd = 0; |
505 | $errpwd = 0; |
465 | $spass = md5($newpass1."ANT"); |
506 | $spass = md5($newpass1."ANT"); |
466 | $soldpass = md5($oldpass."ANT"); |
507 | $soldpass = md5($oldpass."ANT"); |
467 | if ($soldpass != $_COOKIE[$CookiePasswd]) { |
508 | if ($soldpass != $_COOKIE[$CookiePasswd]) { |
468 | $go .= "?error=1"; |
509 | $go .= "?error=1"; |
469 | $errpwd = 1; |
510 | $errpwd = 1; |
470 | }
|
511 | }
|
471 | if ($newpass1 != $newpass2) { |
512 | if ($newpass1 != $newpass2) { |
472 | $go .= "?error=2"; |
513 | $go .= "?error=2"; |
473 | $errpwd = 2; |
514 | $errpwd = 2; |
474 | }
|
515 | }
|
475 | 516 | ||
476 | if ($errpwd==0) { |
517 | if ($errpwd==0) { |
477 | // fix: Для многопользовательского варианта придется запрос переписать
|
518 | // fix: Для многопользовательского варианта придется запрос переписать
|
478 | $req =& $db->query("UPDATE owner SET passwd='$spass' WHERE login='admin'"); |
519 | $req =& $db->query("UPDATE owner SET passwd='$spass' WHERE login='admin'"); |
479 | }
|
520 | }
|
480 | break; |
521 | break; |
481 | }
|
522 | }
|
482 | break; |
523 | break; |
483 | - | ||
484 | - | ||
485 | /*-------------------------------------------------------------------------------------------------------*/
|
- | |
486 | /* case '7':
|
- | |
487 | switch ($act) {
|
- | |
488 | case '0':
|
- | |
489 | break;
|
- | |
490 | case '1':
|
- | |
491 | // Добавление нового типа репозитория
|
- | |
492 | $rtype = mysql_real_escape_string($_POST["rtype"]);
|
- | |
493 | - | ||
494 | $req =& $db->query("INSERT INTO rtype SET rtype='$rtype'");
|
- | |
495 | - | ||
496 | $go .= "?mode=7&act=0";
|
- | |
497 | - | ||
498 | break;
|
- | |
499 | case '2':
|
- | |
500 | // Правка существующего типа репозитория
|
- | |
501 | $rtypeID = abs(intval($_POST["rtypeID"]));
|
- | |
502 | $rtype = mysql_real_escape_string($_POST["rtype"]);
|
- | |
503 | - | ||
504 | $req =& $db->query("UPDATE rtype SET rtype='$rtype' WHERE rtype_id='$rtypeID'");
|
- | |
505 | - | ||
506 | $go .= "?mode=7&act=0";
|
- | |
507 | - | ||
508 | break;
|
- | |
509 | case '3':
|
- | |
510 | // Удаление типа репозитория
|
- | |
511 | $rtypeID = abs(intval($_POST["rtypeID"]));
|
- | |
512 | - | ||
513 | $req =& $db->query("DELETE FROM rtype WHERE rtype_id='$rtypeID'");
|
- | |
514 | - | ||
515 | $go .= "?mode=7&act=0";
|
- | |
516 | - | ||
517 | break;
|
- | |
518 | }
|
- | |
519 | break;
|
- | |
520 | case '8':
|
- | |
521 | switch ($act) {
|
- | |
522 | case '0':
|
- | |
523 | break;
|
- | |
524 | case '1':
|
- | |
525 | // Создание корневой папки репозиториев
|
- | |
526 | $root = mysql_real_escape_string($_POST["rootFolder"]);
|
- | |
527 | $req =& $db->query("INSERT INTO root SET root_folder='$root'");
|
- | |
528 | $go .= "?mode=10&act=0";
|
- | |
529 | break;
|
- | |
530 | case '2':
|
- | |
531 | // Редактирование корневой папки репозиториев
|
- | |
532 | $root_id = abs(intval($_POST["rootID"]));
|
- | |
533 | $root_fd = mysql_real_escape_string($_POST["rootFolder"]);
|
- | |
534 | $req =& $db->query("UPDATE root SET root_folder='$root_fd' WHERE root_id='$root_id'");
|
- | |
535 | $go .= "?mode=10&act=0";
|
- | |
536 | break;
|
- | |
537 | case '3':
|
- | |
538 | // Удаление корневой папки репозиториев
|
- | |
539 | $root_id = abs(intval($_POST["rootID"]));
|
- | |
540 | $req =& $db->query("DELETE FROM root WHERE root_id='$root_id'");
|
- | |
541 | $go .= "?mode=10&act=0";
|
- | |
542 | break;
|
- | |
543 | }
|
- | |
544 | break;
|
- | |
545 | */
|
- | |
546 | }
|
524 | }
|
547 | 525 | ||
548 | header("Location: $go\n\n"); |
526 | header("Location: $go\n\n"); |
549 | 527 | ||
550 | ?>
|
528 | ?>
|
551 | 529 |