Exemple #1
0
function dodel_user()
{
    global $lang_global, $lang_user, $output, $realm_db, $characters_db, $realm_id, $user_lvl, $tab_del_user_characters, $tab_del_user_realmd, $action_permission;
    valid_login($action_permission['delete']);
    $sqlr = new SQL();
    $sqlr->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    if (isset($_GET['check'])) {
        $check = $sqlr->quote_smart($_GET['check']);
    } else {
        redirect("user.php?error=1");
    }
    $deleted_acc = 0;
    $deleted_chars = 0;
    require_once "libs/del_lib.php";
    for ($i = 0; $i < count($check); $i++) {
        if ($check[$i] != "") {
            list($flag, $del_char) = del_acc($check[$i]);
            if ($flag) {
                $deleted_acc++;
                $deleted_chars += $del_char;
            }
        }
    }
    $output .= "\r\n        <center>";
    if ($deleted_acc == 0) {
        $output .= "\r\n          <h1><font class=\"error\">{$lang_user['no_acc_deleted']}</font></h1>";
    } else {
        $output .= "\r\n          <h1><font class=\"error\">{$lang_user['total']} <font color=blue>{$deleted_acc}</font> {$lang_user['acc_deleted']}</font><br /></h1>";
        $output .= "\r\n          <h1><font class=\"error\">{$lang_user['total']} <font color=blue>{$deleted_chars}</font> {$lang_user['char_deleted']}</font></h1>";
    }
    $output .= "\r\n          <br /><br />";
    $output .= "\r\n          <table class=\"hidden\">\r\n            <tr>\r\n              <td>";
    makebutton($lang_user['back_browsing'], "user.php", 230);
    $output .= "\r\n              </td>\r\n            </tr>\r\n          </table>\r\n          <br />\r\n        </center>\r\n";
}
Exemple #2
0
function docleanup()
{
    global $lang_cleanup, $lang_global, $output, $realm_db, $characters_db, $realm_id, $user_lvl, $tab_del_user_characters, $tab_del_user_characters_trinity, $tab_del_user_realmd;
    if ($server_type) {
        $tab_del_user_characters = $tab_del_user_characters_trinity;
    }
    if (!isset($_POST['type']) || $_POST['type'] === '') {
        redirect("cleanup.php?error=1");
    }
    $sql = new SQL();
    $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    $type = $sql->quote_smart($_POST['type']);
    if (isset($_POST['check']) && $_POST['check'] != '') {
        $check = $sql->quote_smart($_POST['check']);
        $check = explode('-', $check);
    } else {
        redirect("cleanup.php?error=1");
    }
    $deleted_acc = 0;
    $deleted_chars = 0;
    $deleted_gulds = 0;
    require_once "./libs/del_lib.php";
    switch ($type) {
        //we deleting account array
        case "acc":
            for ($i = 1; $i < count($check); $i++) {
                if ($check[$i] != "") {
                    list($flag, $del_char) = del_acc($check[$i]);
                    if ($flag) {
                        $deleted_acc++;
                        $deleted_chars += $del_char;
                    }
                }
            }
            break;
            //we deleting character array
        //we deleting character array
        case "char":
            for ($i = 1; $i < count($check); $i++) {
                if ($check[$i] != "") {
                    if (del_char($check[$i], $realm_id)) {
                        $deleted_chars++;
                    }
                }
            }
            break;
            //cleaning guilds
        //cleaning guilds
        case "guild":
            for ($i = 1; $i < count($check); $i++) {
                if ($check[$i] != "") {
                    if (del_guild($check[$i], $realm_id)) {
                        $deleted_gulds++;
                    }
                }
            }
            break;
            //cleaning arena teams
        //cleaning arena teams
        case "arenateam":
            for ($i = 1; $i < count($check); $i++) {
                if ($check[$i] != "") {
                    if (del_arenateam($check[$i], $realm_id)) {
                        $deleted_arenateams++;
                    }
                }
            }
            break;
        default:
            redirect("cleanup.php?error=1");
    }
    $sql->close();
    unset($sql);
    $output .= "<center>";
    if ($type == "guild") {
        if (!$deleted_gulds) {
            $output .= "<h1><font class=\"error\">{$lang_cleanup['no_guilds_del']}</font></h1>";
        } else {
            $output .= "<h1><font class=\"error\">{$lang_cleanup['total']} <font color=blue>{$deleted_gulds}</font> {$lang_cleanup['guilds_deleted']}</font></h1>";
        }
    } else {
        if ($type == "arenateam") {
            if (!$deleted_arenateams) {
                $output .= "<h1><font class=\"error\">{$lang_cleanup['no_arenateams_del']}</font></h1>";
            } else {
                $output .= "<h1><font class=\"error\">{$lang_cleanup['total']} <font color=blue>{$deleted_arenateams}</font> {$lang_cleanup['arenateams_deleted']}</font></h1>";
            }
        } else {
            if ($deleted_acc + $deleted_chars == 0) {
                $output .= "<h1><font class=\"error\">{$lang_cleanup['no_acc_chars_deleted']}</font></h1>";
            } else {
                $output .= "<h1><font class=\"error\">{$lang_cleanup['total']} <font color=blue>{$deleted_acc}</font> {$lang_cleanup['accs_deleted']}</font></h1><br />";
                $output .= "<h1><font class=\"error\">{$lang_cleanup['total']} <font color=blue>{$deleted_chars}</font> {$lang_cleanup['chars_deleted']}</font></h1>";
            }
        }
    }
    $output .= "<br /><br />";
    $output .= "<table class=\"hidden\">\r\n          <tr><td>";
    makebutton($lang_cleanup['back_cleaning'], "cleanup.php", 200);
    $output .= "</td></tr>\r\n        </table><br /></center>";
}
            } else {
                $error = "Password does not match Confirm Password.";
            }
        } else {
            $error = "Field is left blank.";
        }
    } else {
        $error = "You do not have permission to add users!";
    }
}
if (isset($_POST['deluser'])) {
    if (check_permission("Users", "delete_users")) {
        $message = "";
        if (!empty($_POST['accounts'])) {
            foreach ($_POST['accounts'] as $account) {
                if (del_acc($account) == true) {
                    $success = "Accounts were deleted!";
                } else {
                    $error = "Cannot delete only webmaster account left.";
                }
            }
        } else {
            $error = "No accounts selected.";
        }
    } else {
        $error = "You do not have permission to delete users!";
    }
}
if (isset($_POST['upd_ranks'])) {
    if (check_permission("Users", "add_users")) {
        $message = "";
function dodel_user(&$sqlr, &$sqlc)
{
    global $lang_global, $lang_user, $output, $realm_id, $user_lvl, $tab_del_user_characters, $tab_del_user_realmd, $action_permission;
    valid_login($action_permission['delete']);
    if (isset($_GET['check'])) {
        $check = $sqlr->quote_smart($_GET['check']);
    } else {
        redirect('accounts.php?error=1');
    }
    $deleted_acc = 0;
    $deleted_chars = 0;
    require_once 'libs/del_lib.php';
    $n_check = count($check);
    for ($i = 0; $i < $n_check; ++$i) {
        if ($check[$i] != "") {
            list($flag, $del_char) = del_acc($check[$i]);
            if ($flag) {
                $deleted_acc++;
                $deleted_chars += $del_char;
            }
        }
    }
    unset($n_check);
    unset($check);
    $output .= '
<center>
<table class="lined">
	<tr>
		<td>';
    if ($deleted_acc == 0) {
        $output .= '
			<h1>
				<font class="error">' . $lang_user['no_acc_deleted'] . '</font>
			</h1>';
    } else {
        $output .= '
			<h1>
				<font class="error">
					' . $lang_user['total'] . '
					<font color=blue>' . $deleted_acc . '</font>
					' . $lang_user['acc_deleted'] . '
				</font><br />
			</h1>';
        $output .= '
			<h1>
				<font class="error">
					' . $lang_user['total'] . '
					<font color=blue>' . $deleted_chars . '</font>
					' . $lang_user['char_deleted'] . '</font>
				</h1>';
    }
    unset($deleted_acc);
    unset($deleted_chars);
    $output .= '
			<br /><br />
		</td>
	</tr>
</table>';
    $output .= '
<table width="300" class="hidden" align="center">
	<tr>
		<td>';
    makebutton($lang_user['back_browsing'], 'accounts.php', 230);
    $output .= '
		</td>
	</tr>
</table>
<br />
</center>';
}
Exemple #5
0
function dodel_user()
{
    global $output, $logon_db, $characters_db, $realm_id, $user_lvl, $tab_del_user_characters, $tab_del_user_realmd, $action_permission, $sql;
    valid_login($action_permission["delete"]);
    if (isset($_GET["check"])) {
        $check = $sql["logon"]->quote_smart($_GET["check"]);
    } else {
        redirect("user.php?error=1");
    }
    $deleted_acc = 0;
    $deleted_chars = 0;
    require_once "libs/del_lib.php";
    for ($i = 0; $i < count($check); $i++) {
        if ($check[$i] != "") {
            list($flag, $del_char) = del_acc($check[$i]);
            if ($flag) {
                $deleted_acc++;
                $deleted_chars += $del_char;
            }
        }
    }
    $output .= '
        <div class="center">';
    if ($deleted_acc == 0) {
        $output .= '
          <h1><font class="error">' . lang("user", "no_acc_deleted") . '</font></h1>';
    } else {
        $output .= '
          <h1><font class="error">' . lang("user", "total") . ' <font color=blue>' . $deleted_acc . '</font> ' . lang("user", "acc_deleted") . '</font><br /></h1>';
        $output .= '
          <h1><font class="error">' . lang("user", "total") . ' <font color=blue>' . $deleted_chars . '</font> ' . lang("user", "char_deleted") . '</font></h1>';
    }
    $output .= '
          <br />
          <br />
          <table class="hidden">
            <tr>
              <td>';
    makebutton(lang("user", "back_browsing"), "user.php", 230);
    $output .= '
              </td>
            </tr>
          </table>
          <br />
        </div>';
}