Commit 58a8f00e authored by Franco Fichtner's avatar Franco Fichtner

acl: partially merge GUI changes, description dropped

parent edf77d2a
...@@ -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;?>
......
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment