Commit ba2272ca authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#335] moved URL settings to rvd_back

parent 15574333
......@@ -514,6 +514,22 @@ sub _update_data {
$self->_update_domain_drivers_options();
}
sub _set_url_isos($self, $url='http://localhost/iso/') {
my $sth = $CONNECTOR->dbh->prepare(
"SELECT id,url FROM iso_images "
."WHERE url is NOT NULL"
);
my $sth_update = $CONNECTOR->dbh->prepare(
"UPDATE iso_images set url=? WHERE id=?"
);
$sth->execute();
while ( my ($id, $url) = $sth->fetchrow) {
$url =~ s{\w+://(.*?)/(.*)}{http://localhost/iso/$2};
$sth_update->execute($url, $id);
}
$sth->finish;
}
sub _upgrade_table {
my $self = shift;
my ($table, $field, $definition) = @_;
......
......@@ -44,19 +44,7 @@ sub test_download {
}
sub local_urls {
my $sth = $test->dbh->prepare(
"SELECT id,url FROM iso_images "
."WHERE url is NOT NULL"
);
my $sth_update = $test->dbh->prepare(
"UPDATE iso_images set url=? WHERE id=?"
);
$sth->execute();
while ( my ($id, $url) = $sth->fetchrow) {
$url =~ s{\w+://(.*?)/(.*)}{http://localhost/iso/$2};
$sth_update->execute($url, $id);
}
$sth->finish;
rvd_back->_set_url_isos('http://localhost/iso/');
}
sub search_id_isos {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment