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
19e56501
Commit
19e56501
authored
Sep 22, 2016
by
Francesc Guasch
Browse files
fixed LDAP auth
parent
d94b3674
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
19e56501
...
...
@@ -9,6 +9,7 @@ use DBIx::Connector;
use
Moose
;
use
YAML
;
use
Ravada::
Auth
;
use
Ravada::
Request
;
use
Ravada::VM::
KVM
;
use
Ravada::VM::
LXC
;
...
...
@@ -73,7 +74,7 @@ sub BUILD {
$CONNECTOR
=
$self
->
_connect_dbh
();
$self
->
connector
(
$CONNECTOR
);
}
Ravada::Auth::
init
(
$CONFIG
);
}
sub
_connect_dbh
{
...
...
lib/Ravada/Auth.pm
View file @
19e56501
...
...
@@ -16,14 +16,18 @@ sub init {
my
(
$config
,
$db_con
)
=
@_
;
if
(
$config
->
{
ldap
})
{
Ravada::Auth::LDAP::
init
(
$config
);
warn
"
LDAP enabled
";
}
else
{
$LDAP
=
0
;
}
Ravada::Auth::SQL::
init
(
$config
,
$db_con
);
#
Ravada::Auth::SQL::init($config, $db_con);
}
sub
login
{
eval
{
return
Ravada::Auth::LDAP::
login
(
@
_
)
if
$LDAP
};
my
(
$name
,
$pass
)
=
@_
;
return
Ravada::Auth::
LDAP
->
new
(
name
=>
$name
,
password
=>
$pass
)
if
$LDAP
;
if
(
$@
=~
/I can't connect/i
)
{
$LDAP
=
0
;
warn
$@
;
...
...
lib/Ravada/Auth/LDAP.pm
View file @
19e56501
...
...
@@ -209,6 +209,7 @@ sub login {
my
$self
=
shift
;
my
(
$username
,
$password
)
=
(
$self
->
name
,
$self
->
password
);
_init_ldap_admin
();
my
$entry
=
search_user
(
$username
);
my
$user_dn
;
...
...
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