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
58a8f00e
Commit
58a8f00e
authored
Dec 03, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acl: partially merge GUI changes, description dropped
parent
edf77d2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
12 deletions
+40
-12
system_usermanager.php
src/www/system_usermanager.php
+18
-5
system_usermanager_addprivs.php
src/www/system_usermanager_addprivs.php
+22
-7
No files found.
src/www/system_usermanager.php
View file @
58a8f00e
...
...
@@ -666,16 +666,29 @@ $( document ).ready(function() {
<td>
<table class="
table
table
-
hover
table
-
condensed
">
<tr>
<td><b><?=gettext("
Inherited
From
");?></b></td>
<td><b><?=gettext("
Inherited
from
");?></b></td>
<td><b><?=gettext("
Type
");?></b></td>
<td><b><?=gettext("
Name
");?></b></td>
<td><b><?=gettext("
Description
");?></b></td>
</tr>
<?php
foreach (get_user_privdesc(
$a_user[$id]
) as
$priv
) :?>
<tr>
<td><?=!empty(
$priv['group']
) ?
$priv['group']
: ""?></td>
<td><?=
$priv['name']
?></td>
<td><?=!empty(
$priv['descr']
) ?
$priv['descr']
: ""?></td>
<td><?=!empty(
$priv['group']
) ?
$priv['group']
: ''?></td>
<td>
<?php
switch (substr(
$priv['id']
, 0, 5)) {
case 'page-':
echo gettext('GUI');
break;
case 'user-':
echo gettext('User');
break;
default:
echo gettext('N/A');
break;
} ?>
</td>
<td><?=
$priv['name']
?></td>
</tr>
<?php
endforeach;?>
...
...
src/www/system_usermanager_addprivs.php
View file @
58a8f00e
...
...
@@ -34,9 +34,10 @@ function cpusercmp($a, $b)
return
strcasecmp
(
$a
[
'name'
],
$b
[
'name'
]);
}
function
sort_user_privs
(
$privs
)
{
// Privileges to place first, to redirect properly.
$priority_privs
=
array
(
"page-dashboard-all"
,
"page-system-login/logout"
);
function
sort_user_privs
(
$privs
)
{
/* Privileges to place first, to redirect properly. */
$priority_privs
=
array
(
'page-dashboard-all'
,
'page-system-login/logout'
);
$fprivs
=
array_intersect
(
$privs
,
$priority_privs
);
$sprivs
=
array_diff
(
$privs
,
$priority_privs
);
...
...
@@ -200,19 +201,33 @@ include("head.inc");
<tr>
<th
style=
"width:70px;"
></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$priv_list
as
$pname
=>
$pdata
)
:?>
<
tr
class
="
acl_item
" data-search-phrase="
<?=
$pdata
[
'name'
];
?>
<?=
!
empty
(
$pdata
[
'descr'
])
?
$pdata
[
'descr'
]
:
""
;
?>
">
foreach
(
$priv_list
as
$pname
=>
$pdata
)
{
$pnamesafe
=
!
empty
(
$pdata
[
'name'
])
?
$pdata
[
'name'
]
:
$pname
;
switch
(
substr
(
$pname
,
0
,
5
))
{
case
'page-'
:
$pdesc
=
gettext
(
'GUI'
);
break
;
case
'user-'
:
$pdesc
=
gettext
(
'User'
);
break
;
default
:
$pdesc
=
gettext
(
'N/A'
);
break
;
}
?>
<tr
class=
"acl_item"
data-search-phrase=
"
<?=
$pdesc
.
' '
.
$pnamesafe
?>
"
>
<td>
<input
name=
"sysprivs[]"
type=
"checkbox"
value=
"
<?=
$pname
;
?>
"
<?=
in_array
(
$pname
,
$a_privs
)
?
"checked=
\"
checked
\"
"
:
""
;
?>
>
</td>
<td><small
data-toggle=
"tooltip"
title=
"
<?=
!
empty
(
$pdata
[
'descr'
])
?
$pdata
[
'descr'
]
:
""
;
?>
"
>
<?=
!
empty
(
$pdata
[
'name'
])
?
$pdata
[
'name'
]
:
$pname
;
?>
</small></td>
<td>
<?=
$pdesc
?>
</td>
<td>
<?=
$pnamesafe
?>
</td>
</tr>
<?php
endforeach
;
?>
}
?>
</tbody>
</table>
</div>
...
...
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