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() {
...
@@ -666,16 +666,29 @@ $( document ).ready(function() {
<td>
<td>
<table class="
table
table
-
hover
table
-
condensed
">
<table class="
table
table
-
hover
table
-
condensed
">
<tr>
<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("
Name
");?></b></td>
<td><b><?=gettext("
Description
");?></b></td>
</tr>
</tr>
<?php
<?php
foreach (get_user_privdesc(
$a_user[$id]
) as
$priv
) :?>
foreach (get_user_privdesc(
$a_user[$id]
) as
$priv
) :?>
<tr>
<tr>
<td><?=!empty(
$priv['group']
) ?
$priv['group']
: ""?></td>
<td><?=!empty(
$priv['group']
) ?
$priv['group']
: ''?></td>
<td><?=
$priv['name']
?></td>
<td>
<td><?=!empty(
$priv['descr']
) ?
$priv['descr']
: ""?></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>
</tr>
<?php
<?php
endforeach;?>
endforeach;?>
...
...
src/www/system_usermanager_addprivs.php
View file @
58a8f00e
...
@@ -34,9 +34,10 @@ function cpusercmp($a, $b)
...
@@ -34,9 +34,10 @@ function cpusercmp($a, $b)
return
strcasecmp
(
$a
[
'name'
],
$b
[
'name'
]);
return
strcasecmp
(
$a
[
'name'
],
$b
[
'name'
]);
}
}
function
sort_user_privs
(
$privs
)
{
function
sort_user_privs
(
$privs
)
// Privileges to place first, to redirect properly.
{
$priority_privs
=
array
(
"page-dashboard-all"
,
"page-system-login/logout"
);
/* Privileges to place first, to redirect properly. */
$priority_privs
=
array
(
'page-dashboard-all'
,
'page-system-login/logout'
);
$fprivs
=
array_intersect
(
$privs
,
$priority_privs
);
$fprivs
=
array_intersect
(
$privs
,
$priority_privs
);
$sprivs
=
array_diff
(
$privs
,
$priority_privs
);
$sprivs
=
array_diff
(
$privs
,
$priority_privs
);
...
@@ -200,19 +201,33 @@ include("head.inc");
...
@@ -200,19 +201,33 @@ include("head.inc");
<tr>
<tr>
<th
style=
"width:70px;"
></th>
<th
style=
"width:70px;"
></th>
<th></th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<?php
<?php
foreach
(
$priv_list
as
$pname
=>
$pdata
)
:?>
foreach
(
$priv_list
as
$pname
=>
$pdata
)
{
<
tr
class
="
acl_item
" data-search-phrase="
<?=
$pdata
[
'name'
];
?>
<?=
!
empty
(
$pdata
[
'descr'
])
?
$pdata
[
'descr'
]
:
""
;
?>
">
$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>
<td>
<input
name=
"sysprivs[]"
type=
"checkbox"
value=
"
<?=
$pname
;
?>
"
<?=
in_array
(
$pname
,
$a_privs
)
?
"checked=
\"
checked
\"
"
:
""
;
?>
>
<input
name=
"sysprivs[]"
type=
"checkbox"
value=
"
<?=
$pname
;
?>
"
<?=
in_array
(
$pname
,
$a_privs
)
?
"checked=
\"
checked
\"
"
:
""
;
?>
>
</td>
</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>
</tr>
<?php
<?php
endforeach
;
?>
}
?>
</tbody>
</tbody>
</table>
</table>
</div>
</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