/**
  *	Option: Change Mail
  *	Change the e-mail from account
  *
  *	@return	void
  */
 public function ChangeMail()
 {
     switch ($_GET['do']) {
         case "send_code":
             $currentId = $this->DB->GetCurrentId("CTM_ChangeMail") + 1;
             $dechex = create_function("\$integer", "return str_pad(dechex(\$integer >= 255 ? 255 : \$integer), 2, 0, STR_PAD_LEFT);");
             $confirmCode = $dechex($currentId);
             $confirmCode .= ":" . $dechex(0xbb - strlen($this->userData['memb___id']) + mt_rand(0, 50));
             $confirmCode .= ":" . $dechex(strlen($this->userData['mail_addr']) + mt_rand(0, 50));
             $confirmCode .= ":" . $dechex(mt_rand(0, 70));
             $confirmCode .= ":" . $dechex(mt_rand(71, 170));
             $confirmCode .= ":" . $dechex(0xbb / intval(date("d")) + intval(date("H")) + intval(date("m")) + intval(date("s")) + mt_rand(0, 50));
             $confirmCode .= ":" . $dechex(0xbb / intval(date("m")) + intval(date("H")) + intval(date("m")) + intval(date("s")) + mt_rand(0, 50));
             $confirmCode .= ":" . $dechex(intval(date("Y")) / 0xbb + intval(date("H")) + intval(date("m")) + intval(date("s")) + mt_rand(0, 50));
             $confirmCode = strtoupper($confirmCode);
             $link = gerateFullLink("?/userpanel/changeMail");
             $this->DB->Insert("CTM_ChangeMail", array("Account" => $this->userData['info']['memb___id'], "ConfirmCode" => $confirmCode, "Expiration" => strtotime("+ 24 hours")));
             $this->email->arguments = array("NAME" => htmlEncode($this->userData['info']['memb_name']), "CONFIRM_CODE" => $confirmCode, "SYSTEM_LINK" => $link);
             $this->email->LoadTemplate("ChangeMemberMail");
             $this->email->GetMailContent($mail);
             $this->mailer->AddAddress($this->userData['info']['mail_addr'], $this->userData['info']['memb_name']);
             $this->mailer->SetSubject($mail['subject']);
             $this->mailer->SetBody($mail['content']);
             if ($this->mailer->SendMail() == true) {
                 $this->WriteLog(array("option" => "Change Mail", "data" => array("Process: Send Confirm Code", "Result: Success")));
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['SendCode']['Success'], 3));
             } else {
                 $this->WriteLog(array("option" => "Change Mail", "data" => array("Process: Send Confirm Code", "Result: Error")));
                 $this->lang->setArguments("UserPanel,ChangeMail,Messages,Error_SendMail", CoreVariables::ErrorsCode()->SendMailError);
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['SendCode']['Error_SendMail'], 2));
             }
             break;
         case "process":
             if (empty($_POST['NewMail']) || empty($_POST['ConfirmCode'])) {
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['Void'], 1));
             }
             if (!CTM_Text::CheckMail($_POST['NewMail'])) {
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['MailInvalid'], 2));
             }
             $this->DB->Arguments($_POST['ConfirmCode'], USER_ACCOUNT);
             $findConfirmCodeQ = $this->DB->Select("Expiration", "CTM_ChangeMail", "ConfirmCode = '%s' AND Account = '%s'");
             if ($this->DB->CountRows($findConfirmCodeQ) < 1) {
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['CodeInvalid'], 2));
             }
             $findConfirmCode = $this->DB->FetchRow($findConfirmCodeQ);
             if (time() >= $findConfirmCode[0]) {
                 return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['CodeExpired'], 2));
             }
             $this->MuLib('Member')->UpdateAccount(USER_ACCOUNT, array("info" => array("mail_addr" => $_POST['NewMail'])));
             $this->DB->Arguments(USER_ACCOUNT, $_POST['ConfirmCode']);
             $this->DB->Delete("CTM_ChangeMail", "Account = '%s' AND ConfirmCode = '%s'");
             $this->WriteLog(array("option" => "Change Mail", "data" => array("Process: Change Mail", "New Mail: " . $_POST['NewMail'])));
             return setResult(showMessage($this->lang->words['UserPanel']['ChangeMail']['Messages']['Process']['Success'], 3));
             break;
         default:
             if (loadIsAjax() == true && LOADING_PAGE_AJAX == false) {
                 exit;
             }
             break;
     }
 }
