Guest User

Untitled

a guest
Jan 26th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.73 KB | None | 0 0
  1. cat index.php
  2. <?php
  3.   if (cfr('MASSACRE')) {
  4.  
  5.  function zb_AnnihilateUser($login) {
  6.         global $billing;
  7.         $alter_conf=rcms_parse_ini_file(CONFIG_PATH."alter.ini");
  8.         $user_ip=zb_UserGetIP($login);
  9.         $user_aptdata=zb_AddressGetAptData($login);
  10.         @$user_aptid=$user_aptdata['aptid'];
  11.         zb_AddressDeleteApartment($user_aptid);
  12.         zb_AddressOrphanUser($login);
  13.         zb_UserDeleteEmail($login);
  14.         zb_UserDeleteNotes($login);
  15.         zb_UserDeletePhone($login);
  16.         zb_UserDeleteRealName($login);
  17.         zb_UserDeleteSpeedOverride($login);
  18.         if (!$alter_conf['STRICT_CONTRACTS_PROTECT']) {
  19.         zb_UserDeleteContract($login);
  20.         }
  21.         zb_VserviceCashClear($login);
  22.         log_register("DELETE VCASH (".$login.")");
  23.         cf_FlushAllUserCF($login);
  24.         zb_FlushAllUserTags($login);
  25.         vlan_delete_host($login);
  26.         multinet_delete_host($user_ip);
  27.         multinet_rebuild_all_handlers();
  28.         //destroy stargazer user
  29.         $billing->deleteuser($login);
  30.         log_register("StgUser DELETE (".$login.")");
  31.     }
  32.  
  33.  function web_AnnihilateFormShow($login) {
  34.         $alladdress=zb_AddressGetFulladdresslist();
  35.  
  36.         $inputs=__('Be careful, this module permanently deletes users and all data associated with it. Opportunities to raise from the dead no longer.');
  37.         $inputs.= wf_tag('br');
  38.         $inputs.=__('To ensure that we have seen the seriousness of your intentions to enter the word confirm the field below.');
  39.         $inputs.= wf_tag('br');
  40.         $inputs.=wf_tag('input', false, '', 'type="text" name="confirmation" autocomplete="off"');
  41.         $inputs.= wf_HiddenInput('massacre', 'true');
  42.         $inputs.=wf_delimiter();
  43.         $inputs.= wf_Submit(__('I really want to stop suffering Users'));
  44.         $form=  wf_Form('', 'POST', $inputs, 'glamour');
  45.  
  46.         show_window(__('Deleting  all users  from table'), $form);
  47.     }
  48.  
  49.  
  50.     $query="SELECT `login`,`IP` from `users` WHERE (`IP`  LIKE '172.16.18.3%')  ";
  51.     $alllogins=simple_queryall($query);
  52.  
  53.     $allrealnames=zb_UserGetAllRealnames();
  54.     $alladdress=zb_AddressGetFulladdresslist();
  55.  
  56.     if (!empty ($alllogins)) {
  57.  
  58.             $tablecells=wf_TableCell(__('Login'));
  59.             $tablecells.=wf_TableCell(__('IP'));
  60.             $tablecells.=wf_TableCell(__('Real Name'));
  61.             $tablecells.=wf_TableCell(__('Address'));
  62.             $tablerows=wf_TableRow($tablecells, 'row1');
  63.  
  64.     foreach ($alllogins as $io=>$eachlogin) {
  65.             $userlogin=$eachlogin['login'];
  66.             $userip=$eachlogin['IP'];
  67.  
  68.             $tablecells=wf_TableCell($userlogin);
  69.             $tablecells.=wf_TableCell($userip);
  70.             $tablecells.=wf_TableCell(@$allrealnames[$userlogin]);
  71.             $tablecells.=wf_TableCell(@$alladdress[ $userlogin]);
  72.             $tablerows.=wf_TableRow($tablecells, 'row3');
  73.         }
  74.         $result=wf_TableBody($tablerows, '100%', '0', 'sortable');
  75.  
  76.     } else {
  77.         $result=__('No users found');
  78.     }
  79.     show_window(__('Massacre'), $result);
  80.  
  81.     web_AnnihilateFormShow("");
  82.  
  83.     if (isset ($_POST['massacre'])) {
  84.         if (isset($_POST['confirmation'])) {
  85.             if ($_POST['confirmation']=='confirm') {
  86.  
  87.                       foreach ($alllogins as $io=>$eachlogin) {
  88.                                $login=$eachlogin['login'];
  89.                                zb_AnnihilateUser($login);
  90.                               }
  91.                                rcms_redirect("?module=index");
  92.  
  93.             }
  94.         }
  95.     }
  96.  
  97.  
  98.  
  99.   } else {
  100.       // если нет - вываливаем на него ошибку об отказе в доступе
  101.       show_error(__('You cant control this module'));
  102.   }
  103.  
  104. ?>
Add Comment
Please, Sign In to add comment