Редакция 701 | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
368 | alex-w | 1 | <?php |
2 | |||
3 | /** |
||
4 | * |
||
554 | alex-w | 5 | * Codename: ant-ng - generator of sources.list for apt-distributives |
368 | alex-w | 6 | * http://alex-w.org.ru/p/antng/ |
7 | * |
||
8 | * Copyright (c) 2009 Alexander Wolf |
||
9 | * Dual licensed under the MIT and GNU LGPL licenses. |
||
10 | * http://alex-w.org.ru/p/antng/license |
||
11 | * |
||
12 | */ |
||
13 | |||
14 | require_once dirname(__FILE__)."/init.php"; |
||
15 | |||
16 | $mode = $_POST["mode"]; |
||
17 | |||
18 | switch ($mode) { |
||
19 | case 'authorize': |
||
20 | $r = $core->checkSign($_POST["word"]); |
||
21 | header("Location: ".$r["Location"]."\n\n"); |
||
22 | break; |
||
514 | alex-w | 23 | case 'distributive-add': |
24 | // Добавление нового дистрибутива |
||
25 | $DName = $secure->checkStr($_POST["dname"],1); |
||
26 | $DUA = $secure->checkStr($_POST["dua"],1); |
||
27 | $DType = $secure->checkInt($_POST["dtype"]); |
||
524 | alex-w | 28 | $DLogo = 0; |
514 | alex-w | 29 | |
535 | alex-w | 30 | if ($_FILES["distlogo"]["type"]!="") { |
537 | alex-w | 31 | $DLogo = $core->uploadPicture($picture, $DUA, $_FILES); |
524 | alex-w | 32 | } |
33 | |||
514 | alex-w | 34 | $r = $core->addDistribution($DName, $DType, $DUA, $DLogo); |
35 | if ($r["ERR"]==0) { |
||
36 | header("Location: ".$manager."\n\n"); |
||
37 | } else { |
||
38 | echo $r["ERRINFO"]; |
||
39 | } |
||
40 | |||
41 | break; |
||
42 | case 'distributive-edit': |
||
43 | // Редактирование информации о дистрибутиве |
||
44 | $ID = $secure->checkInt($_POST["distID"]); |
||
45 | $DName = $secure->checkStr($_POST["dname"],1); |
||
46 | $DUA = $secure->checkStr($_POST["dua"],1); |
||
47 | $DType = $secure->checkInt($_POST["dtype"]); |
||
535 | alex-w | 48 | |
538 | alex-w | 49 | |
534 | alex-w | 50 | if ($_FILES["distlogo"]["type"]!="") { |
535 | alex-w | 51 | $DLogo = $core->uploadPicture($picture, $DUA, $_FILES); |
538 | alex-w | 52 | $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo); |
524 | alex-w | 53 | } |
54 | |||
538 | alex-w | 55 | $r = $core->updateDistribution($ID, $DName, $DType, $DUA); |
514 | alex-w | 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 |