- Joined
- Apr 13, 2010
- Messages
- 325
- Reaction score
- 25
Може ли някой да едитне този скрипт за Disconnect да работи на Open MU Web Clone .
БЛАГОДАРЯ ПРЕДВАРИТЕЛНО !
БЛАГОДАРЯ ПРЕДВАРИТЕЛНО !
PHP:
<script language="JavaScript" type="text/JavaScript">
//<![CDATA[
function validate(form)
{
if (form.acc.value =="") {
form.acc.focus();
alert("<? echo text_enter_account; ?>.");
return false;
}
var filter = /^([a-zA-Z0-9\-\_])+$/;
if (!filter.test(form.acc.value)) {
form.acc.focus();
alert('<? echo text_invalid_account; ?>.');
return false;
}
if (form.acc.value.length<4) {
form.acc.focus();
alert("<? echo text_notlongenough_account; ?>.");
return false;
}
if (form.pass.value =="" ) {
form.pass.focus();
alert("<? echo text_enter_password; ?>.");
return false;
}
var filter = /^([a-zA-Z0-9\-\_])+$/;
if (!filter.test(form.pass.value)) {
form.pass.focus();
alert('<? echo text_invalid_password; ?>.');
return false;
}
if (form.pass.value.length<4) {
form.pass.focus();
alert("<? echo text_notlongenough_password; ?>.");
return false;
}
}
</script>
<table width="331" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<form action="" method="post" name="fixacc" id="fixacc">
<table align="center" width="340" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="right" class="normal_text_white"><? echo text_account; ?></div></td>
<td colspan="4"><div align="left">
<input name="acc" type="text" class=input id="acc" size="14" maxlength="10" value="">
</div></td>
</tr>
<tr>
<td><div align="right" class="normal_text_white"><? echo text_password; ?></div></td>
<td colspan="4"><div align="left">
<input name="pass" type="password" class=input id="pass" size="14" maxlength="10" value="">
</div></td>
</tr>
</table>
<table align="center">
<tr><td><label>
<INPUT type="hidden" value="1" name="fix_account">
<input type="submit" name="submit" value="Fix Account" class="button" onClick="return validate(document.fixacc);">
</label></td></tr>
</FORM> </div></td>
</tr>
</table>
<?php
If(isset($_POST['fix_account'])){
include("config.php");
$acc=clean_var($_POST[acc]);
$pass=clean_var($_POST[pass]);
if($devilmu['md5'] == 0){
$query3=mssql_num_rows(mssql_query("select memb___id from memb_info where memb___id='$acc' and memb__pwd='$pass'"));
}
if($devilmu['md5'] == 1){
$query3=mssql_num_rows(mssql_query("select memb___id from memb_info where memb___id='$acc' and memb__pwd=[dbo].[fn_md5]('$pass','$acc')"));
}
if($query3 < 1){$error=1;
show_error("".text_wrong_acc_pass."."); }
If($error!=1){
function ascii2hex($ascii) {
$hex = '';
for ($i = 0; $i < strlen($ascii); $i++) {
$byte = strtoupper(dechex(ord($ascii{$i})));
$byte = str_repeat('0', 2 - strlen($byte)).$byte;
$hex.=$byte." ";
}
$hex=str_replace(" ", "", $hex);
return $hex;
}
function hex2ascii($hex){
$ascii='';
$hex=str_replace(" ", "", $hex);
for($i=0; $i<strlen($hex); $i=$i+2) {
$ascii.=chr(hexdec(substr($hex, $i, 2)));
}
return($ascii);
}
function dc_user($host, $port, $acc){
$mystring = "C11405";
$mystring .= ascii2hex($acc);
$zeros = strlen($mystring);
for ($i;$i<=39-$zeros;$i++){
$mystring .="0";
}
$packet = hex2ascii($mystring);
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (!$x = @socket_connect($socket, $host, $port))
{
show_error("Server is Offline");
}
else{
socket_write($socket, $packet, strlen($packet));
socket_close($socket);
show_ok("Your account is fixed. You can connect approximately in 10 seconds.");
}
}
dc_user("127.0.0.1", "55432", $acc);
}
}
?>
</table>