Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
109fb513
Commit
109fb513
authored
May 15, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(auth) make Local auth extendable
parent
d138098b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
Local.php
src/opnsense/mvc/app/library/OPNsense/Auth/Local.php
+21
-5
No files found.
src/opnsense/mvc/app/library/OPNsense/Auth/Local.php
View file @
109fb513
...
...
@@ -56,12 +56,11 @@ class Local implements IAuthConnector
}
/**
* authenticate user against local database (in config.xml)
* @param string $username username to authenticate
* @param string $password user password
* @return bool authentication status
* find user settings in local database
* @param string $username username to find
* @return SimpleXMLElement|null user settings (xml section)
*/
p
ublic
function
authenticate
(
$username
,
$password
)
p
rotected
function
getUser
(
$username
)
{
// search local user in database
$configObj
=
Config
::
getInstance
()
->
object
();
...
...
@@ -73,7 +72,24 @@ class Local implements IAuthConnector
break
;
}
}
return
$userObject
;
}
/**
* authenticate user against local database (in config.xml)
* @param string|SimpleXMLElement $username username (or xml object) to authenticate
* @param string $password user password
* @return bool authentication status
*/
public
function
authenticate
(
$username
,
$password
)
{
if
(
is_a
(
$username
,
'SimpleXMLElement'
))
{
// user xml section provided
$userObject
=
$username
;
}
else
{
// get xml section from config
$userObject
=
$this
->
getUser
(
$username
);
}
if
(
$userObject
!=
null
)
{
if
(
isset
(
$userObject
->
disabled
))
{
// disabled user
...
...
Write
Preview
Markdown
is supported
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