Хранилища Subversion ant

Редакция

Редакция 596 | Редакция 600 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 596 Редакция 598
Строка 2001... Строка 2001...
2001
        $show .= "<div class='inputbox'><label for='rsign'>Подпись репозитория:</label> ".$this->showSignsList("rsign",$this->secure->checkInt($element["sign_id"]),"innerhtml")."</div>\n";
2001
        $show .= "<div class='inputbox'><label for='rsign'>Подпись репозитория:</label> ".$this->showSignsList("rsign",$this->secure->checkInt($element["sign_id"]),"innerhtml")."</div>\n";
2002
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
2002
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
2003
       
2003
       
2004
        return $show;
2004
        return $show;
2005
    }
2005
    }
-
 
2006
-
 
2007
    /**
-
 
2008
     * Добавление нового репозитория
-
 
2009
     *
-
 
2010
     * @author Alexander Wolf
-
 
2011
     * @category Core
-
 
2012
     *
-
 
2013
     * @param integer $verionID
-
 
2014
     * @param string $rname
-
 
2015
     * @param string $rinfo
-
 
2016
     * @param string $rkey
-
 
2017
     * @param integer $proto
-
 
2018
     * @param integer $rhost
-
 
2019
     * @param integer $rfolder
-
 
2020
     * @param integer $rtype
-
 
2021
     * @param array $sections
-
 
2022
     * @param array $arch
-
 
2023
     * @param integer $scheme
-
 
2024
     * @param integer $sign
-
 
2025
     * @return array
-
 
2026
     */
-
 
2027
    public function addRepository($verionID, $rname, $rinfo, $rkey, $proto, $rhost, $rfolder, $rtype, $sections, $arch, $scheme, $sign) {
-
 
2028
        $result = array();
-
 
2029
        $sVersionID     = $this->secure->checkInt($verionID);
-
 
2030
        $sRName         = $this->secure->checkStr($rname);
-
 
2031
        $sRInfo         = $this->secure->checkStr($rinfo);
-
 
2032
        $sRKey          = $this->secure->checkStr($rkey);
-
 
2033
        $sProto         = $this->secure->checkInt($proto);
-
 
2034
        $sRHost         = $this->secure->checkInt($rhost);
-
 
2035
        $sRFolder       = $this->secure->checkInt($rfolder);
-
 
2036
        $sRType         = $this->secure->checkInt($rtype);
-
 
2037
        $sRScheme       = $this->secure->checkInt($scheme);
-
 
2038
        $sRSign         = $this->secure->checkInt($sign);
-
 
2039
-
 
2040
        $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."'";
-
 
2041
        $rq =& $this->db->query($query);
-
 
2042
-
 
2043
        $query = "SELECT rep_id FROM ".$this->prefix."repository ORDER BY rep_id DESC LIMIT 0, 1";
-
 
2044
        $rq =& $this->db->query($query);
-
 
2045
        $rq->fetchInto($repository);
-
 
2046
-
 
2047
        for($i=0;$i<count($sections);$i++) {
-
 
2048
            $query = "INSERT INTO ".$this->prefix."sect2rep SET rep_id='".$repository["rep_id"]."', sect_id='".$sections[$i]."'";
-
 
2049
            $rq =& $this->db->query($query);
-
 
2050
        }
-
 
2051
-
 
2052
        for($i=0;$i<count($arch);$i++) {
-
 
2053
            $query = "INSERT INTO ".$this->prefix."arch2rep SET rep_id='".$repository["rep_id"]."', arch_id='".$arch[$i]."'";
-
 
2054
            $rq =& $this->db->query($query);
-
 
2055
        }
-
 
2056
-
 
2057
        if (PEAR::isError($this->db)) {
-
 
2058
            $result["ERR"] = 1;
-
 
2059
            $result["ERRINFO"] = $this->db->getMessage();
-
 
2060
        } else {
-
 
2061
            $result["ERR"] = 0;
-
 
2062
        }
-
 
2063
       
-
 
2064
        return $result;
-
 
2065
    }
2006
   
2066
   
2007
}
2067
}
2008
2068
2009
?>
2069
?>
2010
2070