Revision 4e21c82e
Added by Bruno Ferri almost 11 years ago
usr/local/www/system_usermanager.php | ||
---|---|---|
177 | 177 |
$pconfig['lifetime'] = 3650; |
178 | 178 |
} |
179 | 179 |
|
180 |
if(isset($_POST['dellall_x'])) { |
|
181 |
|
|
182 |
$del_users = $_POST['delete_check']; |
|
183 |
|
|
184 |
if(!empty($del_users)) { |
|
185 |
foreach($del_users as $userid) { |
|
186 |
if (isset($a_user[$userid]) && $a_user[$userid]['scope'] != "system") { |
|
187 |
conf_mount_rw(); |
|
188 |
local_user_del($a_user[$userid]); |
|
189 |
conf_mount_ro(); |
|
190 |
unset($a_user[$userid]); |
|
191 |
} |
|
192 |
} |
|
193 |
$savemsg = gettext("Selected users removed successfully!"); |
|
194 |
write_config($savemsg); |
|
195 |
} |
|
196 |
} |
|
197 |
|
|
180 | 198 |
if ($_POST['save']) { |
181 | 199 |
unset($input_errors); |
182 | 200 |
$pconfig = $_POST; |
... | ... | |
378 | 396 |
<script type="text/javascript"> |
379 | 397 |
//<![CDATA[ |
380 | 398 |
|
399 |
function checkall_checkbox(checked) { |
|
400 |
var cbs = document.getElementsByName('delete_check[]'); |
|
401 |
if (cbs != null) |
|
402 |
for (var i = 0; i < cbs.length; i++) |
|
403 |
cbs[i].checked = checked; |
|
404 |
} |
|
405 |
|
|
381 | 406 |
function setall_selected(id) { |
382 | 407 |
selbox = document.getElementById(id); |
383 | 408 |
count = selbox.options.length; |
... | ... | |
875 | 900 |
<th width="25%" class="listhdrr"><?=gettext("Full name"); ?></th> |
876 | 901 |
<th width="5%" class="listhdrr"><?=gettext("Disabled"); ?></th> |
877 | 902 |
<th width="25%" class="listhdrr"><?=gettext("Groups"); ?></th> |
878 |
<th width="10%" class="list"></th> |
|
903 |
<th width="10%" class="list"><input type="checkbox" onClick="checkall_checkbox(this.checked)"> <?=gettext("check all")?></th>
|
|
879 | 904 |
</tr> |
880 | 905 |
</thead> |
881 | 906 |
<tfoot> |
... | ... | |
886 | 911 |
src="/themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" |
887 | 912 |
onclick="document.getElementById('act').value='<?php echo "new";?>';" |
888 | 913 |
title="<?=gettext("add user");?>" /> |
914 |
<input type="image" src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" name="dellall" title="<?=gettext('Delete selected users')?>" onClick="return confirm('<?=gettext("Do you really want to delete selected Users?");?>')" /> |
|
889 | 915 |
</td> |
890 | 916 |
</tr> |
891 | 917 |
<tr> |
... | ... | |
951 | 977 |
document.getElementById('act').value='<?php echo "deluser";?>'; |
952 | 978 |
return confirm('<?=gettext("Do you really want to delete this user?");?>');" |
953 | 979 |
title="<?=gettext("delete user");?>" /> |
980 |
<input type='checkbox' id='check_<?=$i?>' name='delete_check[]' value='<?=$i?>' /> |
|
954 | 981 |
<?php |
955 | 982 |
endif; |
956 | 983 |
?> |
Also available in: Unified diff
add input checkbox to remove multiple users