diff options
author | heper <heper@users.noreply.github.com> | 2015-11-10 17:58:05 +0100 |
---|---|---|
committer | heper <heper@users.noreply.github.com> | 2015-11-10 17:58:05 +0100 |
commit | 4c879f95e72fbbf02478dcfa89c194ce955bd288 (patch) | |
tree | ec77b28dd115ff515facbcfae53951e3a79799f0 /src/usr/local/www/system_usermanager.php | |
parent | 408d0882851c206974e79a42e75483a7d6a55542 (diff) | |
download | pfsense-4c879f95e72fbbf02478dcfa89c194ce955bd288.zip pfsense-4c879f95e72fbbf02478dcfa89c194ce955bd288.tar.gz |
fix submit & move back to seperate ACT==delprivid
the code for delprivid was inside ACT==save / when hitting 'save' the post-data for delprivid was already gone
Diffstat (limited to 'src/usr/local/www/system_usermanager.php')
-rw-r--r-- | src/usr/local/www/system_usermanager.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index 353768e..5eb3a2b 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -167,6 +167,16 @@ if ($_POST['act'] == "delcert") { $_POST['act'] = "edit"; $savemsg = gettext("Certificate") . " {$certdeleted} " . gettext("association removed.") . "<br />"; } +if ($_POST['act'] == "delprivid") { + + if ($a_user[$id] && !empty($_POST['privid'])) { + unset($a_user[$id]['priv'][$_POST['privid']]); + local_user_set($a_user[$id]); + write_config(); + $_POST['act'] = "edit"; + $savemsg = gettext("Privilege removed.") . "<br />"; + } +} if ($_POST['save']) { unset($input_errors); @@ -268,18 +278,9 @@ if ($_POST['save']) { input_errors2Ajax($input_errors); exit; } - echo "privid: "; - echo $_POST['privid']; + if (!$input_errors) { - // This used to be a separate act=delpriv - - if ($a_user[$id] && !empty($_POST['privid'])) { - foreach ($_POST['privid'] as $i) - unset($a_user[$id]['priv'][$i]); - local_user_set($a_user[$id]); - write_config(); - } conf_mount_rw(); $userent = array(); @@ -392,7 +393,7 @@ function build_priv_table() { $privhtml .= '<td>' . htmlspecialchars($priv['group']) . '</td>'; $privhtml .= '<td>' . htmlspecialchars($priv['name']) . '</td>'; $privhtml .= '<td>' . htmlspecialchars($priv['descr']) . '</td>'; - $privhtml .= '<td><a class="fa fa-trash" title="'.gettext('Delete Privilege').'" id="delprivid' .$i. '"></a></td>'; + $privhtml .= '<td><a class="fa fa-trash no-confirm" title="'.gettext('Delete Privilege').'" id="delprivid' .$i. '"></a></td>'; $privhtml .= '</tr>'; } @@ -898,7 +899,7 @@ events.push(function(){ }); $('[id^=delprivid]').click(function(event) { if(confirm(event.target.title)) { - $('#privid).val(event.target.id.match(/\d+$/)[0]); + $('#privid').val(event.target.id.match(/\d+$/)[0]); $('#userid').val('<?=$id;?>'); $('#act').val('delprivid'); $('form').submit(); |