Хранилища Subversion ant

Редакция

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

Редакция 539 Редакция 554
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 *  
4
 *  
5
 *  Codename: ant-ng - generator of sources.list for Debian and
5
 *  Codename: ant-ng - generator of sources.list for apt-distributives
6
 *  distributives, based on Debian
-
 
7
 *  http://alex-w.org.ru/p/antng/
6
 *  http://alex-w.org.ru/p/antng/
8
 *
7
 *
9
 *  Copyright (c) 2009 Alexander Wolf
8
 *  Copyright (c) 2009 Alexander Wolf
10
 *  Dual licensed under the MIT and GNU LGPL licenses.
9
 *  Dual licensed under the MIT and GNU LGPL licenses.
11
 *  http://alex-w.org.ru/p/antng/license
10
 *  http://alex-w.org.ru/p/antng/license
12
 *
11
 *
13
 */
12
 */
14
13
15
require_once dirname(__FILE__)."/init.php";
14
require_once dirname(__FILE__)."/init.php";
16
15
17
$mode = $_POST["mode"];
16
$mode = $_POST["mode"];
18
17
19
switch ($mode) {
18
switch ($mode) {
20
    case 'authorize':
19
    case 'authorize':
21
        $r = $core->checkSign($_POST["word"]);
20
        $r = $core->checkSign($_POST["word"]);
22
        header("Location: ".$r["Location"]."\n\n");
21
        header("Location: ".$r["Location"]."\n\n");
23
        break;
22
        break;
24
    case 'distributive-add':
23
    case 'distributive-add':
25
        // Добавление нового дистрибутива
24
        // Добавление нового дистрибутива
26
        $DName  = $secure->checkStr($_POST["dname"],1);
25
        $DName  = $secure->checkStr($_POST["dname"],1);
27
        $DUA    = $secure->checkStr($_POST["dua"],1);
26
        $DUA    = $secure->checkStr($_POST["dua"],1);
28
        $DType  = $secure->checkInt($_POST["dtype"]);
27
        $DType  = $secure->checkInt($_POST["dtype"]);
29
        $DLogo  = 0;
28
        $DLogo  = 0;
30
29
31
        if ($_FILES["distlogo"]["type"]!="") {
30
        if ($_FILES["distlogo"]["type"]!="") {
32
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
31
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
33
        }
32
        }
34
33
35
        $r = $core->addDistribution($DName, $DType, $DUA, $DLogo);
34
        $r = $core->addDistribution($DName, $DType, $DUA, $DLogo);
36
        if ($r["ERR"]==0) {
35
        if ($r["ERR"]==0) {
37
            header("Location: ".$manager."\n\n");
36
            header("Location: ".$manager."\n\n");
38
        } else {
37
        } else {
39
            echo $r["ERRINFO"];
38
            echo $r["ERRINFO"];
40
        }
39
        }
41
40
42
        break;
41
        break;
43
    case 'distributive-edit':
42
    case 'distributive-edit':
44
        // Редактирование информации о дистрибутиве
43
        // Редактирование информации о дистрибутиве
45
        $ID     = $secure->checkInt($_POST["distID"]);
44
        $ID     = $secure->checkInt($_POST["distID"]);
46
        $DName  = $secure->checkStr($_POST["dname"],1);
45
        $DName  = $secure->checkStr($_POST["dname"],1);
47
        $DUA    = $secure->checkStr($_POST["dua"],1);
46
        $DUA    = $secure->checkStr($_POST["dua"],1);
48
        $DType  = $secure->checkInt($_POST["dtype"]);
47
        $DType  = $secure->checkInt($_POST["dtype"]);
49
       
48
       
50
       
49
       
51
        if ($_FILES["distlogo"]["type"]!="") {
50
        if ($_FILES["distlogo"]["type"]!="") {
52
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
51
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
53
            $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo);
52
            $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo);
54
        }
53
        }
55
54
56
        $r = $core->updateDistribution($ID, $DName, $DType, $DUA);
55
        $r = $core->updateDistribution($ID, $DName, $DType, $DUA);
57
        if ($r["ERR"]==0) {
56
        if ($r["ERR"]==0) {
58
            header("Location: ".$manager."\n\n");
57
            header("Location: ".$manager."\n\n");
59
        } else {
58
        } else {
60
            echo $r["ERRINFO"];
59
            echo $r["ERRINFO"];
61
        }
60
        }
62
61
63
        break;
62
        break;
64
    case 'distributive-delete':
63
    case 'distributive-delete':
