Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat index.php
- <?php
- if (cfr('MASSACRE')) {
- function zb_AnnihilateUser($login) {
- global $billing;
- $alter_conf=rcms_parse_ini_file(CONFIG_PATH."alter.ini");
- $user_ip=zb_UserGetIP($login);
- $user_aptdata=zb_AddressGetAptData($login);
- @$user_aptid=$user_aptdata['aptid'];
- zb_AddressDeleteApartment($user_aptid);
- zb_AddressOrphanUser($login);
- zb_UserDeleteEmail($login);
- zb_UserDeleteNotes($login);
- zb_UserDeletePhone($login);
- zb_UserDeleteRealName($login);
- zb_UserDeleteSpeedOverride($login);
- if (!$alter_conf['STRICT_CONTRACTS_PROTECT']) {
- zb_UserDeleteContract($login);
- }
- zb_VserviceCashClear($login);
- log_register("DELETE VCASH (".$login.")");
- cf_FlushAllUserCF($login);
- zb_FlushAllUserTags($login);
- vlan_delete_host($login);
- multinet_delete_host($user_ip);
- multinet_rebuild_all_handlers();
- //destroy stargazer user
- $billing->deleteuser($login);
- log_register("StgUser DELETE (".$login.")");
- }
- function web_AnnihilateFormShow($login) {
- $alladdress=zb_AddressGetFulladdresslist();
- $inputs=__('Be careful, this module permanently deletes users and all data associated with it. Opportunities to raise from the dead no longer.');
- $inputs.= wf_tag('br');
- $inputs.=__('To ensure that we have seen the seriousness of your intentions to enter the word confirm the field below.');
- $inputs.= wf_tag('br');
- $inputs.=wf_tag('input', false, '', 'type="text" name="confirmation" autocomplete="off"');
- $inputs.= wf_HiddenInput('massacre', 'true');
- $inputs.=wf_delimiter();
- $inputs.= wf_Submit(__('I really want to stop suffering Users'));
- $form= wf_Form('', 'POST', $inputs, 'glamour');
- show_window(__('Deleting all users from table'), $form);
- }
- $query="SELECT `login`,`IP` from `users` WHERE (`IP` LIKE '172.16.18.3%') ";
- $alllogins=simple_queryall($query);
- $allrealnames=zb_UserGetAllRealnames();
- $alladdress=zb_AddressGetFulladdresslist();
- if (!empty ($alllogins)) {
- $tablecells=wf_TableCell(__('Login'));
- $tablecells.=wf_TableCell(__('IP'));
- $tablecells.=wf_TableCell(__('Real Name'));
- $tablecells.=wf_TableCell(__('Address'));
- $tablerows=wf_TableRow($tablecells, 'row1');
- foreach ($alllogins as $io=>$eachlogin) {
- $userlogin=$eachlogin['login'];
- $userip=$eachlogin['IP'];
- $tablecells=wf_TableCell($userlogin);
- $tablecells.=wf_TableCell($userip);
- $tablecells.=wf_TableCell(@$allrealnames[$userlogin]);
- $tablecells.=wf_TableCell(@$alladdress[ $userlogin]);
- $tablerows.=wf_TableRow($tablecells, 'row3');
- }
- $result=wf_TableBody($tablerows, '100%', '0', 'sortable');
- } else {
- $result=__('No users found');
- }
- show_window(__('Massacre'), $result);
- web_AnnihilateFormShow("");
- if (isset ($_POST['massacre'])) {
- if (isset($_POST['confirmation'])) {
- if ($_POST['confirmation']=='confirm') {
- foreach ($alllogins as $io=>$eachlogin) {
- $login=$eachlogin['login'];
- zb_AnnihilateUser($login);
- }
- rcms_redirect("?module=index");
- }
- }
- }
- } else {
- // если нет - вываливаем на него ошибку об отказе в доступе
- show_error(__('You cant control this module'));
- }
- ?>
Add Comment
Please, Sign In to add comment