Редакция 570 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 570 | Редакция 574 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | /**
|
2 | /**
|
3 | *
|
3 | *
|
4 | * Codename: ant-ng - generator of sources.list for apt-distributives
|
4 | * Codename: ant-ng - generator of sources.list for apt-distributives
|
5 | * http://alex-w.org.ru/p/antng/
|
5 | * http://alex-w.org.ru/p/antng/
|
6 | *
|
6 | *
|
7 | * Copyright (c) 2009 Alexander Wolf
|
7 | * Copyright (c) 2009 Alexander Wolf
|
8 | * Dual licensed under the MIT and GNU LGPL licenses.
|
8 | * Dual licensed under the MIT and GNU LGPL licenses.
|
9 | * http://alex-w.org.ru/p/antng/license
|
9 | * http://alex-w.org.ru/p/antng/license
|
10 | *
|
10 | *
|
11 | */
|
11 | */
|
12 | 12 | ||
13 | require_once dirname(__FILE__)."/init.php"; |
13 | require_once dirname(__FILE__)."/init.php"; |
14 | 14 | ||
15 | if(!empty($_GET["action"])) { |
15 | if(!empty($_GET["action"])) { |
16 | $action = $_GET["action"]; |
16 | $action = $_GET["action"]; |
17 | } else { |
17 | } else { |
18 | $action = "view"; |
18 | $action = "view"; |
19 | }
|
19 | }
|
20 | if(!empty($_GET["mode"])) { |
20 | if(!empty($_GET["mode"])) { |
21 | $mode = $_GET["mode"]; |
21 | $mode = $_GET["mode"]; |
22 | } else { |
22 | } else { |
23 | $mode = "empty"; |
23 | $mode = "empty"; |
24 | }
|
24 | }
|
25 | 25 | ||
26 | $uuid = $secure->checkInt($_GET["uuid"]); |
26 | $uuid = $secure->checkInt($_GET["uuid"]); |
27 | 27 | ||
28 | $valid = $core->checkCookieSign($_COOKIE[$cookie]); |
28 | $valid = $core->checkCookieSign($_COOKIE[$cookie]); |
29 | 29 | ||
30 | $scripts = ""; |
30 | $scripts = ""; |
31 | 31 | ||
32 | $menu = "<fieldset><legend>Меню</legend>\n"; |
32 | $menu = "<fieldset><legend>Меню</legend>\n"; |
33 | $menu .= "<div id='rmenu'></div>\n"; |
33 | $menu .= "<div id='rmenu'></div>\n"; |
34 | $menu .= "<ul class='vfix'><li><a href='".$manager."?mode=distributions'>Дистрибутивы</a></li>"; |
34 | $menu .= "<ul class='vfix'><li><a href='".$manager."?mode=distributions'>Дистрибутивы</a></li>"; |
35 | $menu .= "<li><a href='".$manager."?mode=versions'>Версии</a></li>"; |
35 | $menu .= "<li><a href='".$manager."?mode=versions'>Версии</a></li>"; |
36 | $menu .= "<li><a href='".$manager."?mode=sections'>Секции</a></li>"; |
36 | $menu .= "<li><a href='".$manager."?mode=sections'>Секции</a></li>"; |
37 | $menu .= "<li><a href='".$manager."?mode=signs'>Подписи</a></li>"; |
37 | $menu .= "<li><a href='".$manager."?mode=signs'>Подписи</a></li>"; |
38 | $menu .= "<li><a href='".$manager."?mode=repositories'>Репозитории</a></li>"; |
38 | $menu .= "<li><a href='".$manager."?mode=repositories'>Репозитории</a></li>"; |
39 | $menu .= "<li><a href='".$manager."?mode=archs'>Архитектуры</a></li>"; |
39 | $menu .= "<li><a href='".$manager."?mode=archs'>Архитектуры</a></li>"; |
40 | $menu .= "<li><a href='".$manager."?mode=schemes'>Схемы</a></li>"; |
40 | $menu .= "<li><a href='".$manager."?mode=schemes'>Схемы</a></li>"; |
- | 41 | $menu .= "<li><a href='".$manager."?mode=protos'>Протоколы</a></li>"; |
|
41 | $menu .= "<li><a href='".$manager."?mode=settings'>Настройки</a></li>"; |
42 | $menu .= "<li><a href='".$manager."?mode=settings'>Настройки</a></li>"; |
42 | $menu .= "<li><a href='".$manager."?mode=exit'>Выход</a></li></ul>"; |
43 | $menu .= "<li><a href='".$manager."?mode=exit'>Выход</a></li></ul>"; |
43 | $menu .=" </fieldset>\n"; |
44 | $menu .=" </fieldset>\n"; |
44 | 45 | ||
45 | $tmpl->assign('scripts', $scripts); |
46 | $tmpl->assign('scripts', $scripts); |
46 | $tmpl->assign('menu', $menu); |
47 | $tmpl->assign('menu', $menu); |
47 | 48 | ||
48 | switch ($mode) { |
49 | switch ($mode) { |
49 | case 'empty': |
50 | case 'empty': |
50 | if ($valid["ERR"]==1) { |
51 | if ($valid["ERR"]==1) { |
51 | $tmpl->assign('header', "Вход"); |
52 | $tmpl->assign('header', "Вход"); |
52 | $tmpl->assign('description', "Вход в панель управления генератором"); |
53 | $tmpl->assign('description', "Вход в панель управления генератором"); |
53 | $tmpl->assign('body', $core->showSigninForm()); |
54 | $tmpl->assign('body', $core->showSigninForm()); |
54 | $tmpl->display('default.tpl'); |
55 | $tmpl->display('default.tpl'); |
55 | } else { |
56 | } else { |
56 | $tmpl->assign('header', "CPanel"); |
57 | $tmpl->assign('header', "CPanel"); |
57 | $tmpl->assign('description', "Панель управления генератором"); |
58 | $tmpl->assign('description', "Панель управления генератором"); |
58 | $tmpl->assign('body', $body); |
59 | $tmpl->assign('body', $body); |
59 | $tmpl->display('manager.tpl'); |
60 | $tmpl->display('manager.tpl'); |
60 | }
|
61 | }
|
61 | break; |
62 | break; |
62 | case 'exit': |
63 | case 'exit': |
63 | setcookie($cookie, '', time()-10); |
64 | setcookie($cookie, '', time()-10); |
64 | header("Location: ./\n\n"); |
65 | header("Location: ./\n\n"); |
65 | break; |
66 | break; |
66 | case 'distributions': |
67 | case 'distributions': |
67 | // Управление дистрибутивами
|
68 | // Управление дистрибутивами
|
68 | $body = "<h3>Управление дистрибутивами</h3>"; |
69 | $body = "<h3>Управление дистрибутивами</h3>"; |
69 | switch ($action) { |
70 | switch ($action) { |
70 | case 'view': |
71 | case 'view': |
71 | $body .= "<p><a href='".$manager."?mode=distributions&action=new'>Добавить новый дистрибутив</a></p>"; |
72 | $body .= "<p><a href='".$manager."?mode=distributions&action=new'>Добавить новый дистрибутив</a></p>"; |
72 | $body .= $core->showDistributionList("distributions", $maganer, "", "list"); |
73 | $body .= $core->showDistributionList("distributions", $maganer, "", "list"); |
73 | break; |
74 | break; |
74 | case 'new': |
75 | case 'new': |
75 | $body .= "<form action='".$process."' method='post' enctype='multipart/form-data'>\n"; |
76 | $body .= "<form action='".$process."' method='post' enctype='multipart/form-data'>\n"; |
76 | $body .= "<input type='hidden' name='mode' value='distributive-add'>\n"; |
77 | $body .= "<input type='hidden' name='mode' value='distributive-add'>\n"; |
77 | $body .= $core->showDistributionForm(0,"Добавление информации о новом дистрибутиве"); |
78 | $body .= $core->showDistributionForm(0,"Добавление информации о новом дистрибутиве"); |
78 | $body .= "</form>"; |
79 | $body .= "</form>"; |
79 | break; |
80 | break; |
80 | case 'edit': |
81 | case 'edit': |
81 | $body .= "<form action='".$process."' method='post' enctype='multipart/form-data'>\n"; |
82 | $body .= "<form action='".$process."' method='post' enctype='multipart/form-data'>\n"; |
82 | $body .= "<input type='hidden' name='mode' value='distributive-edit'>\n"; |
83 | $body .= "<input type='hidden' name='mode' value='distributive-edit'>\n"; |
83 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
84 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
84 | $body .= $core->showDistributionForm($uuid, "Редактирование информации о дистрибутиве"); |
85 | $body .= $core->showDistributionForm($uuid, "Редактирование информации о дистрибутиве"); |
85 | $body .= "</form>"; |
86 | $body .= "</form>"; |
86 | break; |
87 | break; |
87 | case 'delete': |
88 | case 'delete': |
88 | $body .= "<form action='".$process."' method='post'>\n"; |
89 | $body .= "<form action='".$process."' method='post'>\n"; |
89 | $body .= "<input type='hidden' name='mode' value='distributive-delete'>\n"; |
90 | $body .= "<input type='hidden' name='mode' value='distributive-delete'>\n"; |
90 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
91 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
91 | $body .= $core->showDistributionForm($uuid, "Удаление информации о дистрибутиве"); |
92 | $body .= $core->showDistributionForm($uuid, "Удаление информации о дистрибутиве"); |
92 | $body .= "</form>"; |
93 | $body .= "</form>"; |
93 | break; |
94 | break; |
94 | }
|
95 | }
|
95 | $tmpl->assign('header', "CPanel"); |
96 | $tmpl->assign('header', "CPanel"); |
96 | $tmpl->assign('description', "Панель управления генератором"); |
97 | $tmpl->assign('description', "Панель управления генератором"); |
97 | $tmpl->assign('body', $body); |
98 | $tmpl->assign('body', $body); |
98 | $tmpl->display('manager.tpl'); |
99 | $tmpl->display('manager.tpl'); |
99 | break; |
100 | break; |
100 | case 'versions': |
101 | case 'versions': |
101 | // Управление версиями
|
102 | // Управление версиями
|
102 | $body = "<h3>Управление версиями</h3>"; |
103 | $body = "<h3>Управление версиями</h3>"; |
103 | switch ($action) { |
104 | switch ($action) { |
104 | case 'view': |
105 | case 'view': |
105 | $body .= "<p><a href='".$manager."?mode=versions&action=new'>Добавить новую версию дистрибутива</a></p>"; |
106 | $body .= "<p><a href='".$manager."?mode=versions&action=new'>Добавить новую версию дистрибутива</a></p>"; |
106 | $body .= $core->showDistVersionsList("versions", 0, "list", $manager); |
107 | $body .= $core->showDistVersionsList("versions", 0, "list", $manager); |
107 | break; |
108 | break; |
108 | case 'edit': |
109 | case 'edit': |
109 | $body .= "<form action='".$process."' method='post'>\n"; |
110 | $body .= "<form action='".$process."' method='post'>\n"; |
110 | $body .= "<input type='hidden' name='mode' value='version-edit'>\n"; |
111 | $body .= "<input type='hidden' name='mode' value='version-edit'>\n"; |
111 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
112 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
112 | $body .= $core->showDistVersionsForm($uuid, "Редактирование информации о версии дистрибутива"); |
113 | $body .= $core->showDistVersionsForm($uuid, "Редактирование информации о версии дистрибутива"); |
113 | $body .= "</form>"; |
114 | $body .= "</form>"; |
114 | break; |
115 | break; |
115 | case 'delete': |
116 | case 'delete': |
116 | $body .= "<form action='".$process."' method='post'>\n"; |
117 | $body .= "<form action='".$process."' method='post'>\n"; |
117 | $body .= "<input type='hidden' name='mode' value='version-delete'>\n"; |
118 | $body .= "<input type='hidden' name='mode' value='version-delete'>\n"; |
118 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
119 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
119 | $body .= $core->showDistVersionsForm($uuid, "Удаление информации о версии дистрибутива"); |
120 | $body .= $core->showDistVersionsForm($uuid, "Удаление информации о версии дистрибутива"); |
120 | $body .= "</form>"; |
121 | $body .= "</form>"; |
121 | break; |
122 | break; |
122 | case 'new': |
123 | case 'new': |
123 | $body .= "<form action='".$process."' method='post'>\n"; |
124 | $body .= "<form action='".$process."' method='post'>\n"; |
124 | $body .= "<input type='hidden' name='mode' value='version-add'>\n"; |
125 | $body .= "<input type='hidden' name='mode' value='version-add'>\n"; |
125 | $body .= $core->showDistVersionsForm(0, "Добавление новой версии дистрибутива"); |
126 | $body .= $core->showDistVersionsForm(0, "Добавление новой версии дистрибутива"); |
126 | $body .= "</form>"; |
127 | $body .= "</form>"; |
127 | break; |
128 | break; |
128 | }
|
129 | }
|
129 | $tmpl->assign('header', "CPanel"); |
130 | $tmpl->assign('header', "CPanel"); |
130 | $tmpl->assign('description', "Панель управления генератором"); |
131 | $tmpl->assign('description', "Панель управления генератором"); |
131 | $tmpl->assign('body', $body); |
132 | $tmpl->assign('body', $body); |
132 | $tmpl->display('manager.tpl'); |
133 | $tmpl->display('manager.tpl'); |
133 | break; |
134 | break; |
134 | case 'sections': |
135 | case 'sections': |
135 | // Управление секциями (deb)
|
136 | // Управление секциями (deb)
|
136 | $body = "<h3>Управление секциями репозиториев</h3>"; |
137 | $body = "<h3>Управление секциями репозиториев</h3>"; |
137 | switch ($action) { |
138 | switch ($action) { |
138 | case 'view': |
139 | case 'view': |
139 | $body .= "<p><a href='".$manager."?mode=sections&action=new'>Добавить новую секцию репозитория</a></p>"; |
140 | $body .= "<p><a href='".$manager."?mode=sections&action=new'>Добавить новую секцию репозитория</a></p>"; |
140 | $body .= $core->showSectionsList("sections", $manager); |
141 | $body .= $core->showSectionsList("sections", $manager); |
141 | break; |
142 | break; |
142 | case 'edit': |
143 | case 'edit': |
143 | $body .= "<form action='".$process."' method='post'>\n"; |
144 | $body .= "<form action='".$process."' method='post'>\n"; |
144 | $body .= "<input type='hidden' name='mode' value='section-edit'>\n"; |
145 | $body .= "<input type='hidden' name='mode' value='section-edit'>\n"; |
145 | $body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n"; |
146 | $body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n"; |
146 | $body .= $core->showSectionsForm($uuid, "Редактирование информации о секции"); |
147 | $body .= $core->showSectionsForm($uuid, "Редактирование информации о секции"); |
147 | $body .= "</form>"; |
148 | $body .= "</form>"; |
148 | break; |
149 | break; |
149 | case 'delete': |
150 | case 'delete': |
150 | $body .= "<form action='".$process."' method='post'>\n"; |
151 | $body .= "<form action='".$process."' method='post'>\n"; |
151 | $body .= "<input type='hidden' name='mode' value='section-delete'>\n"; |
152 | $body .= "<input type='hidden' name='mode' value='section-delete'>\n"; |
152 | $body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n"; |
153 | $body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n"; |
153 | $body .= $core->showSectionsForm($uuid, "Удаление информации о секции"); |
154 | $body .= $core->showSectionsForm($uuid, "Удаление информации о секции"); |
154 | $body .= "</form>"; |
155 | $body .= "</form>"; |
155 | break; |
156 | break; |
156 | case 'new': |
157 | case 'new': |
157 | $body .= "<form action='".$process."' method='post'>\n"; |
158 | $body .= "<form action='".$process."' method='post'>\n"; |
158 | $body .= "<input type='hidden' name='mode' value='section-add'>\n"; |
159 | $body .= "<input type='hidden' name='mode' value='section-add'>\n"; |
159 | $body .= $core->showSectionsForm(0, "Добавление новой секции"); |
160 | $body .= $core->showSectionsForm(0, "Добавление новой секции"); |
160 | $body .= "</form>"; |
161 | $body .= "</form>"; |
161 | break; |
162 | break; |
162 | }
|
163 | }
|
163 | $tmpl->assign('header', "CPanel"); |
164 | $tmpl->assign('header', "CPanel"); |
164 | $tmpl->assign('description', "Панель управления генератором"); |
165 | $tmpl->assign('description', "Панель управления генератором"); |
165 | $tmpl->assign('body', $body); |
166 | $tmpl->assign('body', $body); |
166 | $tmpl->display('manager.tpl'); |
167 | $tmpl->display('manager.tpl'); |
167 | break; |
168 | break; |
168 | case 'signs': |
169 | case 'signs': |
169 | // Управление подписями (rpm)
|
170 | // Управление подписями (rpm)
|
170 | $body = "<h3>Управление подписями репозиториев</h3>"; |
171 | $body = "<h3>Управление подписями репозиториев</h3>"; |
171 | switch ($action) { |
172 | switch ($action) { |
172 | case 'view': |
173 | case 'view': |
173 | $body .= "<p><a href='".$manager."?mode=signs&action=new'>Добавить новую подпись репозитория</a></p>"; |
174 | $body .= "<p><a href='".$manager."?mode=signs&action=new'>Добавить новую подпись репозитория</a></p>"; |
174 | $body .= $core->showSignsList("signs", $manager); |
175 | $body .= $core->showSignsList("signs", $manager); |
175 | break; |
176 | break; |
176 | case 'edit': |
177 | case 'edit': |
177 | $body .= "<form action='".$process."' method='post'>\n"; |
178 | $body .= "<form action='".$process."' method='post'>\n"; |
178 | $body .= "<input type='hidden' name='mode' value='sign-edit'>\n"; |
179 | $body .= "<input type='hidden' name='mode' value='sign-edit'>\n"; |
179 | $body .= "<input type='hidden' name='signID' value='".$uuid."'>\n"; |
180 | $body .= "<input type='hidden' name='signID' value='".$uuid."'>\n"; |
180 | $body .= $core->showSignsForm($uuid, "Редактирование информации о подписи"); |
181 | $body .= $core->showSignsForm($uuid, "Редактирование информации о подписи"); |
181 | $body .= "</form>"; |
182 | $body .= "</form>"; |
182 | break; |
183 | break; |
183 | case 'delete': |
184 | case 'delete': |
184 | $body .= "<form action='".$process."' method='post'>\n"; |
185 | $body .= "<form action='".$process."' method='post'>\n"; |
185 | $body .= "<input type='hidden' name='mode' value='sign-delete'>\n"; |
186 | $body .= "<input type='hidden' name='mode' value='sign-delete'>\n"; |
186 | $body .= "<input type='hidden' name='signID' value='".$uuid."'>\n"; |
187 | $body .= "<input type='hidden' name='signID' value='".$uuid."'>\n"; |
187 | $body .= $core->showSignsForm($uuid, "Удаление информации о подписи"); |
188 | $body .= $core->showSignsForm($uuid, "Удаление информации о подписи"); |
188 | $body .= "</form>"; |
189 | $body .= "</form>"; |
189 | break; |
190 | break; |
190 | case 'new': |
191 | case 'new': |
191 | $body .= "<form action='".$process."' method='post'>\n"; |
192 | $body .= "<form action='".$process."' method='post'>\n"; |
192 | $body .= "<input type='hidden' name='mode' value='sign-add'>\n"; |
193 | $body .= "<input type='hidden' name='mode' value='sign-add'>\n"; |
193 | $body .= $core->showSignsForm(0, "Добавление новой подписи"); |
194 | $body .= $core->showSignsForm(0, "Добавление новой подписи"); |
194 | $body .= "</form>"; |
195 | $body .= "</form>"; |
195 | break; |
196 | break; |
196 | }
|
197 | }
|
197 | $tmpl->assign('header', "CPanel"); |
198 | $tmpl->assign('header', "CPanel"); |
198 | $tmpl->assign('description', "Панель управления генератором"); |
199 | $tmpl->assign('description', "Панель управления генератором"); |
199 | $tmpl->assign('body', $body); |
200 | $tmpl->assign('body', $body); |
200 | $tmpl->display('manager.tpl'); |
201 | $tmpl->display('manager.tpl'); |
201 | break; |
202 | break; |
202 | case 'archs': |
203 | case 'archs': |
203 | // Управление архитектурами
|
204 | // Управление архитектурами
|
204 | $body = "<h3>Управление архитектурами</h3>"; |
205 | $body = "<h3>Управление архитектурами</h3>"; |
205 | switch ($action) { |
206 | switch ($action) { |
206 | case 'view': |
207 | case 'view': |
207 | $body .= "<p><a href='".$manager."?mode=archs&action=new'>Добавить новую архитектуру</a></p>"; |
208 | $body .= "<p><a href='".$manager."?mode=archs&action=new'>Добавить новую архитектуру</a></p>"; |
208 | $body .= $core->showArchList("archs", $manager, "list"); |
209 | $body .= $core->showArchList("archs", $manager, "list"); |
209 | break; |
210 | break; |
210 | case 'edit': |
211 | case 'edit': |
211 | $body .= "<form action='".$process."' method='post'>\n"; |
212 | $body .= "<form action='".$process."' method='post'>\n"; |
212 | $body .= "<input type='hidden' name='mode' value='arch-edit'>\n"; |
213 | $body .= "<input type='hidden' name='mode' value='arch-edit'>\n"; |
213 | $body .= "<input type='hidden' name='archID' value='".$uuid."'>\n"; |
214 | $body .= "<input type='hidden' name='archID' value='".$uuid."'>\n"; |
214 | $body .= $core->showArchForm($uuid, "Редактирование информации об архитектуре"); |
215 | $body .= $core->showArchForm($uuid, "Редактирование информации об архитектуре"); |
215 | $body .= "</form>"; |
216 | $body .= "</form>"; |
216 | break; |
217 | break; |
217 | case 'delete': |
218 | case 'delete': |
218 | $body .= "<form action='".$process."' method='post'>\n"; |
219 | $body .= "<form action='".$process."' method='post'>\n"; |
219 | $body .= "<input type='hidden' name='mode' value='arch-delete'>\n"; |
220 | $body .= "<input type='hidden' name='mode' value='arch-delete'>\n"; |
220 | $body .= "<input type='hidden' name='archID' value='".$uuid."'>\n"; |
221 | $body .= "<input type='hidden' name='archID' value='".$uuid."'>\n"; |
221 | $body .= $core->showArchForm($uuid, "Удаление информации об архитектуре"); |
222 | $body .= $core->showArchForm($uuid, "Удаление информации об архитектуре"); |
222 | $body .= "</form>"; |
223 | $body .= "</form>"; |
223 | break; |
224 | break; |
224 | case 'new': |
225 | case 'new': |
225 | $body .= "<form action='".$process."' method='post'>\n"; |
226 | $body .= "<form action='".$process."' method='post'>\n"; |
226 | $body .= "<input type='hidden' name='mode' value='arch-add'>\n"; |
227 | $body .= "<input type='hidden' name='mode' value='arch-add'>\n"; |
227 | $body .= $core->showArchForm(0, "Добавление новой архитектуре"); |
228 | $body .= $core->showArchForm(0, "Добавление новой архитектуре"); |
228 | $body .= "</form>"; |
229 | $body .= "</form>"; |
229 | break; |
230 | break; |
230 | }
|
231 | }
|
231 | $tmpl->assign('header', "CPanel"); |
232 | $tmpl->assign('header', "CPanel"); |
232 | $tmpl->assign('description', "Панель управления генератором"); |
233 | $tmpl->assign('description', "Панель управления генератором"); |
233 | $tmpl->assign('body', $body); |
234 | $tmpl->assign('body', $body); |
234 | $tmpl->display('manager.tpl'); |
235 | $tmpl->display('manager.tpl'); |
235 | break; |
236 | break; |
236 | case 'schemes': |
237 | case 'schemes': |
237 | // Управление схемами репозиториев
|
238 | // Управление схемами репозиториев
|
238 | $body = "<h3>Управление схемами репозиториев</h3>"; |
239 | $body = "<h3>Управление схемами репозиториев</h3>"; |
239 | switch ($action) { |
240 | switch ($action) { |
240 | case 'view': |
241 | case 'view': |
241 | $body .= "<p><a href='".$manager."?mode=schemes&action=new'>Добавить новую схему репозитория</a></p>"; |
242 | $body .= "<p><a href='".$manager."?mode=schemes&action=new'>Добавить новую схему репозитория</a></p>"; |
242 | $body .= $core->showSchemeList("schemes", $manager, "list"); |
243 | $body .= $core->showSchemeList("schemes", $manager, "list"); |
243 | break; |
244 | break; |
244 | case 'edit': |
245 | case 'edit': |
245 | $body .= "<form action='".$process."' method='post'>\n"; |
246 | $body .= "<form action='".$process."' method='post'>\n"; |
246 | $body .= "<input type='hidden' name='mode' value='scheme-edit'>\n"; |
247 | $body .= "<input type='hidden' name='mode' value='scheme-edit'>\n"; |
247 | $body .= "<input type='hidden' name='schemeID' value='".$uuid."'>\n"; |
248 | $body .= "<input type='hidden' name='schemeID' value='".$uuid."'>\n"; |
248 | $body .= $core->showSchemeForm($uuid, "Редактирование информации о схеме репозитория"); |
249 | $body .= $core->showSchemeForm($uuid, "Редактирование информации о схеме репозитория"); |
249 | $body .= "</form>"; |
250 | $body .= "</form>"; |
250 | break; |
251 | break; |
251 | case 'delete': |
252 | case 'delete': |
252 | $body .= "<form action='".$process."' method='post'>\n"; |
253 | $body .= "<form action='".$process."' method='post'>\n"; |
253 | $body .= "<input type='hidden' name='mode' value='scheme-delete'>\n"; |
254 | $body .= "<input type='hidden' name='mode' value='scheme-delete'>\n"; |
254 | $body .= "<input type='hidden' name='schemeID' value='".$uuid."'>\n"; |
255 | $body .= "<input type='hidden' name='schemeID' value='".$uuid."'>\n"; |
255 | $body .= $core->showSchemeForm($uuid, "Удаление информации о схеме репозитория"); |
256 | $body .= $core->showSchemeForm($uuid, "Удаление информации о схеме репозитория"); |
256 | $body .= "</form>"; |
257 | $body .= "</form>"; |
257 | break; |
258 | break; |
258 | case 'new': |
259 | case 'new': |
259 | $body .= "<form action='".$process."' method='post'>\n"; |
260 | $body .= "<form action='".$process."' method='post'>\n"; |
260 | $body .= "<input type='hidden' name='mode' value='scheme-add'>\n"; |
261 | $body .= "<input type='hidden' name='mode' value='scheme-add'>\n"; |
261 | $body .= $core->showSchemeForm(0, "Добавление новой схемы репозитория"); |
262 | $body .= $core->showSchemeForm(0, "Добавление новой схемы репозитория"); |
262 | $body .= "</form>"; |
263 | $body .= "</form>"; |
- | 264 | break; |
|
- | 265 | }
|
|
- | 266 | $tmpl->assign('header', "CPanel"); |
|
- | 267 | $tmpl->assign('description', "Панель управления генератором"); |
|
- | 268 | $tmpl->assign('body', $body); |
|
- | 269 | $tmpl->display('manager.tpl'); |
|
- | 270 | break; |
|
- | 271 | case 'protos': |
|
- | 272 | // Управление протоколами доступа
|
|
- | 273 | $body = "<h3>Управление протоколами доступа</h3>"; |
|
- | 274 | switch ($action) { |
|
- | 275 | case 'view': |
|
- | 276 | $body .= "<p><a href='".$manager."?mode=protos&action=new'>Добавить новый протокол доступа</a></p>"; |
|
- | 277 | $body .= $core->showProtoList("protos", $manager, "list"); |
|
- | 278 | break; |
|
- | 279 | case 'edit': |
|
- | 280 | $body .= "<form action='".$process."' method='post'>\n"; |
|
- | 281 | $body .= "<input type='hidden' name='mode' value='proto-edit'>\n"; |
|
- | 282 | $body .= "<input type='hidden' name='protoID' value='".$uuid."'>\n"; |
|
- | 283 | $body .= $core->showProtoForm($uuid, "Редактирование информации о протоколе доступа"); |
|
- | 284 | $body .= "</form>"; |
|
- | 285 | break; |
|
- | 286 | case 'delete': |
|
- | 287 | $body .= "<form action='".$process."' method='post'>\n"; |
|
- | 288 | $body .= "<input type='hidden' name='mode' value='proto-delete'>\n"; |
|
- | 289 | $body .= "<input type='hidden' name='protoID' value='".$uuid."'>\n"; |
|
- | 290 | $body .= $core->showProtoForm($uuid, "Удаление информации о протоколе доступа"); |
|
- | 291 | $body .= "</form>"; |
|
- | 292 | break; |
|
- | 293 | case 'new': |
|
- | 294 | $body .= "<form action='".$process."' method='post'>\n"; |
|
- | 295 | $body .= "<input type='hidden' name='mode' value='proto-add'>\n"; |
|
- | 296 | $body .= $core->showProtoForm(0, "Добавление нового протокола доступа"); |
|
- | 297 | $body .= "</form>"; |
|
263 | break; |
298 | break; |
264 | }
|
299 | }
|
265 | $tmpl->assign('header', "CPanel"); |
300 | $tmpl->assign('header', "CPanel"); |
266 | $tmpl->assign('description', "Панель управления генератором"); |
301 | $tmpl->assign('description', "Панель управления генератором"); |
267 | $tmpl->assign('body', $body); |
302 | $tmpl->assign('body', $body); |
268 | $tmpl->display('manager.tpl'); |
303 | $tmpl->display('manager.tpl'); |
269 | break; |
304 | break; |
270 | case 'repositories': |
305 | case 'repositories': |
271 | // Управление репозиториями
|
306 | // Управление репозиториями
|
272 | $body = "<h3>Управление репозиториями</h3>"; |
307 | $body = "<h3>Управление репозиториями</h3>"; |
273 | switch ($action) { |
308 | switch ($action) { |
274 | case 'view': |
309 | case 'view': |
275 | $body .= "<ul><li><a href='".$manager."?mode=repositories&action=new-rpm'>Добавить новый rpm-репозиторий (мастер)</a></li>"; |
310 | $body .= "<ul><li><a href='".$manager."?mode=repositories&action=new-rpm'>Добавить новый rpm-репозиторий (мастер)</a></li>"; |
276 | $body .= "<li><a href='".$manager."?mode=repositories&action=new-deb'>Добавить новый deb-репозиторий (мастер)</a></li>"; |
311 | $body .= "<li><a href='".$manager."?mode=repositories&action=new-deb'>Добавить новый deb-репозиторий (мастер)</a></li>"; |
277 | $body .= "<li><a href='".$manager."?mode=repositories&action=new'>Добавить новый репозиторий (“хакерский” способ)</a></li></ul>"; |
312 | $body .= "<li><a href='".$manager."?mode=repositories&action=new'>Добавить новый репозиторий (“хакерский” способ)</a></li></ul>"; |
278 | $body .= $core->showRepositoriesList("repositories", $manager, "list"); |
313 | $body .= $core->showRepositoriesList("repositories", $manager, "list"); |
279 | break; |
314 | break; |
280 | case 'edit': |
315 | case 'edit': |
281 | $body .= "<form action='".$process."' method='post'>\n"; |
316 | $body .= "<form action='".$process."' method='post'>\n"; |
282 | $body .= "<input type='hidden' name='mode' value='repositories-edit'>\n"; |
317 | $body .= "<input type='hidden' name='mode' value='repositories-edit'>\n"; |
283 | $body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n"; |
318 | $body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n"; |
284 | $body .= $core->showRepositoriesForm($uuid, "Редактирование информации о репозитории"); |
319 | $body .= $core->showRepositoriesForm($uuid, "Редактирование информации о репозитории"); |
285 | $body .= "</form>"; |
320 | $body .= "</form>"; |
286 | break; |
321 | break; |
287 | case 'delete': |
322 | case 'delete': |
288 | $body .= "<form action='".$process."' method='post'>\n"; |
323 | $body .= "<form action='".$process."' method='post'>\n"; |
289 | $body .= "<input type='hidden' name='mode' value='repositories-delete'>\n"; |
324 | $body .= "<input type='hidden' name='mode' value='repositories-delete'>\n"; |
290 | $body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n"; |
325 | $body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n"; |
291 | $body .= $core->showRepositoriesForm($uuid, "Удаление информации о репозитории"); |
326 | $body .= $core->showRepositoriesForm($uuid, "Удаление информации о репозитории"); |
292 | $body .= "</form>"; |
327 | $body .= "</form>"; |
293 | break; |
328 | break; |
294 | case 'new-rpm': |
329 | case 'new-rpm': |
295 | $body .= "<form action='".$process."' method='post'>\n"; |
330 | $body .= "<form action='".$process."' method='post'>\n"; |
296 | $body .= "<input type='hidden' name='mode' value='repositories-add-rpm'>\n"; |
331 | $body .= "<input type='hidden' name='mode' value='repositories-add-rpm'>\n"; |
297 | $body .= $core->showRepositoriesForm(0, "Добавление нового rpm-репозитория", "rpm"); |
332 | $body .= $core->showRepositoriesForm(0, "Добавление нового rpm-репозитория", "rpm"); |
298 | $body .= "</form>"; |
333 | $body .= "</form>"; |
299 | break; |
334 | break; |
300 | case 'new-deb': |
335 | case 'new-deb': |
301 | $body .= "<form action='".$process."' method='post'>\n"; |
336 | $body .= "<form action='".$process."' method='post'>\n"; |
302 | $body .= "<input type='hidden' name='mode' value='repositories-add-deb'>\n"; |
337 | $body .= "<input type='hidden' name='mode' value='repositories-add-deb'>\n"; |
303 | $body .= $core->showRepositoriesForm(0, "Добавление нового deb-репозитория", "deb"); |
338 | $body .= $core->showRepositoriesForm(0, "Добавление нового deb-репозитория", "deb"); |
304 | $body .= "</form>"; |
339 | $body .= "</form>"; |
305 | break; |
340 | break; |
306 | case 'new': |
341 | case 'new': |
307 | $body .= "<form action='".$process."' method='post'>\n"; |
342 | $body .= "<form action='".$process."' method='post'>\n"; |
308 | $body .= "<input type='hidden' name='mode' value='repositories-add'>\n"; |
343 | $body .= "<input type='hidden' name='mode' value='repositories-add'>\n"; |
309 | $body .= "<fieldset><legend>Добавление нового репозитория</legend>\n"; |
344 | $body .= "<fieldset><legend>Добавление нового репозитория</legend>\n"; |
310 | $body .= "<div class='inputbox'><label for='repscheme'>Строка sources.list:</label> <input type='text' id='repscheme' name='repscheme' value=''></div>\n"; |
345 | $body .= "<div class='inputbox'><label for='repscheme'>Строка sources.list:</label> <input type='text' id='repscheme' name='repscheme' value=''></div>\n"; |
311 | $body .= "<div class='inputbox'><input type='submit' value=' Обработать строку '></div>\n"; |
346 | $body .= "<div class='inputbox'><input type='submit' value=' Обработать строку '></div>\n"; |
312 | $body .= "</fieldset></form>"; |
347 | $body .= "</fieldset></form>"; |
313 | break; |
348 | break; |
314 | }
|
349 | }
|
315 | 350 | ||
316 | $tmpl->assign('header', "CPanel"); |
351 | $tmpl->assign('header', "CPanel"); |
317 | $tmpl->assign('description', "Панель управления генератором"); |
352 | $tmpl->assign('description', "Панель управления генератором"); |
318 | $tmpl->assign('body', $body); |
353 | $tmpl->assign('body', $body); |
319 | $tmpl->display('manager.tpl'); |
354 | $tmpl->display('manager.tpl'); |
320 | break; |
355 | break; |
321 | case 'settings': |
356 | case 'settings': |
322 | // Настройки генератора
|
357 | // Настройки генератора
|
323 | $body = "Функционал еще не готов"; |
358 | $body = "Функционал еще не готов"; |
324 | 359 | ||
325 | $tmpl->assign('header', "CPanel"); |
360 | $tmpl->assign('header', "CPanel"); |
326 | $tmpl->assign('description', "Панель управления генератором"); |
361 | $tmpl->assign('description', "Панель управления генератором"); |
327 | $tmpl->assign('body', $body); |
362 | $tmpl->assign('body', $body); |
328 | $tmpl->display('manager.tpl'); |
363 | $tmpl->display('manager.tpl'); |
329 | break; |
364 | break; |
330 | }
|
365 | }
|
331 | 366 | ||
332 | ?>
|
367 | ?>
|
333 | 368 |