Хранилища Subversion ant

Редакция

Редакция 536 | Редакция 538 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS

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