Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
ba2272ca
Commit
ba2272ca
authored
Sep 20, 2017
by
Francesc Guasch
Browse files
[#335] moved URL settings to rvd_back
parent
15574333
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
ba2272ca
...
...
@@ -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
)
=
@_
;
...
...
t/request/20_download_local.t
View file @
ba2272ca
...
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment