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
768d5e81
Commit
768d5e81
authored
Jul 23, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: prevent user from deleting itself; closes #1031
Bravely assisted by: @ShaRose
parent
6e0b70a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
system_usermanager.php
src/www/system_usermanager.php
+11
-7
No files found.
src/www/system_usermanager.php
View file @
768d5e81
...
...
@@ -165,13 +165,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
$act
==
"deluser"
&&
isset
(
$id
))
{
// drop user
local_user_del
(
$a_user
[
$id
]);
$userdeleted
=
$a_user
[
$id
][
'name'
];
unset
(
$a_user
[
$id
]);
write_config
();
$savemsg
=
gettext
(
"User"
)
.
"
{
$userdeleted
}
"
.
gettext
(
"successfully deleted"
);
header
(
"Location: system_usermanager.php?savemsg="
.
$savemsg
);
exit
;
if
(
$_SESSION
[
'Username'
]
===
$a_user
[
$id
][
'name'
])
{
$input_errors
[]
=
gettext
(
'You cannot delete yourself.'
);
}
else
{
local_user_del
(
$a_user
[
$id
]);
$userdeleted
=
$a_user
[
$id
][
'name'
];
unset
(
$a_user
[
$id
]);
write_config
();
$savemsg
=
gettext
(
"User"
)
.
"
{
$userdeleted
}
"
.
gettext
(
"successfully deleted"
);
header
(
"Location: system_usermanager.php?savemsg="
.
$savemsg
);
exit
;
}
}
elseif
(
$act
==
"delcert"
&&
isset
(
$id
))
{
// remove certificate association
$certdeleted
=
lookup_cert
(
$a_user
[
$id
][
'cert'
][
$pconfig
[
'certid'
]]);
...
...
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