Редакция 512 | К новейшей редакции | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 512 | Редакция 513 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | /**
|
2 | /**
|
3 | *
|
3 | *
|
4 | * Codename: ant-ng - generator of sources.list for Debian and
|
4 | * Codename: ant-ng - generator of sources.list for Debian and
|
5 | * distributives, based on Debian
|
5 | * distributives, based on Debian
|
6 | * http://alex-w.org.ru/p/antng/
|
6 | * http://alex-w.org.ru/p/antng/
|
7 | *
|
7 | *
|
8 | * Copyright (c) 2009 Alexander Wolf
|
8 | * Copyright (c) 2009 Alexander Wolf
|
9 | * Dual licensed under the MIT and GNU LGPL licenses.
|
9 | * Dual licensed under the MIT and GNU LGPL licenses.
|
10 | * http://alex-w.org.ru/p/antng/license
|
10 | * http://alex-w.org.ru/p/antng/license
|
11 | *
|
11 | *
|
12 | */
|
12 | */
|
13 | 13 | ||
14 | require_once dirname(__FILE__)."/init.php"; |
14 | require_once dirname(__FILE__)."/init.php"; |
15 | 15 | ||
16 | if(!empty($_GET["action"])) { |
16 | if(!empty($_GET["action"])) { |
17 | $action = $_GET["action"]; |
17 | $action = $_GET["action"]; |
18 | } else { |
18 | } else { |
19 | $action = "view"; |
19 | $action = "view"; |
20 | }
|
20 | }
|
21 | if(!empty($_GET["mode"])) { |
21 | if(!empty($_GET["mode"])) { |
22 | $mode = $_GET["mode"]; |
22 | $mode = $_GET["mode"]; |
23 | } else { |
23 | } else { |
24 | $mode = "empty"; |
24 | $mode = "empty"; |
25 | }
|
25 | }
|
26 | 26 | ||
27 | $uuid = $secure->checkInt($_GET["uuid"]); |
27 | $uuid = $secure->checkInt($_GET["uuid"]); |
28 | 28 | ||
29 | $valid = $core->checkCookieSign($_COOKIE[$cookie]); |
29 | $valid = $core->checkCookieSign($_COOKIE[$cookie]); |
30 | $manager = "./manager.php"; |
30 | $manager = "./manager.php"; |
31 | $process = "./process.php"; |
31 | $process = "./process.php"; |
32 | 32 | ||
33 | $scripts = ""; |
33 | $scripts = ""; |
34 | 34 | ||
35 | $menu = "<fieldset><legend>Меню</legend>\n"; |
35 | $menu = "<fieldset><legend>Меню</legend>\n"; |
36 | $menu .= "<div id='rmenu'></div>\n"; |
36 | $menu .= "<div id='rmenu'></div>\n"; |
37 | $menu .= "<ul class='vfix'><li><a href='".$manager."?mode=distributions'>Дистрибутивы</a></li>"; |
37 | $menu .= "<ul class='vfix'><li><a href='".$manager."?mode=distributions'>Дистрибутивы</a></li>"; |
38 | $menu .= "<li><a href='".$manager."?mode=versions'>Версии</a></li>"; |
38 | $menu .= "<li><a href='".$manager."?mode=versions'>Версии</a></li>"; |
39 | $menu .= "<li><a href='".$manager."?mode=repositories'>Репозитории</a></li>"; |
39 | $menu .= "<li><a href='".$manager."?mode=repositories'>Репозитории</a></li>"; |
40 | $menu .= "<li><a href='".$manager."?mode=settings'>Настройки</a></li>"; |
40 | $menu .= "<li><a href='".$manager."?mode=settings'>Настройки</a></li>"; |
41 | $menu .= "<li><a href='".$manager."?mode=exit'>Выход</a></li></ul>"; |
41 | $menu .= "<li><a href='".$manager."?mode=exit'>Выход</a></li></ul>"; |
42 | $menu .=" </fieldset>\n"; |
42 | $menu .=" </fieldset>\n"; |
43 | 43 | ||
44 | $tmpl->assign('scripts', $scripts); |
44 | $tmpl->assign('scripts', $scripts); |
45 | $tmpl->assign('menu', $menu); |
45 | $tmpl->assign('menu', $menu); |
46 | 46 | ||
47 | switch ($mode) { |
47 | switch ($mode) { |
48 | case 'empty': |
48 | case 'empty': |
49 | if ($valid["ERR"]==1) { |
49 | if ($valid["ERR"]==1) { |
50 | $tmpl->assign('header', "Вход"); |
50 | $tmpl->assign('header', "Вход"); |
51 | $tmpl->assign('description', "Вход в панель управления генератором"); |
51 | $tmpl->assign('description', "Вход в панель управления генератором"); |
52 | $tmpl->assign('body', $core->showSigninForm()); |
52 | $tmpl->assign('body', $core->showSigninForm()); |
53 | $tmpl->display('default.tpl'); |
53 | $tmpl->display('default.tpl'); |
54 | } else { |
54 | } else { |
55 | $tmpl->assign('header', "CPanel"); |
55 | $tmpl->assign('header', "CPanel"); |
56 | $tmpl->assign('description', "Панель управления генератором"); |
56 | $tmpl->assign('description', "Панель управления генератором"); |
57 | $tmpl->assign('body', $body); |
57 | $tmpl->assign('body', $body); |
58 | $tmpl->display('manager.tpl'); |
58 | $tmpl->display('manager.tpl'); |
59 | }
|
59 | }
|
60 | break; |
60 | break; |
61 | case 'exit': |
61 | case 'exit': |
62 | setcookie($cookie, '', time()-10); |
62 | setcookie($cookie, '', time()-10); |
63 | header("Location: ./\n\n"); |
63 | header("Location: ./\n\n"); |
64 | break; |
64 | break; |
65 | case 'distributions': |
65 | case 'distributions': |
66 | // Управление дистрибутивами
|
66 | // Управление дистрибутивами
|
67 | $body = "<h3>Управление дистрибутивами</h3>"; |
67 | $body = "<h3>Управление дистрибутивами</h3>"; |
68 | switch ($action) { |
68 | switch ($action) { |
69 | case 'view': |
69 | case 'view': |
70 | $body .= "<p><a href='".$manager."?mode=distributions&action=new'>Добавить новый дистрибутив</a></p>"; |
70 | $body .= "<p><a href='".$manager."?mode=distributions&action=new'>Добавить новый дистрибутив</a></p>"; |
71 | $body .= $core->showDistributionList("distributions", $maganer, "", "list"); |
71 | $body .= $core->showDistributionList("distributions", $maganer, "", "list"); |
72 | break; |
72 | break; |
73 | case 'new': |
73 | case 'new': |
74 | $body .= "<form action='".$process."' method='post'>\n"; |
74 | $body .= "<form action='".$process."' method='post'>\n"; |
75 | $body .= "<input type='hidden' name='mode' value='distributive-add'>\n"; |
75 | $body .= "<input type='hidden' name='mode' value='distributive-add'>\n"; |
76 | $body .= $core->showDistributionForm(0,"Добавление информации о новом дистрибутиве"); |
76 | $body .= $core->showDistributionForm(0,"Добавление информации о новом дистрибутиве"); |
77 | $body .= "</form>"; |
77 | $body .= "</form>"; |
78 | break; |
78 | break; |
79 | case 'edit': |
79 | case 'edit': |
80 | $body .= "<form action='".$process."' method='post'>\n"; |
80 | $body .= "<form action='".$process."' method='post'>\n"; |
81 | $body .= "<input type='hidden' name='mode' value='distributive-edit'>\n"; |
81 | $body .= "<input type='hidden' name='mode' value='distributive-edit'>\n"; |
82 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
82 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
83 | $body .= $core->showDistributionForm($uuid, "Редактирование информации о дистрибутиве"); |
83 | $body .= $core->showDistributionForm($uuid, "Редактирование информации о дистрибутиве"); |
84 | $body .= "</form>"; |
84 | $body .= "</form>"; |
85 | break; |
85 | break; |
86 | case 'delete': |
86 | case 'delete': |
87 | $body .= "<form action='".$process."' method='post'>\n"; |
87 | $body .= "<form action='".$process."' method='post'>\n"; |
88 | $body .= "<input type='hidden' name='mode' value='distributive-delete'>\n"; |
88 | $body .= "<input type='hidden' name='mode' value='distributive-delete'>\n"; |
89 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
89 | $body .= "<input type='hidden' name='distID' value='".$uuid."'>\n"; |
90 | $body .= $core->showDistributionForm($uuid, "Удаление информации о дистрибутиве"); |
90 | $body .= $core->showDistributionForm($uuid, "Удаление информации о дистрибутиве"); |
91 | $body .= "</form>"; |
91 | $body .= "</form>"; |
92 | break; |
92 | break; |
93 | }
|
93 | }
|
94 | $tmpl->assign('header', "CPanel"); |
94 | $tmpl->assign('header', "CPanel"); |
95 | $tmpl->assign('description', "Панель управления генератором"); |
95 | $tmpl->assign('description', "Панель управления генератором"); |
96 | $tmpl->assign('body', $body); |
96 | $tmpl->assign('body', $body); |
97 | $tmpl->display('manager.tpl'); |
97 | $tmpl->display('manager.tpl'); |
98 | break; |
98 | break; |
99 | case 'versions': |
99 | case 'versions': |
100 | // Управление версиями
|
100 | // Управление версиями
|
101 | $body = "<h3>Управление версиями</h3>"; |
101 | $body = "<h3>Управление версиями</h3>"; |
102 | switch ($action) { |
102 | switch ($action) { |
103 | case 'view': |
103 | case 'view': |
104 | $body .= "<p><a href='".$manager."?mode=versions&action=new'>Добавить новую версию дистрибутива</a></p>"; |
104 | $body .= "<p><a href='".$manager."?mode=versions&action=new'>Добавить новую версию дистрибутива</a></p>"; |
105 | $body .= $core->showDistVersionsList("versions", 0, "list", $manager); |
105 | $body .= $core->showDistVersionsList("versions", 0, "list", $manager); |
106 | break; |
106 | break; |
107 | case 'edit': |
107 | case 'edit': |
108 | $body .= "<form action='".$process."' method='post'>\n"; |
108 | $body .= "<form action='".$process."' method='post'>\n"; |
109 | $body .= "<input type='hidden' name='mode' value='version-edit'>\n"; |
109 | $body .= "<input type='hidden' name='mode' value='version-edit'>\n"; |
110 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
110 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
111 | $body .= $core->showDistVersionsForm($uuid, "Редактирование информации о версии дистрибутива"); |
111 | $body .= $core->showDistVersionsForm($uuid, "Редактирование информации о версии дистрибутива"); |
112 | $body .= "</form>"; |
112 | $body .= "</form>"; |
113 | break; |
113 | break; |
114 | case 'delete': |
114 | case 'delete': |
115 | $body .= "<form action='".$process."' method='post'>\n"; |
115 | $body .= "<form action='".$process."' method='post'>\n"; |
116 | $body .= "<input type='hidden' name='mode' value='version-delete'>\n"; |
116 | $body .= "<input type='hidden' name='mode' value='version-delete'>\n"; |
117 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
117 | $body .= "<input type='hidden' name='versionID' value='".$uuid."'>\n"; |
118 | $body .= $core->showDistVersionsForm($uuid, "Удаление информации о версии дистрибутива"); |
118 | $body .= $core->showDistVersionsForm($uuid, "Удаление информации о версии дистрибутива"); |
119 | $body .= "</form>"; |
119 | $body .= "</form>"; |
120 | break; |
120 | break; |
121 | case 'new': |
121 | case 'new': |
122 | $body .= "<form action='".$process."' method='post'>\n"; |
122 | $body .= "<form action='".$process."' method='post'>\n"; |
123 | $body .= "<input type='hidden' name='mode' value='version-add'>\n"; |
123 | $body .= "<input type='hidden' name='mode' value='version-add'>\n"; |
124 | $body .= $core->showDistVersionsForm(0, "Добавление новой версии дистрибутива"); |
124 | $body .= $core->showDistVersionsForm(0, "Добавление новой версии дистрибутива"); |
125 | $body .= "</form>"; |
125 | $body .= "</form>"; |
126 | break; |
126 | break; |
127 | }
|
127 | }
|
128 | $tmpl->assign('header', "CPanel"); |
128 | $tmpl->assign('header', "CPanel"); |
129 | $tmpl->assign('description', "Панель управления генератором"); |
129 | $tmpl->assign('description', "Панель управления генератором"); |
130 | $tmpl->assign('body', $body); |
130 | $tmpl->assign('body', $body); |
131 | $tmpl->display('manager.tpl'); |
131 | $tmpl->display('manager.tpl'); |
132 | break; |
132 | break; |
133 | case 'repositories': |
133 | case 'repositories': |
134 | // Управление репозиториями
|
134 | // Управление репозиториями
|
- | 135 | $body = "Функционал еще не готов"; |
|
- | 136 | ||
- | 137 | $tmpl->assign('header', "CPanel"); |
|
- | 138 | $tmpl->assign('description', "Панель управления генератором"); |
|
- | 139 | $tmpl->assign('body', $body); |
|
- | 140 | $tmpl->display('manager.tpl'); |
|
135 | break; |
141 | break; |
136 | case 'settings': |
142 | case 'settings': |
137 | // Настройки генератора
|
143 | // Настройки генератора
|
- | 144 | $body = "Функционал еще не готов"; |
|
- | 145 | ||
- | 146 | $tmpl->assign('header', "CPanel"); |
|
- | 147 | $tmpl->assign('description', "Панель управления генератором"); |
|
- | 148 | $tmpl->assign('body', $body); |
|
- | 149 | $tmpl->display('manager.tpl'); |
|
138 | break; |
150 | break; |
139 | }
|
151 | }
|
140 | 152 | ||
141 | ?>
|
153 | ?>
|
142 | 154 |