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
d569a8e1
Commit
d569a8e1
authored
Sep 19, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access: allow root disable and prevent to disable own user
PR:
https://forum.opnsense.org/index.php?topic=3684
parent
2f5468ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
auth.inc
src/etc/inc/auth.inc
+0
-1
system_usermanager.php
src/www/system_usermanager.php
+5
-1
No files found.
src/etc/inc/auth.inc
View file @
d569a8e1
...
...
@@ -429,7 +429,6 @@ function local_user_set(&$user)
/* root user special handling */
if
(
$user_uid
==
0
)
{
$user_shell
=
isset
(
$user
[
'shell'
])
?
$user
[
'shell'
]
:
'/usr/local/etc/rc.initial'
;
$lock_account
=
'unlock'
;
$user_group
=
'wheel'
;
$user_home
=
'/root'
;
}
...
...
src/www/system_usermanager.php
View file @
d569a8e1
...
...
@@ -236,6 +236,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors
[]
=
gettext
(
"The passwords do not match."
);
}
if
(
!
empty
(
$pconfig
[
'disabled'
])
&&
$_SESSION
[
'Username'
]
===
$a_user
[
$id
][
'name'
])
{
$input_errors
[]
=
gettext
(
'You cannot disable yourself.'
);
}
if
(
isset
(
$id
))
{
$oldusername
=
$a_user
[
$id
][
'name'
];
}
else
{
...
...
@@ -262,7 +266,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
/*
/*
* Check for a valid expirationdate if one is set at all (valid means,
* DateTime puts out a time stamp so any DateTime compatible time
* format may be used. to keep it simple for the enduser, we only
...
...
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