Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
334,9 → 334,9
*/
public function addDistribution($distname, $disttype, $distua = '', $distlogo = 0) {
$result = array();
$sDName = $this->secure->checkStr($distname,1);
$sDName = $this->secure->checkStr($distname);
$sDType = $this->secure->checkInt($disttype);
$sDUAgt = $this->secure->checkStr($distua,1);
$sDUAgt = $this->secure->checkStr($distua);
$sDLogo = $this->secure->checkInt($distlogo);
 
$query = "INSERT INTO ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."'";
439,9 → 439,9
public function addDistVersion($distID, $version, $vname = "", $vcodename = "") {
$result = array();
$sDistID = $this->secure->checkInt($distID);
$sDVersion = $this->secure->checkStr($version,1);
$sDVName = $this->secure->checkStr($vname,1);
$sDVCName = $this->secure->checkStr($vcodename,1);
$sDVersion = $this->secure->checkStr($version);
$sDVName = $this->secure->checkStr($vname);
$sDVCName = $this->secure->checkStr($vcodename);
 
$query = "INSERT INTO ".$this->prefix."version SET dist_id='".$sDistID."', vname='".$sDVName."', version='".$sDVersion."', vcodename='".$sDVCName."'";
$rq =& $this->db->query($query);
740,8 → 740,8
*/
public function addSection($sname, $sinfo = "") {
$result = array();
$sSName = $this->secure->checkStr($sname,1);
$sSInfo = $this->secure->checkStr($sinfo,1);
$sSName = $this->secure->checkStr($sname);
$sSInfo = $this->secure->checkStr($sinfo);
 
$query = "INSERT INTO ".$this->prefix."section SET secname='".$sSName."', sectinfo='".$sSInfo."'";
$rq =& $this->db->query($query);
814,7 → 814,7
*/
public function addArch($arch) {
$result = array();
$sArch = $this->secure->checkStr($arch,1);
$sArch = $this->secure->checkStr($arch);
 
$query = "INSERT INTO ".$this->prefix."arch SET arch='".$sArch."'";
$rq =& $this->db->query($query);
971,7 → 971,7
*/
public function addScheme($scheme) {
$result = array();
$sScheme = $this->secure->checkStr($scheme,1);
$sScheme = $this->secure->checkStr($scheme);
 
$query = "INSERT INTO ".$this->prefix."repscheme SET scheme='".$sScheme."'";
$rq =& $this->db->query($query);
1119,7 → 1119,7
*/
public function addProto($proto) {
$result = array();
$sProto = $this->secure->checkStr($proto,1);
$sProto = $this->secure->checkStr($proto);
 
$query = "INSERT INTO ".$this->prefix."protos SET proto='".$sProto."'";
$rq =& $this->db->query($query);
1217,6 → 1217,154
}
 
/**
* Вывод списка хостов
*
* @author Alexander Wolf
* @category Core
*
* @param string $name
* @param string $actor
* @param string $format
* @return string
*/
public function showHostsList($name, $actor, $format = 'list') {
switch($format) {
case 'list':
$query = "SELECT * FROM ".$this->prefix."rephost";
$rq =& $this->db->query($query);
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["rhost_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["rhost_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["rhost"],1)."</li>\n";
}
$show .= "</ul>";
break;
case 'innerhtml':
$hostID = $this->secure->checkInt($actor);
$query = "SELECT * FROM ".$this->prefix."rephost";
$rq =& $this->db->query($query);
$show = "<select name='".$name."' id='".$name."'>\n";
while ($rq->fetchInto($element)) {
if ($element["rhost_id"]==$hostID) {
$show .= "<option value='".$this->secure->checkInt($element["rhost_id"])."' selected>".$this->secure->checkStr($element["rhost"],1)."</option>\n";
} else {
$show .= "<option value='".$this->secure->checkInt($element["rhost_id"])."'>".$this->secure->checkStr($element["rhost"],1)."</option>\n";
}
}
$show .= "</select>";
break;
}
return $show;
}
 
/**
* Добавление нового хоста
*
* @author Alexander Wolf
* @category Core
*
* @param string $host
* @return array
*/
public function addHost($host) {
$result = array();
$sHost = $this->secure->checkStr($host);
 
$query = "INSERT INTO ".$this->prefix."rephost SET rhost='".$sProto."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Удаление информации о хосте
*
* @author Alexander Wolf
* @category Core
*
* @param integer $hostID
* @return array
*/
public function dropHost($hostID) {
$result = array();
$sHostID = $this->secure->checkInt($hostID);
 
// Удаление хоста
$query = "DELETE FROM ".$this->prefix."rephost WHERE rhost_id='".$sHostID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Обновление информации о хосте
*
* @author Alexander Wolf
* @category Core
*
* @param integer $hostID
* @param string $info
* @return array
*/
public function updateHost($hostID, $info) {
$result = array();
$sHostID = $this->secure->checkInt($hostID);
$sHost = $this->secure->checkStr($info);
 
$query = "UPDATE ".$this->prefix."rephost SET rhost='".$sHost."' WHERE rhost_id='".$sHostID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Вывод формы редактирования/добавления хостов
*
* @author Alexander Wolf
* @category Core
*
* @param integer $hostID
* @param string $info
* @return string
*/
public function showHostForm($hostID = 0, $info = "") {
$sHostID = $this->secure->checkInt($hostID);
$sInfo = $this->secure->checkStr($info, 1);
if ($sInfo == "") {
$sInfo = "Хост репозитория";
}
$show = "<fieldset><legend>".$sInfo."</legend>\n";
if ($sHostID != 0) {
// Режим редактирования
$query = "SELECT * FROM ".$this->prefix."rephost WHERE rhost_id='".$sHostID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
}
 
$show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' id='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n";
 
return $show;
}
 
/**
* Показывает список подписей
*
* @author Alexander Wolf
1336,8 → 1484,8
*/
public function addSign($sname, $sinfo = "") {
$result = array();
$sSName = $this->secure->checkStr($sname,1);
$sSInfo = $this->secure->checkStr($sinfo,1);
$sSName = $this->secure->checkStr($sname);
$sSInfo = $this->secure->checkStr($sinfo);
 
$query = "INSERT INTO ".$this->prefix."signs SET sname='".$sSName."', sinfo='".$sSInfo."'";
$rq =& $this->db->query($query);