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
041681ba
Commit
041681ba
authored
Dec 21, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: extend sudo usage for no password mode
parent
17117f5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
sudoers
src/opnsense/service/templates/OPNsense/Auth/sudoers
+2
-0
system_advanced_admin.php
src/www/system_advanced_admin.php
+13
-10
No files found.
src/opnsense/service/templates/OPNsense/Auth/sudoers
View file @
041681ba
{% if system.sudo_allow_wheel|default('0') == '1' %}
%wheel ALL=(ALL) ALL
{% elif system.sudo_allow_wheel|default('0') == '2' %}
%wheel ALL=(ALL) NOPASSWD: ALL
{% endif %}
src/www/system_advanced_admin.php
View file @
041681ba
...
...
@@ -42,7 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'disablehttpredirect'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'disablehttpredirect'
]);
$pconfig
[
'disableconsolemenu'
]
=
isset
(
$config
[
'system'
][
'disableconsolemenu'
]);
$pconfig
[
'disableintegratedauth'
]
=
!
empty
(
$config
[
'system'
][
'disableintegratedauth'
]);
$pconfig
[
'sudo_allow_wheel'
]
=
isset
(
$config
[
'system'
][
'sudo_allow_wheel'
])
;
$pconfig
[
'sudo_allow_wheel'
]
=
$config
[
'system'
][
'sudo_allow_wheel'
]
;
$pconfig
[
'noantilockout'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'noantilockout'
]);
$pconfig
[
'nodnsrebindcheck'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'nodnsrebindcheck'
]);
$pconfig
[
'nohttpreferercheck'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'nohttpreferercheck'
]);
...
...
@@ -121,8 +121,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset
(
$config
[
'system'
][
'disableintegratedauth'
]);
}
if
(
$pconfig
[
'sudo_allow_wheel'
]
==
"yes"
)
{
$config
[
'system'
][
'sudo_allow_wheel'
]
=
true
;
if
(
!
empty
(
$pconfig
[
'sudo_allow_wheel'
])
)
{
$config
[
'system'
][
'sudo_allow_wheel'
]
=
$pconfig
[
'sudo_allow_wheel'
]
;
}
elseif
(
isset
(
$config
[
'system'
][
'sudo_allow_wheel'
]))
{
unset
(
$config
[
'system'
][
'sudo_allow_wheel'
]);
}
...
...
@@ -558,13 +558,6 @@ include("head.inc");
<strong>
<?=
gettext
(
"Password protect the console menu"
);
?>
</strong>
</td>
</tr>
<tr>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"Sudo usage"
)
?>
</td>
<td
width=
"78%"
>
<input
name=
"sudo_allow_wheel"
type=
"checkbox"
value=
"yes"
<?=
empty
(
$pconfig
[
'sudo_allow_wheel'
])
?
''
:
'checked="checked"'
?>
/>
<strong>
<?=
gettext
(
'Allow administrators to use the Sudo utility'
)
?>
</strong>
</td>
</tr>
<tr>
<td><a
id=
"help_for_disableintegratedauth"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Integrated authentication"
)
?>
</td>
<td
width=
"78%"
>
...
...
@@ -575,6 +568,16 @@ include("head.inc");
</div>
</td>
</tr>
<tr>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"Sudo usage"
)
?>
</td>
<td
width=
"78%"
>
<select
name=
"sudo_allow_wheel"
id=
"sudo_allow_wheel"
class=
"formselect selectpicker"
>
<option
value=
""
<?=
empty
(
$pconfig
[
'sudo_allow_wheel'
])
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'Disallow'
)
?>
</option>
<option
value=
"1"
<?=
$pconfig
[
'sudo_allow_wheel'
]
==
1
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'Ask password'
)
?>
</option>
<option
value=
"2"
<?=
$pconfig
[
'sudo_allow_wheel'
]
==
2
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'No password'
)
?>
</option>
</select>
</td>
</tr>
<tr>
<td
width=
"22%"
valign=
"top"
>
</td>
<td
width=
"78%"
><input
name=
"Submit"
type=
"submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Save"
)
?>
"
/></td>
...
...
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