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
1e194c54
Commit
1e194c54
authored
Apr 12, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: clean up custom priv glue and reshuffle items into one
parent
7bc10661
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
103 deletions
+72
-103
priv.defs.inc
src/etc/inc/priv.defs.inc
+71
-0
priv.inc
src/etc/inc/priv.inc
+1
-29
user.priv.inc
src/etc/inc/priv/user.priv.inc
+0
-74
No files found.
src/etc/inc/priv.defs.inc
View file @
1e194c54
<?php
global
$priv_list
;
$priv_list
=
array
();
$priv_list
[
'page-all'
]
=
array
();
...
...
@@ -1391,3 +1393,72 @@ $priv_list['page-firewall-easyrule']['name'] = gettext("WebCfg - Firewall: Easy
$priv_list
[
'page-firewall-easyrule'
][
'descr'
]
=
gettext
(
"Allow access to the 'Firewall: Easy Rule' add/status page."
);
$priv_list
[
'page-firewall-easyrule'
][
'match'
]
=
array
();
$priv_list
[
'page-firewall-easyrule'
][
'match'
][]
=
"easyrule.php*"
;
$priv_list
[
'page-help-all'
]
=
array
();
$priv_list
[
'page-help-all'
][
'name'
]
=
"WebCfg - Help pages"
;
$priv_list
[
'page-help-all'
][
'descr'
]
=
"Show all items on help menu"
;
$priv_list
[
'page-help-all'
][
'match'
]
=
array
();
$priv_list
[
'page-help-all'
][
'match'
][]
=
"*help.php"
;
$priv_list
[
'page-dashboard-all'
]
=
array
();
$priv_list
[
'page-dashboard-all'
][
'name'
]
=
"WebCfg - Dashboard (all)"
;
$priv_list
[
'page-dashboard-all'
][
'descr'
]
=
"Allow access to all pages required for the dashboard."
;
$priv_list
[
'page-dashboard-all'
][
'match'
]
=
array
();
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"index.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"*.widget.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"graph.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"graph_cpu.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"getstats.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"ifstats.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"diag_logs_filter_dynamic.php*"
;
$priv_list
[
'page-dashboard-widgets'
]
=
array
();
$priv_list
[
'page-dashboard-widgets'
][
'name'
]
=
"WebCfg - Dashboard widgets (direct access)."
;
$priv_list
[
'page-dashboard-widgets'
][
'descr'
]
=
"Allow direct access to all Dashboard widget pages, required for some widgets using AJAX."
;
$priv_list
[
'page-dashboard-widgets'
][
'match'
]
=
array
();
$priv_list
[
'page-dashboard-widgets'
][
'match'
][]
=
"*.widget.php*"
;
$priv_list
[
'user-services-captiveportal-login'
]
=
array
();
$priv_list
[
'user-services-captiveportal-login'
][
'name'
]
=
gettext
(
"User - Services - Captive portal login"
);
$priv_list
[
'user-services-captiveportal-login'
][
'descr'
]
=
gettext
(
"Indicates whether the user is able to login on the captive portal."
);
$priv_list
[
'user-config-readonly'
]
=
array
();
$priv_list
[
'user-config-readonly'
][
'name'
]
=
"User - Config - Deny Config Write"
;
$priv_list
[
'user-config-readonly'
][
'descr'
]
=
"If present, ignores requests from this user to write config.xml."
;
$priv_list
[
'user-shell-access'
]
=
array
();
$priv_list
[
'user-shell-access'
][
'name'
]
=
"User - System - Shell account access"
;
$priv_list
[
'user-shell-access'
][
'descr'
]
=
"Indicates whether the user is able to login for "
.
"example via SSH."
;
$priv_list
[
'user-copy-files'
]
=
array
();
$priv_list
[
'user-copy-files'
][
'name'
]
=
"User - System - Copy files"
;
$priv_list
[
'user-copy-files'
][
'descr'
]
=
"Indicates whether the user is allowed to copy files "
.
"onto the
{
$g
[
'product_name'
]
}
appliance via SCP/SFTP. "
.
"If you are going to use this privilege, you must install "
.
"scponly on the appliance (Hint: pkg_add -r scponly)."
;
$priv_list
[
'user-ssh-tunnel'
]
=
array
();
$priv_list
[
'user-ssh-tunnel'
][
'name'
]
=
"User - System - SSH tunneling"
;
$priv_list
[
'user-ssh-tunnel'
][
'descr'
]
=
"Indicates whether the user is able to login for "
.
"tunneling via SSH when they have no shell access. "
.
"Note: User - System - Copy files conflicts with "
.
"this privilege."
;
$priv_list
[
'user-ipsec-xauth-dialin'
]
=
array
();
$priv_list
[
'user-ipsec-xauth-dialin'
][
'name'
]
=
"User - VPN - IPsec xauth Dialin"
;
$priv_list
[
'user-ipsec-xauth-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via IPsec xauth "
.
"(Note: Does not allow shell access, but may allow "
.
"the user to create ssh tunnels)"
;
$priv_list
[
'user-l2tp-dialin'
]
=
array
();
$priv_list
[
'user-l2tp-dialin'
][
'name'
]
=
"User - VPN - L2TP Dialin"
;
$priv_list
[
'user-l2tp-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via L2TP"
;
$priv_list
[
'user-pptp-dialin'
]
=
array
();
$priv_list
[
'user-pptp-dialin'
][
'name'
]
=
"User - VPN - PPTP Dialin"
;
$priv_list
[
'user-pptp-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via PPTP"
;
$priv_list
[
'user-pppoe-dialin'
]
=
array
();
$priv_list
[
'user-pppoe-dialin'
][
'name'
]
=
"User - VPN - PPPOE Dialin"
;
$priv_list
[
'user-pppoe-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via PPPOE"
;
src/etc/inc/priv.inc
View file @
1e194c54
...
...
@@ -30,35 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"priv.defs.inc"
);
/* Load and process custom privs. */
function
get_priv_files
(
$directory
)
{
$dir_array
=
array
();
if
(
!
is_dir
(
$directory
))
return
;
if
(
$dh
=
opendir
(
$directory
))
{
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
$canadd
=
0
;
if
(
$file
==
"."
)
$canadd
=
1
;
if
(
$file
==
".."
)
$canadd
=
1
;
if
(
$canadd
==
0
)
array_push
(
$dir_array
,
$file
);
}
closedir
(
$dh
);
}
if
(
!
is_array
(
$dir_array
))
return
;
return
$dir_array
;
}
// Load and sort privs
$dir_array
=
get_priv_files
(
"/usr/local/etc/inc/priv"
);
foreach
(
$dir_array
as
$file
)
if
(
!
is_dir
(
"/usr/local/etc/inc/priv/
{
$file
}
"
)
&&
stristr
(
$file
,
".inc"
))
include
(
"priv/
{
$file
}
"
);
require_once
'priv.defs.inc'
;
if
(
is_array
(
$priv_list
))
{
usort
(
$priv_list
,
function
(
$a
,
$b
)
{
...
...
src/etc/inc/priv/user.priv.inc
deleted
100644 → 0
View file @
7bc10661
<?php
global
$priv_list
;
$priv_list
[
'user-services-captiveportal-login'
]
=
array
();
$priv_list
[
'user-services-captiveportal-login'
][
'name'
]
=
gettext
(
"User - Services - Captive portal login"
);
$priv_list
[
'user-services-captiveportal-login'
][
'descr'
]
=
gettext
(
"Indicates whether the user is able to login on the captive portal."
);
$priv_list
[
'page-help-all'
]
=
array
();
$priv_list
[
'page-help-all'
][
'name'
]
=
"WebCfg - Help pages"
;
$priv_list
[
'page-help-all'
][
'descr'
]
=
"Show all items on help menu"
;
$priv_list
[
'page-help-all'
][
'match'
]
=
array
();
$priv_list
[
'page-help-all'
][
'match'
][]
=
"*help.php"
;
$priv_list
[
'page-dashboard-all'
]
=
array
();
$priv_list
[
'page-dashboard-all'
][
'name'
]
=
"WebCfg - Dashboard (all)"
;
$priv_list
[
'page-dashboard-all'
][
'descr'
]
=
"Allow access to all pages required for the dashboard."
;
$priv_list
[
'page-dashboard-all'
][
'match'
]
=
array
();
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"index.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"*.widget.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"graph.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"graph_cpu.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"getstats.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"ifstats.php*"
;
$priv_list
[
'page-dashboard-all'
][
'match'
][]
=
"diag_logs_filter_dynamic.php*"
;
$priv_list
[
'page-dashboard-widgets'
]
=
array
();
$priv_list
[
'page-dashboard-widgets'
][
'name'
]
=
"WebCfg - Dashboard widgets (direct access)."
;
$priv_list
[
'page-dashboard-widgets'
][
'descr'
]
=
"Allow direct access to all Dashboard widget pages, required for some widgets using AJAX."
;
$priv_list
[
'page-dashboard-widgets'
][
'match'
]
=
array
();
$priv_list
[
'page-dashboard-widgets'
][
'match'
][]
=
"*.widget.php*"
;
$priv_list
[
'user-config-readonly'
]
=
array
();
$priv_list
[
'user-config-readonly'
][
'name'
]
=
"User - Config - Deny Config Write"
;
$priv_list
[
'user-config-readonly'
][
'descr'
]
=
"If present, ignores requests from this user to write config.xml."
;
$priv_list
[
'user-shell-access'
]
=
array
();
$priv_list
[
'user-shell-access'
][
'name'
]
=
"User - System - Shell account access"
;
$priv_list
[
'user-shell-access'
][
'descr'
]
=
"Indicates whether the user is able to login for "
.
"example via SSH."
;
$priv_list
[
'user-copy-files'
]
=
array
();
$priv_list
[
'user-copy-files'
][
'name'
]
=
"User - System - Copy files"
;
$priv_list
[
'user-copy-files'
][
'descr'
]
=
"Indicates whether the user is allowed to copy files "
.
"onto the
{
$g
[
'product_name'
]
}
appliance via SCP/SFTP. "
.
"If you are going to use this privilege, you must install "
.
"scponly on the appliance (Hint: pkg_add -r scponly)."
;
$priv_list
[
'user-ssh-tunnel'
]
=
array
();
$priv_list
[
'user-ssh-tunnel'
][
'name'
]
=
"User - System - SSH tunneling"
;
$priv_list
[
'user-ssh-tunnel'
][
'descr'
]
=
"Indicates whether the user is able to login for "
.
"tunneling via SSH when they have no shell access. "
.
"Note: User - System - Copy files conflicts with "
.
"this privilege."
;
$priv_list
[
'user-ipsec-xauth-dialin'
]
=
array
();
$priv_list
[
'user-ipsec-xauth-dialin'
][
'name'
]
=
"User - VPN - IPsec xauth Dialin"
;
$priv_list
[
'user-ipsec-xauth-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via IPsec xauth "
.
"(Note: Does not allow shell access, but may allow "
.
"the user to create ssh tunnels)"
;
$priv_list
[
'user-l2tp-dialin'
]
=
array
();
$priv_list
[
'user-l2tp-dialin'
][
'name'
]
=
"User - VPN - L2TP Dialin"
;
$priv_list
[
'user-l2tp-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via L2TP"
;
$priv_list
[
'user-pptp-dialin'
]
=
array
();
$priv_list
[
'user-pptp-dialin'
][
'name'
]
=
"User - VPN - PPTP Dialin"
;
$priv_list
[
'user-pptp-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via PPTP"
;
$priv_list
[
'user-pppoe-dialin'
]
=
array
();
$priv_list
[
'user-pppoe-dialin'
][
'name'
]
=
"User - VPN - PPPOE Dialin"
;
$priv_list
[
'user-pppoe-dialin'
][
'descr'
]
=
"Indicates whether the user is allowed to dial in via PPPOE"
;
?>
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