Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 597 → Редакция 598

/branches/ant/0.9.x/manager.php
383,7 → 383,7
break;
case 'edit':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-edit'>\n";
$body .= "<input type='hidden' name='mode' value='repository-edit'>\n";
$body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n";
$body .= $core->showRepositoriesForm($uuid, "Редактирование информации о репозитории");
$body .= "</form>";
390,7 → 390,7
break;
case 'delete':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-delete'>\n";
$body .= "<input type='hidden' name='mode' value='repository-delete'>\n";
$body .= "<input type='hidden' name='repositoriesID' value='".$uuid."'>\n";
$body .= $core->showRepositoriesForm($uuid, "Удаление информации о репозитории");
$body .= "</form>";
397,13 → 397,13
break;
case 'new-master':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-add-rpm'>\n";
$body .= "<input type='hidden' name='mode' value='repository-master'>\n";
$body .= $core->showRepositoriesForm(0, "Добавление нового репозитория");
$body .= "</form>";
break;
case 'new':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-add'>\n";
$body .= "<input type='hidden' name='mode' value='repository-add'>\n";
$body .= "<fieldset><legend>Добавление нового репозитория</legend>\n";
$body .= "<div class='inputbox'><label for='repscheme'>Строка sources.list:</label> <input type='text' id='repscheme' name='repscheme' value=''></div>\n";
$body .= "<div class='inputbox'><input type='submit' value=' Обработать строку '></div>\n";
/branches/ant/0.9.x/process.php
377,6 → 377,27
}
 
break;
case 'repository-master':
// Добавляем новый репозиторий
$rdist = $secure->checkInt($_POST["rdist"]); // Версия дистрибутива
$rname = $secure->checkStr($_POST["rname"]); // Название репозитория
$rinfo = $secure->checkStr($_POST["rinfo"]); // Описание репозитория
$rkey = $secure->checkStr($_POST["rkey"]); // Ключ подписи репозитория
$rproto = $secure->checkInt($_POST["rproto"]); // Протокол доступа
$rhost = $secure->checkInt($_POST["rhost"]); // Хост репозитория
$rfolder = $secure->checkInt($_POST["rfolder"]); // Корневая папка
$rtype = $secure->checkInt($_POST["rtype"]); // Тип репозитория
$rscheme = $secure->checkInt($_POST["rscheme"]); // Схема репозитория
$rsign = $secure->checkInt($_POST["rsign"]); // Подпись репозитория (для rpm/ALTLinux)
 
$r = $core->addRepository($rdist, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $_POST["rsects"], $_POST["rarchs"], $rscheme, $rsign);
if ($r["ERR"]==0) {
header("Location: ".$manager."\n\n");
} else {
echo $r["ERRINFO"];
}
 
break;
}
 
?>
/branches/ant/0.9.x/lib/core.php
2003,6 → 2003,66
return $show;
}
 
/**
* Добавление нового репозитория
*
* @author Alexander Wolf
* @category Core
*
* @param integer $verionID
* @param string $rname
* @param string $rinfo
* @param string $rkey
* @param integer $proto
* @param integer $rhost
* @param integer $rfolder
* @param integer $rtype
* @param array $sections
* @param array $arch
* @param integer $scheme
* @param integer $sign
* @return array
*/
public function addRepository($verionID, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $sections, $arch, $scheme, $sign) {
$result = array();
$sVersionID = $this->secure->checkInt($verionID);
$sRName = $this->secure->checkStr($rname);
$sRInfo = $this->secure->checkStr($rinfo);
$sRKey = $this->secure->checkStr($rkey);
$sProto = $this->secure->checkInt($proto);
$sRHost = $this->secure->checkInt($rhost);
$sRFolder = $this->secure->checkInt($rfolder);
$sRType = $this->secure->checkInt($rtype);
$sRScheme = $this->secure->checkInt($scheme);
$sRSign = $this->secure->checkInt($sign);
 
$query = "INSERT INTO ".$this->prefix."repository SET proto_id='".$sProto."', rhost_id='".$sRHost."', rfolder_id='".$sRFolder."', version='".$sVersionID.", rtype_id='".$sRType."', scheme_id='".$sRScheme."', sign_id='".$sRSign."', repname='".$sRName."', repinfo='".$sRInfo."', repkey='".$sRKey."'";
$rq =& $this->db->query($query);
 
$query = "SELECT rep_id FROM ".$this->prefix."repository ORDER BY rep_id DESC LIMIT 0, 1";
$rq =& $this->db->query($query);
$rq->fetchInto($repository);
 
for($i=0;$i<count($sections);$i++) {
$query = "INSERT INTO ".$this->prefix."sect2rep SET rep_id='".$repository["rep_id"]."', sect_id='".$sections[$i]."'";
$rq =& $this->db->query($query);
}
 
for($i=0;$i<count($arch);$i++) {
$query = "INSERT INTO ".$this->prefix."arch2rep SET rep_id='".$repository["rep_id"]."', arch_id='".$arch[$i]."'";
$rq =& $this->db->query($query);
}
 
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
return $result;
}
}