333,12 → 333,12 |
* @param byte $distlogo |
* @return array |
*/ |
public function addDistribution($distname, $disttype, $distua = 1, $distlogo = 0) { |
public function addDistribution($distname, $disttype, $distua = '', $distlogo = 0) { |
$result = array(); |
$sDName = $this->secure->checkStr($distname); |
$sDType = $this->secure->checkInt($disttype); |
$sDUAgt = $this->secure->checkStr($distua); |
$sDLogo = $this->secure->checkInt($distname); |
$sDLogo = $this->secure->checkInt($distlogo); |
|
$query = "INSERT INTO ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."'"; |
$rq =& $this->db->query($query); |
354,6 → 354,78 |
} |
|
/** |
* Обновление информации о дистрибутиве |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $distID |
* @param string $distname |
* @param integer $disttype |
* @param string $distua |
* @param integer $distlogo |
* @return array |
*/ |
public function updateDistribution($distID, $distname, $disttype, $distua, $distlogo) { |
$result = array(); |
$sDID = $this->secure->checkInt($distID); |
$sDName = $this->secure->checkStr($distname); |
$sDType = $this->secure->checkInt($disttype); |
$sDUAgt = $this->secure->checkStr($distua); |
$sDLogo = $this->secure->checkInt($distlogo); |
|
$query = "UPDATE ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."' WHERE dist_id='".$sDID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Удаление информации о дистрибутиве |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $distID |
* @return array |
*/ |
public function dropDistribution($distID) { |
$result = array(); |
$sDID = $this->secure->checkInt($distID); |
|
// Удаление дистрибутива |
$query = "DELETE FROM ".$this->prefix."distribution WHERE dist_id='".$sDID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
// Удаление версий дистрибутива |
$query = "DELETE FROM ".$this->prefix."version WHERE dist_id='".$sDID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Добавление поддержки новой версии apt-дистрибутива |
* |
* @author Alexander Wolf |
386,6 → 458,76 |
} |
|
/** |
* Редактирование информации о версии дистрибутива |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $versionID |
* @param string $version |
* @param string $vname |
* @param string $vcodename |
* @return array |
*/ |
public function updateDistVersion($versionID, $version, $vname = "", $vcodename = "") { |
$result = array(); |
$sVersID = $this->secure->checkInt($versionID); |
$sDVersion = $this->secure->checkStr($version); |
$sDVName = $this->secure->checkStr($vname); |
$sDVCName = $this->secure->checkInt($vcodename); |
|
$query = "UPDATE ".$this->prefix."version SET vname='".$sDVName."', version='".$sDVersion."', vcodename='".$sDVCName."' WHERE version_id='".$sVersID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Удаление информации о версии дистрибутива |
* |
* @author Alexander Wolf |
* @category Core |
* |
* @param integer $versionID |
* @return array |
*/ |
public function dropDistVersion($versionID) { |
$result = array(); |
$sVersID = $this->secure->checkInt($versionID); |
|
// Удаление версии дистрибутива |
$query = "DELETE FROM ".$this->prefix."version WHERE version_id='".$sVersID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
// Удаление репозиториев этой версии дистрибутива |
$query = "DELETE FROM ".$this->prefix."repository WHERE version='".$sVersID."'"; |
$rq =& $this->db->query($query); |
if (PEAR::isError($this->db)) { |
$result["ERR"] = 1; |
$result["ERRINFO"] = $this->db->getMessage(); |
} else { |
$rq->fetchInto($element); |
$result["ERR"] = 0; |
} |
|
return $result; |
} |
|
/** |
* Отображение типа дистрибутива |
* |
* @author Alexander Wolf |