Example #2
0
 /**
  *	Private: Manage Account
  *	Manage a account from database
  *
  *	@return	void
  */
 private function loadManageAccount()
 {
     if ($this->loadCheckAccount($_GET['username'], "login")) {
         $user_data = $this->MuLib('Member')->Load($_GET['username'] = urldecode($_GET['username']));
         switch ($_GET['do']) {
             case "ban":
                 if ($this->CheckPermissionItem("accounts_manageAccount_ban") == true) {
                     if ($_GET['write'] == true) {
                         if (empty($_POST['banReason']) || empty($_POST['banExpiration'])) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['BanAccount']['Messages']['FieldsVoid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 1);
                         } else {
                             $date = explode("/", $_POST['banExpiration']);
                             if (count($date) != 3 || (strlen($date[0]) != 2 || strlen($date[1]) != 2 || strlen($date[2]) != 4)) {
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['BanAccount']['Messages']['DateInvalid'];
                                 $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                             } elseif ($user_data['info']['bloc_code'] == 1 && $user_data['info']['MemberStatus'] == 0) {
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['BanAccount']['Messages']['AccountBanned'];
                                 $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                             } else {
                                 $insert_columns = array("Responsible" => USER_ACCOUNT, "Account" => $_GET['username'], "Expiration" => $expiration = mktime(23, 59, 59, $date[0], $date[1], $date[2]), "Reason" => htmlEncode($_POST['banReason']));
                                 $this->DB->Arguments($_GET['username']);
                                 $this->DB->Delete("CTM_AccountsBanneds", "Account = '%s'");
                                 $this->DB->Arguments($_GET['username']);
                                 $this->DB->Update(MUACC_CORE . "@MEMB_INFO", array("bloc_code" => 1), "memb___id = '%s'");
                                 $this->DB->Insert("CTM_AccountsBanneds", $insert_columns);
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['BanAccount']['Messages']['Success'];
                                 $GLOBALS['result_command'] = adminShowMessage(sprintf($GLOBALS['result_command'], date("d/m/Y", $expiration)), 3);
                             }
                         }
                         if (loadIsAjax() == true) {
                             exit($GLOBALS['result_command']);
                         }
                     }
                     $this->output->setContent("accounts_banAccount");
                 }
                 break;
             case "unban":
                 if ($this->CheckPermissionItem("accounts_manageAccount_unban") == true) {
                     if ($_GET['write'] == true) {
                         if ($user_data['info']['bloc_code'] == 0) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['UnbanAccount']['Messages']['NoBanned'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } else {
                             $this->DB->Arguments($_GET['username']);
                             $this->DB->Delete("CTM_AccountsBanneds", "Account = '%s'");
                             $this->DB->Arguments($_GET['username']);
                             $this->DB->Update(MUACC_CORE . "@MEMB_INFO", array("bloc_code" => 0), "memb___id = '%s'");
                             if (loadIsAjax() == false) {
                                 $_GET['write'] = FALSE;
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['UnbanAccount']['Messages']['Success'];
                                 $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                                 if ($_GET['go'] == "banneds") {
                                     $this->loadBannedAccounts();
                                     $this->output->setContent("accounts_bannedAccounts");
                                 } else {
                                     $this->loadSearchAccounts();
                                     $this->output->setContent("accounts_search");
                                 }
                                 return NULL;
                             }
                         }
                         if (loadIsAjax() == true) {
                             exit($GLOBALS['result_command']);
                         }
                     }
                     if ($user_data['info']['bloc_code'] == 1 && $user_data['info']['MemberStatus'] == 0) {
                         $this->DB->Arguments($_GET['username']);
                         $accountBlockInfoQ = $this->DB->Select("Responsible,Expiration,Reason", "CTM_AccountsBanneds", "Account = '%s'");
                         if ($this->DB->CountRows($accountBlockInfoQ) > 0) {
                             $accountBlockInfo = $this->DB->FetchObject($accountBlockInfoQ);
                             $GLOBALS['block_info']['responsible'] = $accountBlockInfo->Responsible;
                             $GLOBALS['block_info']['expiration'] = date("d/m/Y - H:i", $accountBlockInfo->Expiration);
                             $GLOBALS['block_info']['reason'] = $accountBlockInfo->Reason;
                         } else {
                             $GLOBALS['block_info']['responsible'] = $this->lang->words['Words']['None'];
                             $GLOBALS['block_info']['expiration'] = $this->lang->words['Words']['Never'];
                             $GLOBALS['block_info']['reason'] = $this->lang->words['Words']['None'];
                         }
                     }
                     $this->output->setContent("accounts_unbanAccount");
                 }
                 break;
             case "manageVIP":
                 if ($this->CheckPermissionItem("accounts_manageAccount_manageVIP") == true) {
                     if ($_GET['command'] == "write") {
                         if ($_POST['VIPType'] != 1 && $_POST['VIPType'] != 2 && $_POST['VIPType'] != 3 && $_POST['VIPType'] != 4 && $_POST['VIPType'] != 5) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageVIP']['Messages']['VIPInvalid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                         } else {
                             if (empty($_POST['VIPDays']) || $_POST['VIPDays'] < 0) {
                                 $_POST['VIPDays'] = 0;
                             }
                             $timeVIP = $user_data['vip'][VIP_TIME] + $_POST['VIPDays'];
                             $beginVIP = strlen($user_data['vip'][VIP_BEGIN]) == 10 ? $user_data['vip'][VIP_BEGIN] : time();
                             $commandVIP = "Added";
                             if ($user_data['vip'][VIP_COLUMN] > 0) {
                                 if (strlen($user_data['vip'][VIP_TIME]) == 10) {
                                     $timeVIP = strtotime("+ " . $_POST['VIPDays'] . " days", $user_data['vip'][VIP_TIME]);
                                 }
                                 if ($_POST['VIPDays'] == 0) {
                                     $commandVIP = "Transformed";
                                 } else {
                                     $commandVIP = "Added";
                                 }
                             }
                             $this->DB->Arguments($_POST['VIPType'], $beginVIP, $timeVIP, $_GET['username']);
                             $this->DB->Query("UPDATE " . VIP_CORE . ".dbo." . VIP_TABLE . " SET " . VIP_COLUMN . " = %d, " . VIP_BEGIN . " = %d, " . VIP_TIME . " = %d WHERE " . VIP_LOGIN . " = '%s'");
                             $_timeVIP = $timeVIP;
                             $timeVIP = strlen($timeVIP) == 10 ? $timeVIP : strtotime("+ " . $timeVIP . " days");
                             $result_1 = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageVIP']['Messages']['Success'][$commandVIP];
                             $result_1 = sprintf($result_1, $this->functions->AccountLevel($_POST['VIPType']), $_GET['username']);
                             $result_2 = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageVIP']['Messages']['Success']['Expiration'];
                             $result_2 = sprintf($result_2, date("d/m/Y", $timeVIP), $_POST['VIPDays']);
                             $GLOBALS['result_command'] = "<strong>" . $result_1 . "</strong><br />\n" . $result_2;
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                             if (loadIsAjax() == false) {
                                 $user_data['vip'] = array(VIP_COLUMN => $_POST['VIPType'], VIP_BEGIN => $beginVIP, VIP_TIME => $_timeVIP);
                             }
                         }
                         if (loadIsAjax() == true) {
                             exit($GLOBALS['result_command']);
                         }
                     } elseif ($_GET['command'] == "remove") {
                         self::DB()->Arguments($_GET['username']);
                         self::DB()->Query("UPDATE " . VIP_CORE . ".dbo." . VIP_TABLE . " SET " . VIP_COLUMN . " = 0, " . VIP_BEGIN . " = 0, " . VIP_TIME . " = 0 WHERE " . VIP_LOGIN . " = '%s'");
                         $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageVIP']['Messages']['Success']['Removed'];
                         $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                         if (loadIsAjax() == true) {
                             exit($GLOBALS['result_command']);
                         } else {
                             $user_data['vip'] = array(VIP_COLUMN => 0, VIP_BEGIN => 0, VIP_TIME => 0);
                         }
                     }
                     /*$GLOBALS['vip_info'] = array
                     		(
                     			"type" => $this->functions->AccountLevel($user_data['vip'][VIP_COLUMN]),
                     			"begin" => $this->functions->MakeVIPTime($user_data['vip'][VIP_BEGIN]),
                     			"end" => $this->functions->MakeVIPTime($user_data['vip'][VIP_TIME])
                     		);*/
                     $this->output->setContent("accounts_manageVIP");
                 }
                 break;
             case "manageCoin":
                 if ($this->CheckPermissionItem("accounts_manageAccount_manageCoin") == true) {
                     if ($_GET['command'] == "insert" || $_GET['command'] == "remove") {
                         $_POST['Coin'] = intval($_POST['Coin']);
                         $_POST['Quantity'] = intval($_POST['Quantity']);
                         if (empty($_POST['Quantity'])) {
                             $_POST['Quantity'] = 0;
                         }
                         if ($_POST['Coin'] != 1 && $_POST['Coin'] != 2 && $_POST['Coin'] != 3) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageCoin']['Messages']['CoinInvalid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } else {
                             if ($_GET['command'] == "insert") {
                                 $coin_command = "Insert";
                                 $coin_signal = "+";
                             } elseif ($_GET['command'] == "remove") {
                                 $coin_command = "Remove";
                                 $coin_signal = "-";
                             }
                             $coin_column = $_POST['Coin'];
                             $coin_name = constant("COIN_NAME_" . $_POST['Coin']);
                             if ($user_data['coin'][$coin_column] < $_POST['Quantity'] && $_GET['command'] == "remove") {
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageCoin']['Messages']['NoCoin'];
                                 $GLOBALS['result_command'] = adminShowMessage(sprintf($GLOBALS['result_command'], $coin_name), 2);
                             } else {
                                 $this->DB->Arguments($_GET['username'], $coin_column, $_POST['Quantity'], intval(COIN_USE_CACHE));
                                 $this->DB->Query("EXEC dbo.CTM_PlusAccountCoin '%s', %d, %d, %d");
                                 $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['ManageCoin']['Messages']['Success'][$coin_command];
                                 $GLOBALS['result_command'] = adminShowMessage(sprintf($GLOBALS['result_command'], $_POST['Quantity'], $coin_name), 3);
                             }
                         }
                         if (loadIsAjax() == true) {
                             exit($GLOBALS['result_command']);
                         }
                     }
                     $this->output->setContent("accounts_manageCoin");
                 }
                 break;
             case "disconnect":
                 if ($user_data['stat']['ConnectStat'] < 1) {
                     $message = $this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['UserOffline'];
                     $type = 2;
                 } elseif ($this->MuLib('JoinServer')->ForceLogout($_GET['username'])) {
                     $message = $this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['Success'];
                     $type = 3;
                 } else {
                     $message = sprintf($this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['Error'], 11);
                     $type = 2;
                 }
                 $this->loadSearchAccounts(true, adminShowMessage($message, $type));
                 $this->output->setContent("accounts_search");
                 break;
             default:
                 if ($this->CheckPermissionItem("accounts_manageAccount_edit") == true) {
                     if ($_GET['write'] == "name" && loadIsAjax() == true) {
                         if (empty($_POST['NewName'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangeName']['Messages']['NameVoid'], 1));
                         } elseif (strlen($_POST['NewName']) > 10) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangeName']['Messages']['MaxLength'], 2));
                         } else {
                             $this->DB->Arguments($_GET['username']);
                             $this->DB->Update(MUACC_CORE . "@MEMB_INFO", array("memb_name" => utf8_encode($_POST['NewName'])), "memb___id = '%s'");
                             exit("<script>editAccount_writeSuccess('name', '" . str_replace("'", "\\'", $_POST['NewName']) . "');</script>");
                         }
                     } elseif ($_GET['write'] == "email" && loadIsAjax() == true) {
                         if (empty($_POST['NewMail'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangeMail']['Messages']['MailVoid'], 1));
                         } elseif (!CTM_Text::CheckMail($_POST['NewMail'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangeMail']['Messages']['InvalidMail'], 2));
                         } else {
                             $this->DB->Arguments($_GET['username']);
                             $this->DB->Update(MUACC_CORE . "@MEMB_INFO", array("mail_addr" => $_POST['NewMail']), "memb___id = '%s'");
                             exit("<script>editAccount_writeSuccess('email', '" . str_replace("'", "\\'", $_POST['NewMail']) . "');</script>");
                         }
                     } elseif ($_GET['write'] == "password" && loadIsAjax() == true) {
                         if (empty($_POST['NewPassword'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePassword']['Messages']['PasswordVoid'], 1));
                         } elseif (empty($_POST['ConfirmNewPassword'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePassword']['Messages']['ConfirmPasswordVoid'], 1));
                         } elseif (eregi("[^a-zA-Z0-9_!=?&-]", $_POST['NewPassword'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePassword']['Messages']['CaractersInvalid'], 2));
                         } elseif ($_POST['NewPassword'] != $_POST['ConfirmNewPassword']) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePassword']['Messages']['PasswordError'], 2));
                         } else {
                             $this->MuLib('Member')->ChangePassword($_GET['username'], $_POST['NewPassword']);
                             exit("<script>editAccount_writeSuccess('password');</script>");
                         }
                     } elseif ($_GET['write'] == "pid" && loadIsAjax() == true) {
                         if (empty($_POST['NewPID'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePID']['Messages']['PIDVoid'], 1));
                         } elseif (strlen($_POST['NewPID']) != 7) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePID']['Messages']['ErrorLength'], 2));
                         } elseif (!is_numeric($_POST['NewPID'])) {
                             exit(adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['ChangePID']['Messages']['ErrorCaracters'], 2));
                         } else {
                             $this->DB->Arguments($_GET['username']);
                             $this->DB->Update(MUACC_CORE . "@MEMB_INFO", array("sno__numb" => str_pad($_POST['NewPID'], 13, 1, STR_PAD_LEFT)), "memb___id = '%s'");
                             exit("<script>editAccount_writeSuccess('pid', '" . str_replace("'", "\\'", $_POST['NewPID']) . "');</script>");
                         }
                     } elseif ($_GET['write'] == "save") {
                         if (is_null($_POST['MemberStatus']) || is_null($_POST['AccountLevel']) || empty($_POST['SecureQuestion']) || empty($_POST['SecureAnswer'])) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['FieldsVoid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 1);
                         } elseif (empty($_POST['BirthDay']) || empty($_POST['BirthMonth']) || empty($_POST['BirthYear'])) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['FieldsVoid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 1);
                         } elseif (is_null($_POST['CoinBalance_1']) || is_null($_POST['CoinBalance_2']) && COIN_NUMBER >= 2 || is_null($_POST['CoinBalance_3']) && COIN_NUMBER == 3) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['FieldsVoid'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 1);
                         } elseif ($_POST['AccountLevel'] < 0 || $_POST['AccountLevel'] > VIP_NUMBER) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['ErrorAccountLevel'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } elseif ($_POST['MemberStatus'] != 0 && $_POST['MemberStatus'] != 1) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['ErrorStatus'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } else {
                             $_POST['BirthDay'] = eregi_replace("[^0-9]", NULL, $_POST['BirthDay']);
                             $_POST['BirthMonth'] = eregi_replace("[^0-9]", NULL, $_POST['BirthMonth']);
                             $_POST['BirthYear'] = eregi_replace("[^0-9]", NULL, $_POST['BirthYear']);
                             $save_data = array("info" => array("fpas_ques" => utf8_encode($_POST['SecureQuestion']), "fpas_answ" => utf8_encode($_POST['SecureAnswer']), "MemberBirth" => $_POST['BirthDay'] . "/" . $_POST['BirthMonth'] . "/" . $_POST['BirthYear'], "MemberStatus" => intval($_POST['MemberStatus'])), "vip" => array(VIP_COLUMN => intval($_POST['AccountLevel'])), "coin" => array(COIN_COLUMN_1 => intval($_POST['CoinBalance_1'])));
                             if (COIN_NUMBER >= 2) {
                                 $save_data['coin'][COIN_COLUMN_2] = intval($_POST['CoinBalance_2']);
                                 if (COIN_NUMBER == 3) {
                                     $save_data['coin'][COIN_COLUMN_3] = intval($_POST['CoinBalance_3']);
                                 }
                             }
                             $this->MuLib('Member')->UpdateAccount($_GET['username'], $save_data);
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['Save']['Messages']['Success'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                             $user_data = $this->MuLib('Member')->Load($_GET['username'] = urldecode($_GET['username']));
                         }
                     } elseif ($_GET['write'] == "delete") {
                         if (USER_ACCOUNT == $_GET['username']) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['DeleteAccount']['NoDelSelf'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } elseif (in_array($_GET['username'], $this->settings['ADMINCONTROLPANEL']['SADMIN_ACCOUNTS'])) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['DeleteAccount']['NoDelUser'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } else {
                             $this->MuLib('Member')->DeleteAccount($_GET['username']);
                             $this->loadSearchAccounts(true, adminShowMessage($this->lang->words['Members']['Accounts']['ManageAccount']['EditAccount']['DeleteAccount']['Success'], 3));
                             $this->output->setContent("accounts_search");
                             return NULL;
                         }
                     } elseif ($_GET['command'] == "disconnect") {
                         if ($user_data['stat']['ConnectStat'] < 1) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['UserOffline'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                         } elseif ($this->MuLib('JoinServer')->ForceLogout($_GET['username'])) {
                             $GLOBALS['result_command'] = $this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['Success'];
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 3);
                         } else {
                             $GLOBALS['result_command'] = sprintf($this->lang->words['Members']['Accounts']['ManageAccount']['DisconnectAccount']['Messages']['Error'], 11);
                             $GLOBALS['result_command'] = adminShowMessage($GLOBALS['result_command'], 2);
                             $GLOBALS['result_command'] .= "\r\n<script>\$('#userStatus').html(\"<span style='color: red;'>Offline</span>\");</script>";
                         }
                     }
                     $GLOBALS['account_info'] = array("info" => array("register_date" => $user_data['info']['RegisterDate'], "sex" => utf8_decode($user_data['info']['MemberSex'])), "data" => array("name" => utf8_decode($user_data['info']['memb_name']), "mail" => $user_data['info']['mail_addr'], "pid" => substr($user_data['info']['sno__numb'], 6), "status" => $user_data['info']['MemberStatus'], "account_level" => $user_data['vip'][VIP_COLUMN], "coin_1" => $user_data['coin'][COIN_COLUMN_1], "coin_2" => $user_data['coin'][COIN_COLUMN_2], "coin_3" => $user_data['coin'][COIN_COLUMN_3], "secure_question" => utf8_decode($user_data['info']['fpas_ques']), "secure_answer" => utf8_decode($user_data['info']['fpas_answ']), "birth" => explode("/", $user_data['info']['MemberBirth'])), "stat" => array("server" => $this->functions->GetServerName($user_data['stat']['ServerName']), "ip" => $user_data['stat']['IP'], "date" => date("d/m/Y - h:i a", strtotime($user_data['stat']['ConnectTM'])), "status" => $user_data['stat']['ConnectStat'] > 0));
                     $this->output->setContent("accounts_editAccount");
                 }
                 break;
         }
     }
 }