Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
e0e716ca
Commit
e0e716ca
authored
Oct 31, 2018
by
Francesc Guasch
Browse files
fix(auth): remove auth on remove domain
issue #922
parent
0e4c4a75
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Domain.pm
View file @
e0e716ca
...
...
@@ -1152,10 +1152,10 @@ sub _after_remove_domain {
return
if
!
$self
->
{
_data
};
$self
->
_finish_requests_db
();
$self
->
_remove_base_db
();
$self
->
_remove_access_attributes_db
();
$self
->
_remove_domain_db
();
}
# removes domain in other VMs
sub
_remove_domain_cascade
($self,$user, $cascade = 1) {
return
if
!
$self
->
_vm
;
...
...
@@ -1178,6 +1178,14 @@ sub _remove_domain_cascade($self,$user, $cascade = 1) {
$sth
->
finish
;
}
sub
_remove_access_attributes_db
($self) {
my
$sth
=
$$CONNECTOR
->
dbh
->
prepare
("
DELETE FROM access_ldap_attribute
"
.
"
WHERE id_domain=?
");
$sth
->
execute
(
$self
->
id
);
$sth
->
finish
;
}
sub
_remove_domain_db
{
my
$self
=
shift
;
...
...
@@ -3024,8 +3032,8 @@ Example:
sub
allow_ldap_attribute
($self, $attribute, $value, $allowed=1 ) {
my
$sth
=
$$CONNECTOR
->
dbh
->
prepare
(
"
SELECT max(n_order)
from
access_ldap_attribute
"
.
"
WHERE id_domain
= ?
"
"
SELECT max(n_order)
FROM
access_ldap_attribute
"
.
"
WHERE id_domain
=?
"
);
$sth
->
execute
(
$self
->
id
);
my
(
$n_order
)
=
(
$sth
->
fetchrow
or
0
);
...
...
@@ -3033,9 +3041,9 @@ sub allow_ldap_attribute($self, $attribute, $value, $allowed=1 ) {
$sth
=
$$CONNECTOR
->
dbh
->
prepare
(
"
INSERT INTO access_ldap_attribute
"
.
"
(id_domain, attribute, value, allowed)
"
.
"
VALUES(?,?,?,?)
");
$sth
->
execute
(
$self
->
id
,
$attribute
,
$value
,
$allowed
);
.
"
(id_domain, attribute, value, allowed
, n_order
)
"
.
"
VALUES(?,?,?,?
,?
)
");
$sth
->
execute
(
$self
->
id
,
$attribute
,
$value
,
$allowed
,
$n_order
+
1
);
}
=head2 deny_ldap_attribute
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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