diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-11-10 18:58:46 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-11-10 18:58:46 -0500 |
commit | f80004dee74610f685433f6cda498194db235603 (patch) | |
tree | 5ea171751d63c6fe93722e2b74d272813c72bc2c /src/usr/local/www/system_usermanager.php | |
parent | 2bdffe47581eeac40c9b245b6deb40dca5500941 (diff) | |
parent | 4c879f95e72fbbf02478dcfa89c194ce955bd288 (diff) | |
download | pfsense-f80004dee74610f685433f6cda498194db235603.zip pfsense-f80004dee74610f685433f6cda498194db235603.tar.gz |
Merge pull request #2047 from heper/patch-2
Diffstat (limited to 'src/usr/local/www/system_usermanager.php')
-rw-r--r-- | src/usr/local/www/system_usermanager.php | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index 5cd0b5d..20d393b 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,16 +278,9 @@ if ($_POST['save']) { input_errors2Ajax($input_errors); exit; } - + 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(); @@ -390,6 +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 no-confirm" title="'.gettext('Delete Privilege').'" id="delprivid' .$i. '"></a></td>'; $privhtml .= '</tr>'; } @@ -891,6 +895,15 @@ events.push(function(){ $('form').submit(); } }); + $('[id^=delprivid]').click(function(event) { + if(confirm(event.target.title)) { + $('#privid').val(event.target.id.match(/\d+$/)[0]); + $('#userid').val('<?=$id;?>'); + $('#act').val('delprivid'); + $('form').submit(); + } + }); + // ---------- On initial page load ------------------------------------------------------------ |