Хранилища Subversion ant

Редакция

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

Редакция 537 Редакция 538
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;
29
        $DLogo  = 0;
30
30
31
        if ($_FILES["distlogo"]["type"]!="") {
31
        if ($_FILES["distlogo"]["type"]!="") {
32
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
32
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
33
        }
33
        }
34
34
35
        $r = $core->addDistribution($DName, $DType, $DUA, $DLogo);
35
        $r = $core->addDistribution($DName, $DType, $DUA, $DLogo);
36
        if ($r["ERR"]==0) {
36
        if ($r["ERR"]==0) {
37
            header("Location: ".$manager."\n\n");
37
            header("Location: ".$manager."\n\n");
38
        } else {
38
        } else {
39
            echo $r["ERRINFO"];
39
            echo $r["ERRINFO"];
40
        }
40
        }
41
41
42
        break;
42
        break;
43
    case 'distributive-edit':
43
    case 'distributive-edit':
44
        // Редактирование информации о дистрибутиве
44
        // Редактирование информации о дистрибутиве
45
        $ID     = $secure->checkInt($_POST["distID"]);
45
        $ID     = $secure->checkInt($_POST["distID"]);
46
        $DName  = $secure->checkStr($_POST["dname"],1);
46
        $DName  = $secure->checkStr($_POST["dname"],1);
47
        $DUA    = $secure->checkStr($_POST["dua"],1);
47
        $DUA    = $secure->checkStr($_POST["dua"],1);
48
        $DType  = $secure->checkInt($_POST["dtype"]);
48
        $DType  = $secure->checkInt($_POST["dtype"]);
49
        $DLogo  = 0;
-
 
-
 
49
       
50
       
50
       
51
        if ($_FILES["distlogo"]["type"]!="") {
51
        if ($_FILES["distlogo"]["type"]!="") {
52
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
52
            $DLogo = $core->uploadPicture($picture, $DUA, $_FILES);
-
 
53
            $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo);
53
        }
54
        }
54
55
55
        $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo);
56
        $r = $core->updateDistribution($ID, $DName, $DType, $DUA);
56
        if ($r["ERR"]==0) {
57
        if ($r["ERR"]==0) {
57
            header("Location: ".$manager."\n\n");
58
            header("Location: ".$manager."\n\n");
58
        } else {
59
        } else {
59
            echo $r["ERRINFO"];
60
            echo $r["ERRINFO"];
60
        }
61
        }
61
62
62
        break;
63
        break;
63
    case 'distributive-delete':
64
    case 'distributive-delete':
64
        // Удаление информации о дистрибутиве
65
        // Удаление информации о дистрибутиве
65
        $ID     = $secure->checkInt($_POST["distID"]);
66
        $ID     = $secure->checkInt($_POST["distID"]);
66
67
67
        $r = $core->dropDistribution($ID);
68
        $r = $core->dropDistribution($ID);
68
        if ($r["ERR"]==0) {
69
        if ($r["ERR"]==0) {
69
            header("Location: ".$manager."\n\n");
70
            header("Location: ".$manager."\n\n");
70
        } else {
71
        } else {
71
            echo $r["ERRINFO"];
72
            echo $r["ERRINFO"];
72
        }
73
        }
73
74
74
        break;
75
        break;
75
    case 'version-add':
76
    case 'version-add':
76
        // Добавление новой версии дистрибутива
77
        // Добавление новой версии дистрибутива
77
        $DistID = $secure->checkInt($_POST["distname"]);
78
        $DistID = $secure->checkInt($_POST["distname"]);
78
        $VName  = $secure->checkStr($_POST["vname"],1);
79
        $VName  = $secure->checkStr($_POST["vname"],1);
79
        $VNmbr  = $secure->checkStr($_POST["version"],1);
80
        $VNmbr  = $secure->checkStr($_POST["version"],1);
80
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
81
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
81
82
82
        $r = $core->addDistVersion($DistID, $VNmbr, $VName, $VCNme);
83
        $r = $core->addDistVersion($DistID, $VNmbr, $VName, $VCNme);
83
        if ($r["ERR"]==0) {
84
        if ($r["ERR"]==0) {
84
            header("Location: ".$manager."\n\n");
85
            header("Location: ".$manager."\n\n");
85
        } else {
86
        } else {
86
            echo $r["ERRINFO"];
87
            echo $r["ERRINFO"];
87
        }
88
        }
88
89
89
        break;
90
        break;
90
    case 'version-edit':
91
    case 'version-edit':
91
        // Редактирование версии дистрибутива