65
        // Удаление информации о дистрибутиве
64
        // Удаление информации о дистрибутиве
66
        $ID     = $secure->checkInt($_POST["distID"]);
65
        $ID     = $secure->checkInt($_POST["distID"]);
67
66
68
        $r = $core->dropDistribution($ID);
67
        $r = $core->dropDistribution($ID);
69
        if ($r["ERR"]==0) {
68
        if ($r["ERR"]==0) {
70
            header("Location: ".$manager."\n\n");
69
            header("Location: ".$manager."\n\n");
71
        } else {
70
        } else {
72
            echo $r["ERRINFO"];
71
            echo $r["ERRINFO"];
73
        }
72
        }
74
73
75
        break;
74
        break;
76
    case 'version-add':
75
    case 'version-add':
77
        // Добавление новой версии дистрибутива
76
        // Добавление новой версии дистрибутива
78
        $DistID = $secure->checkInt($_POST["distname"]);
77
        $DistID = $secure->checkInt($_POST["distname"]);
79
        $VName  = $secure->checkStr($_POST["vname"],1);
78
        $VName  = $secure->checkStr($_POST["vname"],1);
80
        $VNmbr  = $secure->checkStr($_POST["version"],1);
79
        $VNmbr  = $secure->checkStr($_POST["version"],1);
81
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
80
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
82
81
83
        $r = $core->addDistVersion($DistID, $VNmbr, $VName, $VCNme);
82
        $r = $core->addDistVersion($DistID, $VNmbr, $VName, $VCNme);
84
        if ($r["ERR"]==0) {
83
        if ($r["ERR"]==0) {
85
            header("Location: ".$manager."\n\n");
84
            header("Location: ".$manager."\n\n");
86
        } else {
85
        } else {
87
            echo $r["ERRINFO"];
86
            echo $r["ERRINFO"];
88
        }
87
        }
89
88
90
        break;
89
        break;
91
    case 'version-edit':
90
    case 'version-edit':
92
        // Редактирование версии дистрибутива
91
        // Редактирование версии дистрибутива
93
        $versID = $secure->checkInt($_POST["versionID"]);
92
        $versID = $secure->checkInt($_POST["versionID"]);
94
        $VName  = $secure->checkStr($_POST["vname"],1);
93
        $VName  = $secure->checkStr($_POST["vname"],1);
95
        $VNmbr  = $secure->checkStr($_POST["version"],1);
94
        $VNmbr  = $secure->checkStr($_POST["version"],1);
96
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
95
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
97
96
98
        $r = $core->updateDistVersion($versID, $VNmbr, $VName, $VCNme);
97
        $r = $core->updateDistVersion($versID, $VNmbr, $VName, $VCNme);
99
        if ($r["ERR"]==0) {
98
        if ($r["ERR"]==0) {
100
            header("Location: ".$manager."\n\n");
99
            header("Location: ".$manager."\n\n");
101
        } else {
100
        } else {
102
            echo $r["ERRINFO"];
101
            echo $r["ERRINFO"];
103
        }
102
        }
104
103
105
        break;
104
        break;
106
    case 'version-delete':
105
    case 'version-delete':
107
        // Удаление версии дистрибутива
106
        // Удаление версии дистрибутива
108
        $versID = $secure->checkInt($_POST["versionID"]);
107
        $versID = $secure->checkInt($_POST["versionID"]);
109
108
110
        $r = $core->dropDistVersion($versID);
109
        $r = $core->dropDistVersion($versID);
111
        if ($r["ERR"]==0) {
110
        if ($r["ERR"]==0) {
112
            header("Location: ".$manager."\n\n");
111
            header("Location: ".$manager."\n\n");
113
        } else {
112
        } else {
114
            echo $r["ERRINFO"];
113
            echo $r["ERRINFO"];
115
        }
114
        }
116
115
117
        break;
116
        break;
118
    case 'section-add':
117
    case 'section-add':
119
        // Добавление новой секции
118
        // Добавление новой секции
120
        $SName  = $secure->checkStr($_POST["sname"],1);
119
        $SName  = $secure->checkStr($_POST["sname"],1);
121
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
120
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
122
121
123
        $r = $core->addSection($SName, $SInfo);
122
        $r = $core->addSection($SName, $SInfo);
124
        if ($r["ERR"]==0) {
123
        if ($r["ERR"]==0) {
125
            header("Location: ".$manager."\n\n");
124
            header("Location: ".$manager."\n\n");
126
        } else {
125
        } else {
127
            echo $r["ERRINFO"];
126
            echo $r["ERRINFO"];
128
        }
127
        }
