Хранилища Subversion ant

Редакция

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

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