92
        // Редактирование версии дистрибутива
92
        $versID = $secure->checkInt($_POST["versionID"]);
93
        $versID = $secure->checkInt($_POST["versionID"]);
93
        $VName  = $secure->checkStr($_POST["vname"],1);
94
        $VName  = $secure->checkStr($_POST["vname"],1);
94
        $VNmbr  = $secure->checkStr($_POST["version"],1);
95
        $VNmbr  = $secure->checkStr($_POST["version"],1);
95
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
96
        $VCNme  = $secure->checkStr($_POST["vcodename"],1);
96
97
97
        $r = $core->updateDistVersion($versID, $VNmbr, $VName, $VCNme);
98
        $r = $core->updateDistVersion($versID, $VNmbr, $VName, $VCNme);
98
        if ($r["ERR"]==0) {
99
        if ($r["ERR"]==0) {
99
            header("Location: ".$manager."\n\n");
100
            header("Location: ".$manager."\n\n");
100
        } else {
101
        } else {
101
            echo $r["ERRINFO"];
102
            echo $r["ERRINFO"];
102
        }
103
        }
103
104
104
        break;
105
        break;
105
    case 'version-delete':
106
    case 'version-delete':
106
        // Удаление версии дистрибутива
107
        // Удаление версии дистрибутива
107
        $versID = $secure->checkInt($_POST["versionID"]);
108
        $versID = $secure->checkInt($_POST["versionID"]);
108
109
109
        $r = $core->dropDistVersion($versID);
110
        $r = $core->dropDistVersion($versID);
110
        if ($r["ERR"]==0) {
111
        if ($r["ERR"]==0) {
111
            header("Location: ".$manager."\n\n");
112
            header("Location: ".$manager."\n\n");
112
        } else {
113
        } else {
113
            echo $r["ERRINFO"];
114
            echo $r["ERRINFO"];
114
        }
115
        }
115
116
116
        break;
117
        break;
117
    case 'section-add':
118
    case 'section-add':
118
        // Добавление новой секции
119
        // Добавление новой секции
119
        $SName  = $secure->checkStr($_POST["sname"],1);
120
        $SName  = $secure->checkStr($_POST["sname"],1);
120
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
121
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
121
122
122
        $r = $core->addSection($SName, $SInfo);
123
        $r = $core->addSection($SName, $SInfo);
123
        if ($r["ERR"]==0) {
124
        if ($r["ERR"]==0) {
124
            header("Location: ".$manager."\n\n");
125
            header("Location: ".$manager."\n\n");
125
        } else {
126
        } else {
126
            echo $r["ERRINFO"];
127
            echo $r["ERRINFO"];
127
        }
128
        }
128
129
129
        break;
130
        break;
130
    case 'section-edit':
131
    case 'section-edit':
131
        // Редактирование информации о секции
132
        // Редактирование информации о секции
132
        $sectID = $secure->checkInt($_POST["sectionID"]);
133
        $sectID = $secure->checkInt($_POST["sectionID"]);
133
        $SName  = $secure->checkStr($_POST["sname"],1);
134
        $SName  = $secure->checkStr($_POST["sname"],1);
134
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
135
        $SInfo  = $secure->checkStr($_POST["sinfo"],1);
135
136
136
        $r = $core->updateSection($sectID, $SName, $SInfo);
137
        $r = $core->updateSection($sectID, $SName, $SInfo);
137
        if ($r["ERR"]==0) {
138
        if ($r["ERR"]==0) {
138
            header("Location: ".$manager."\n\n");
139
            header("Location: ".$manager."\n\n");
139
        } else {
140
        } else {
140
            echo $r["ERRINFO"];
141
            echo $r["ERRINFO"];
141
        }
142
        }
142
143
143
        break;
144
        break;
144
    case 'section-delete':
145
    case 'section-delete':
145
        // Удаление информации о секции
146
        // Удаление информации о секции
146
        $sectID = $secure->checkInt($_POST["sectionID"]);
147
        $sectID = $secure->checkInt($_POST["sectionID"]);
147
148
148
        $r = $core->dropSection($sectID);
149
        $r = $core->dropSection($sectID);
149
        if ($r["ERR"]==0) {
150
        if ($r["ERR"]==0) {
150
            header("Location: ".$manager."\n\n");
151
            header("Location: ".$manager."\n\n");
151
        } else {
152
        } else {
152
            echo $r["ERRINFO"];
153
            echo $r["ERRINFO"];
153
        }
154
        }
154
155
155
        break;
156
        break;
156
}
157
}
157
158
158
?>
159
?>
159
 
160