Редакция 511 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 511 | Редакция 514 | ||
---|---|---|---|
Строка 331... | Строка 331... | ||
331 | * @param integer $disttype
|
331 | * @param integer $disttype
|
332 | * @param string $distua
|
332 | * @param string $distua
|
333 | * @param byte $distlogo
|
333 | * @param byte $distlogo
|
334 | * @return array
|
334 | * @return array
|
335 | */
|
335 | */
|
336 | public function addDistribution($distname, $disttype, $distua = 1, $distlogo = 0) { |
336 | public function addDistribution($distname, $disttype, $distua = '', $distlogo = 0) { |
337 | $result = array(); |
337 | $result = array(); |
338 | $sDName = $this->secure->checkStr($distname); |
338 | $sDName = $this->secure->checkStr($distname); |
339 | $sDType = $this->secure->checkInt($disttype); |
339 | $sDType = $this->secure->checkInt($disttype); |
340 | $sDUAgt = $this->secure->checkStr($distua); |
340 | $sDUAgt = $this->secure->checkStr($distua); |
341 | $sDLogo = $this->secure->checkInt($distname); |
341 | $sDLogo = $this->secure->checkInt($distlogo); |
342 | 342 | ||
343 | $query = "INSERT INTO ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."'"; |
343 | $query = "INSERT INTO ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."'"; |
344 | $rq =& $this->db->query($query); |
344 | $rq =& $this->db->query($query); |
345 | if (PEAR::isError($this->db)) { |
345 | if (PEAR::isError($this->db)) { |
346 | $result["ERR"] = 1; |
346 | $result["ERR"] = 1; |
Строка 352... | Строка 352... | ||
352 | 352 | ||
353 | return $result; |
353 | return $result; |
354 | }
|
354 | }
|
355 | 355 | ||
356 | /**
|
356 | /**
|
- | 357 | * Обновление информации о дистрибутиве
|
|
- | 358 | *
|
|
- | 359 | * @author Alexander Wolf
|
|
- | 360 | * @category Core
|
|
- | 361 | *
|
|
- | 362 | * @param integer $distID
|
|
- | 363 | * @param string $distname
|
|
- | 364 | * @param integer $disttype
|
|
- | 365 | * @param string $distua
|
|
- | 366 | * @param integer $distlogo
|
|
- | 367 | * @return array
|
|
- | 368 | */
|
|
- | 369 | public function updateDistribution($distID, $distname, $disttype, $distua, $distlogo) { |
|
- | 370 | $result = array(); |
|
- | 371 | $sDID = $this->secure->checkInt($distID); |
|
- | 372 | $sDName = $this->secure->checkStr($distname); |
|
- | 373 | $sDType = $this->secure->checkInt($disttype); |
|
- | 374 | $sDUAgt = $this->secure->checkStr($distua); |
|
- | 375 | $sDLogo = $this->secure->checkInt($distlogo); |
|
- | 376 | ||
- | 377 | $query = "UPDATE ".$this->prefix."distribution SET distname='".$sDName."', distua='".$sDUAgt."', disttype='".$sDType."', distlogo='".$sDLogo."' WHERE dist_id='".$sDID."'"; |
|
- | 378 | $rq =& $this->db->query($query); |
|
- | 379 | if (PEAR::isError($this->db)) { |
|
- | 380 | $result["ERR"] = 1; |
|
- | 381 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 382 | } else { |
|
- | 383 | $rq->fetchInto($element); |
|
- | 384 | $result["ERR"] = 0; |
|
- | 385 | }
|
|
- | 386 | ||
- | 387 | return $result; |
|
- | 388 | }
|
|
- | 389 | ||
- | 390 | /**
|
|
- | 391 | * Удаление информации о дистрибутиве
|
|
- | 392 | *
|
|
- | 393 | * @author Alexander Wolf
|
|
- | 394 | * @category Core
|
|
- | 395 | *
|
|
- | 396 | * @param integer $distID
|
|
- | 397 | * @return array
|
|
- | 398 | */
|
|
- | 399 | public function dropDistribution($distID) { |
|
- | 400 | $result = array(); |
|
- | 401 | $sDID = $this->secure->checkInt($distID); |
|
- | 402 | ||
- | 403 | // Удаление дистрибутива
|
|
- | 404 | $query = "DELETE FROM ".$this->prefix."distribution WHERE dist_id='".$sDID."'"; |
|
- | 405 | $rq =& $this->db->query($query); |
|
- | 406 | if (PEAR::isError($this->db)) { |
|
- | 407 | $result["ERR"] = 1; |
|
- | 408 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 409 | } else { |
|
- | 410 | $rq->fetchInto($element); |
|
- | 411 | $result["ERR"] = 0; |
|
- | 412 | }
|
|
- | 413 | ||
- | 414 | // Удаление версий дистрибутива
|
|
- | 415 | $query = "DELETE FROM ".$this->prefix."version WHERE dist_id='".$sDID."'"; |
|
- | 416 | $rq =& $this->db->query($query); |
|
- | 417 | if (PEAR::isError($this->db)) { |
|
- | 418 | $result["ERR"] = 1; |
|
- | 419 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 420 | } else { |
|
- | 421 | $rq->fetchInto($element); |
|
- | 422 | $result["ERR"] = 0; |
|
- | 423 | }
|
|
- | 424 | ||
- | 425 | return $result; |
|
- | 426 | }
|
|
- | 427 | ||
- | 428 | /**
|
|
357 | * Добавление поддержки новой версии apt-дистрибутива
|
429 | * Добавление поддержки новой версии apt-дистрибутива
|
358 | *
|
430 | *
|
359 | * @author Alexander Wolf
|
431 | * @author Alexander Wolf
|
360 | * @category Core
|
432 | * @category Core
|
361 | *
|
433 | *
|
Строка 376... | Строка 448... | ||
376 | $rq =& $this->db->query($query); |
448 | $rq =& $this->db->query($query); |
377 | if (PEAR::isError($this->db)) { |
449 | if (PEAR::isError($this->db)) { |
378 | $result["ERR"] = 1; |
450 | $result["ERR"] = 1; |
379 | $result["ERRINFO"] = $this->db->getMessage(); |
451 | $result["ERRINFO"] = $this->db->getMessage(); |
380 | } else { |
452 | } else { |
- | 453 | $rq->fetchInto($element); |
|
- | 454 | $result["ERR"] = 0; |
|
- | 455 | }
|
|
- | 456 | ||
- | 457 | return $result; |
|
- | 458 | }
|
|
- | 459 | ||
- | 460 | /**
|
|
- | 461 | * Редактирование информации о версии дистрибутива
|
|
- | 462 | *
|
|
- | 463 | * @author Alexander Wolf
|
|
- | 464 | * @category Core
|
|
- | 465 | *
|
|
- | 466 | * @param integer $versionID
|
|
- | 467 | * @param string $version
|
|
- | 468 | * @param string $vname
|
|
- | 469 | * @param string $vcodename
|
|
- | 470 | * @return array
|
|
- | 471 | */
|
|
- | 472 | public function updateDistVersion($versionID, $version, $vname = "", $vcodename = "") { |
|
- | 473 | $result = array(); |
|
- | 474 | $sVersID = $this->secure->checkInt($versionID); |
|
- | 475 | $sDVersion = $this->secure->checkStr($version); |
|
- | 476 | $sDVName = $this->secure->checkStr($vname); |
|
- | 477 | $sDVCName = $this->secure->checkInt($vcodename); |
|
- | 478 | ||
- | 479 | $query = "UPDATE ".$this->prefix."version SET vname='".$sDVName."', version='".$sDVersion."', vcodename='".$sDVCName."' WHERE version_id='".$sVersID."'"; |
|
- | 480 | $rq =& $this->db->query($query); |
|
- | 481 | if (PEAR::isError($this->db)) { |
|
- | 482 | $result["ERR"] = 1; |
|
- | 483 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 484 | } else { |
|
- | 485 | $rq->fetchInto($element); |
|
- | 486 | $result["ERR"] = 0; |
|
- | 487 | }
|
|
- | 488 | ||
- | 489 | return $result; |
|
- | 490 | }
|
|
- | 491 | ||
- | 492 | /**
|
|
- | 493 | * Удаление информации о версии дистрибутива
|
|
- | 494 | *
|
|
- | 495 | * @author Alexander Wolf
|
|
- | 496 | * @category Core
|
|
- | 497 | *
|
|
- | 498 | * @param integer $versionID
|
|
- | 499 | * @return array
|
|
- | 500 | */
|
|
- | 501 | public function dropDistVersion($versionID) { |
|
- | 502 | $result = array(); |
|
- | 503 | $sVersID = $this->secure->checkInt($versionID); |
|
- | 504 | ||
- | 505 | // Удаление версии дистрибутива
|
|
- | 506 | $query = "DELETE FROM ".$this->prefix."version WHERE version_id='".$sVersID."'"; |
|
- | 507 | $rq =& $this->db->query($query); |
|
- | 508 | if (PEAR::isError($this->db)) { |
|
- | 509 | $result["ERR"] = 1; |
|
- | 510 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 511 | } else { |
|
- | 512 | $rq->fetchInto($element); |
|
- | 513 | $result["ERR"] = 0; |
|
- | 514 | }
|
|
- | 515 | ||
- | 516 | // Удаление репозиториев этой версии дистрибутива
|
|
- | 517 | $query = "DELETE FROM ".$this->prefix."repository WHERE version='".$sVersID."'"; |
|
- | 518 | $rq =& $this->db->query($query); |
|
- | 519 | if (PEAR::isError($this->db)) { |
|
- | 520 | $result["ERR"] = 1; |
|
- | 521 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 522 | } else { |
|
381 | $rq->fetchInto($element); |
523 | $rq->fetchInto($element); |
382 | $result["ERR"] = 0; |
524 | $result["ERR"] = 0; |
383 | }
|
525 | }
|
384 | 526 | ||
385 | return $result; |
527 | return $result; |