129
128
130
        break;
129
        break;
131
    case 'section-edit':
130
    case 'section-edit':
132
        // Редактирование информации о секции
131
        // Редактирование информации о секции
133
        $sectID = $secure->checkInt($_POST["sectionID"]);
132
        $sectID = $secure->checkInt($_POST["sectionID"]);
134
        $SName  = $secure->checkStr($_POST["sname"],1);
133
        $SName  = $secure->checkStr($_POST["sname"],1);
135
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
134
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
136
135
137
        $r = $core->updateSection($sectID, $SName, $SInfo);
136
        $r = $core->updateSection($sectID, $SName, $SInfo);
138
        if ($r["ERR"]==0) {
137
        if ($r["ERR"]==0) {
139
            header("Location: ".$manager."\n\n");
138
            header("Location: ".$manager."\n\n");
140
        } else {
139
        } else {
141
            echo $r["ERRINFO"];
140
            echo $r["ERRINFO"];
142
        }
141
        }
143
142
144
        break;
143
        break;
145
    case 'section-delete':
144
    case 'section-delete':
146
        // Удаление информации о секции
145
        // Удаление информации о секции
147
        $sectID = $secure->checkInt($_POST["sectionID"]);
146
        $sectID = $secure->checkInt($_POST["sectionID"]);
148
147
149
        $r = $core->dropSection($sectID);
148
        $r = $core->dropSection($sectID);
150
        if ($r["ERR"]==0) {
149
        if ($r["ERR"]==0) {
151
            header("Location: ".$manager."\n\n");
150
            header("Location: ".$manager."\n\n");
152
        } else {
151
        } else {
153
            echo $r["ERRINFO"];
152
            echo $r["ERRINFO"];
154
        }
153
        }
155
154
156
        break;
155
        break;
157
    case 'sign-add':
156
    case 'sign-add':
158
        // Добавление новой подписи
157
        // Добавление новой подписи
159
        $SName  = $secure->checkStr($_POST["sname"],1);
158
        $SName  = $secure->checkStr($_POST["sname"],1);
160
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
159
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
161
160
162
        $r = $core->addSign($SName, $SInfo);
161
        $r = $core->addSign($SName, $SInfo);
163
        if ($r["ERR"]==0) {
162
        if ($r["ERR"]==0) {
164
            header("Location: ".$manager."\n\n");
163
            header("Location: ".$manager."\n\n");
165
        } else {
164
        } else {
166
            echo $r["ERRINFO"];
165
            echo $r["ERRINFO"];
167
        }
166
        }
168
167
169
        break;
168
        break;
170
    case 'sign-edit':
169
    case 'sign-edit':
171
        // Редактирование информации о подписи
170
        // Редактирование информации о подписи
172
        $signID = $secure->checkInt($_POST["signID"]);
171
        $signID = $secure->checkInt($_POST["signID"]);
173
        $SName  = $secure->checkStr($_POST["sname"],1);
172
        $SName  = $secure->checkStr($_POST["sname"],1);
174
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
173
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
175
174
176
        $r = $core->updateSign($signID, $SName, $SInfo);
175
        $r = $core->updateSign($signID, $SName, $SInfo);
177
        if ($r["ERR"]==0) {
176
        if ($r["ERR"]==0) {
178
            header("Location: ".$manager."\n\n");
177
            header("Location: ".$manager."\n\n");
179
        } else {
178
        } else {
180
            echo $r["ERRINFO"];
179
            echo $r["ERRINFO"];
181
        }
180
        }
182
181
183
        break;
182
        break;
184
    case 'sign-delete':
183
    case 'sign-delete':
185
        // Удаление информации о подписи
184
        // Удаление информации о подписи
186
        $signID = $secure->checkInt($_POST["signID"]);
185
        $signID = $secure->checkInt($_POST["signID"]);
187
186
188
        $r = $core->dropSign($signID);
187
        $r = $core->dropSign($signID);
189
        if ($r["ERR"]==0) {
188
        if ($r["ERR"]==0) {
190
            header("Location: ".$manager."\n\n");
189
            header("Location: ".$manager."\n\n");
191
        } else {
190
        } else {
192
            echo $r["ERRINFO"];
191
            echo $r["ERRINFO"];
193
        }
192
        }
194
193
195
        break;
194
        break;
196
}
195
}
197
196
198
?>
197
?>
199
 
198