function DupeFinderStep3Frame(&$db, $vars) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Item.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Item.class.php"; $itemClass = new Item(); if (!$MainMaintenance) { die("Shutdown the server and enable maintenance mode in website before.<br /><br />Desligue o servidor e ative o modo de manutenção no website antes."); } if ($vars['DeleteDup'] == 0 && $vars['DeleteAll'] == 0 && $vars['BlockAccs'] == 0) { die($ItemMessage036); } if ($vars['BlockAccs'] == 1) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/Blocks.class.php"; $blockClass = new Blocks(); $param = array(); $param['cause'] = $ItemMessage044; $param['image'] = ""; } echo $ItemMessage037 . "<br />" . str_repeat(" ", 4096); flush(); if (!file_exists("../DupedItems")) { die($ItemMessage038); } @ini_set('max_execution_time', 3600); @set_time_limit(0); if ($vars['DeleteAll'] == 1) { $DupeData = array(); $CountData = array(); $handle = fopen("../DupedItems", "r"); while ($data = fgets($handle)) { $DataArray = explode(":", $data); $serial = trim($DataArray[2]); if (!in_array($serial, $DupeData)) { array_push($DupeData, $serial); $CountData[$serial] = 2; } else { $CountData[$serial]++; } } fclose($handle); foreach ($DupeData as $k => $v) { echo "<hr /><strong>> {$ItemMessage030} {$v} (" . $CountData[$v] . " {$ItemMessage035})</strong><br />"; flush(); $ItemData = array(); $db->Query("SELECT AccountID FROM warehouse WHERE (charindex (0x{$v}, items) %16=4)"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage039 . $data[0] . " ... "; $itemClass->DeleteItemFromGame($db, $v, 0, $data[0]); echo "OK!<br />"; flush(); if ($vars['BlockAccs'] == 1) { echo $ItemMessage045 . " ... "; $param['ref'] = "memb___id"; $param['value'] = $data[0]; $blockClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } } $ItemData = array(); $db->Query("SELECT Name FROM Character WHERE (charindex (0x{$v}, inventory) %16=4)"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage040 . $data[0] . " ... "; $itemClass->DeleteItemFromGame($db, $v, 1, $data[0]); echo "OK!<br />"; flush(); if ($vars['BlockAccs'] == 1) { echo $ItemMessage045 . " ... "; $param['ref'] = "Name"; $param['value'] = $data[0]; $blockClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } } $ItemData = array(); $db->Query("SELECT memb___id,idx FROM Z_WebVault WHERE substring(item,7,8) = '{$v}'"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage041 . $data[0] . " ... "; $db->Query("DELETE FROM Z_WebVault WHERE idx = '" . $data[1] . "'"); echo "OK!<br />"; flush(); if ($vars['BlockAccs'] == 1) { echo $ItemMessage045 . " ... "; $param['ref'] = "memb___id"; $param['value'] = $data[0]; $blockClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } } $ItemData = array(); $db->Query("SELECT sale.source,sale.destination,item.via,item.idx FROM Z_WebTradeDirectSale sale, Z_WebTradeDirectSaleItems item WHERE sale.idx = item.sale_idx AND sale.status < '2' AND substring(item.item,7,8) = '{$v}'"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; if ($data[2] == 1) { echo $ItemMessage042 . $data[0] . " ... "; $param['value'] = $data[0]; } else { echo $ItemMessage042 . $data[1] . " ... "; $param['value'] = $data[1]; } $db->Query("DELETE FROM Z_WebTradeDirectSaleItems WHERE idx = '" . $data[3] . "'"); echo "OK!<br />"; flush(); if ($vars['BlockAccs'] == 1) { echo $ItemMessage045 . " ... "; $param['ref'] = "memb___id"; $blockClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } } } @unlink("../DupedItems"); } else { if ($vars['DeleteDup'] == 1) { $handle = fopen("../DupedItems", "r"); while ($data = fgets($handle)) { $DataArray = explode(":", $data); $where = trim($DataArray[0]); $user = trim($DataArray[1]); $serial = trim($DataArray[2]); if ($where == 0) { echo $ItemMessage039 . $user . " ... "; $itemClass->DeleteItemFromGame($db, $serial, $where, $user); echo "OK!<br />"; flush(); } if ($where == 1) { echo $ItemMessage040 . $user . " ... "; $itemClass->DeleteItemFromGame($db, $serial, $where, $user); echo "OK!<br />"; flush(); } if ($where == 2) { echo $ItemMessage041 . $user . " ... "; $db->Query("DELETE FROM Z_WebVault WHERE substring(item,7,8) = '{$serial}' AND memb___id = '{$user}'"); echo "OK!<br />"; flush(); } if ($where == 3) { echo $ItemMessage043 . " ... "; $db->Query("DELETE FROM Z_WebTradeDirectSaleItems WHERE WHERE substring(item,7,8) = '{$serial}' AND sale_idx = '{$user}'"); echo "OK!<br />"; flush(); } } fclose($handle); @unlink("../DupedItems"); } } if ($vars['DeleteDup'] == 0 && $vars['DeleteAll'] == 0 && $vars['BlockAccs'] == 1) { $DupeData = array(); $CountData = array(); $handle = fopen("../DupedItems", "r"); while ($data = fgets($handle)) { $DataArray = explode(":", $data); $serial = trim($DataArray[2]); if (!in_array($serial, $DupeData)) { array_push($DupeData, $serial); $CountData[$serial] = 2; } else { $CountData[$serial]++; } } fclose($handle); foreach ($DupeData as $k => $v) { echo "<hr /><strong>> {$ItemMessage030} {$v} (" . $CountData[$v] . " {$ItemMessage035})</strong><br />"; flush(); $ItemData = array(); $db->Query("SELECT AccountID FROM warehouse WHERE (charindex (0x{$v}, items) %16=4)"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage045 . $data[0] . " ... "; $param['ref'] = "memb___id"; $param['value'] = $data[0]; $blockClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } $ItemData = array(); $db->Query("SELECT Name FROM Character WHERE (charindex (0x{$v}, inventory) %16=4)"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage045 . $data[0] . " ... "; $param['ref'] = "Name"; $param['value'] = $data[0]; $itemClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } $ItemData = array(); $db->Query("SELECT memb___id,idx FROM Z_WebVault WHERE substring(item,7,8) = '{$v}'"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; echo $ItemMessage045 . $data[0] . " ... "; $param['ref'] = "memb___id"; $param['value'] = $data[0]; $itemClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } $ItemData = array(); $db->Query("SELECT sale.source,sale.destination,item.via FROM Z_WebTradeDirectSale sale, Z_WebTradeDirectSaleItems item WHERE sale.idx = item.sale_idx AND sale.status < '2' AND substring(item.item,7,8) = '{$v}'"); while ($data = $db->GetRow()) { array_push($ItemData, $data); } foreach ($ItemData as $k1 => $v1) { $data = $v1; if ($data[2] == 1) { $param['value'] = $data[0]; } else { $param['value'] = $data[1]; } echo $ItemMessage045 . " ... "; $param['ref'] = "memb___id"; $itemClass->BlockUser($db, $param); echo "OK!<br />"; flush(); } } } echo $ItemMessage099; }
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Manager.php"; $db->Disconnect(); exit("{$ManagerMessage01}"); } require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/Blocks.class.php"; $bl = new Blocks($db); switch ($_GET['action']) { default: case "list": echo $bl->BlocksList($db); break; case "block": echo $bl->BlockForm(); break; case "archive": echo $bl->Archive($db); break; case "UnBlock": echo $bl->UnBlock($db, $_POST); break; case "BlockUser": echo $bl->BlockUser($db, $_POST); break; case "EditBlock": echo $bl->EditForm($db, $_GET['idx']); break; case "SaveBlock": echo $bl->SaveBlock($db, $_POST); break; } $db->Disconnect();