I need a web based auto account
Posted: Sun Sep 24, 2006 12:02 pm
Can someone help me with that please. Thanks.
https://www.forums.polserver.com/
Thanks for your help.use http;
use uo;
program CreateAccount( )
// Make a password check
// The URL should look like this: http://tribulation.sytes.net/pkg/webadm ... sswordHere
// You can replace "YourPasswordHere" with a function to get a password from a config file if you like
if ( QueryParam( "admin" ) != "YourPasswordHere" )
// More bark than bite
print( "Warning: Unauthorized account creation attempt." );
WriteHeader( );
WriteHtml( "Warning: Your IP has been logged and the Admin has been notified!");
WriteFooter( );
return;
endif
// Setup the variables
var name := QueryParam( "name" );
var pass := QueryParam( "pass" );
var email := QueryParam( "email" );
var lbr := QueryParam( "LBR" );
WriteHeader( );
// Check to see that we have all three fields
if( !name or !pass or !email )
WriteHtml( "Error: The name, password or e-mail address field was blank.<br>\n" );
WriteFooter( );
return;
endif
// Do a little illegal character checking
while ( name["+"] )
name["+"] := " ";
endwhile
while ( pass["+"] )
pass["+"] := " ";
endwhile
while ( email["+"] )
email["+"] := " ";
endwhile
// Create the account & set e-mail address
var ret := CreateAccount( name, pass, 1 );
ret.setprop( "email", email );
// Uncomment this if you want to see this on the console
//print( "Account: " + name + " created. LBR value: " + lbr );
// Set account as LBR if requested
if ( lbr )
ret.setprop( "LBR", 1 );
endif
if ( ret == error )
WriteHtml( "Error: Account creation failed.<br>\n" );
WriteHtml( "Details: " + ret.errortext + "<br>\n" );
else
WriteHtml( "Account added successfully!" );
endif
WriteFooter( );
endprogram
function WriteHeader( )
WriteHtml( "<html>\n<head>\n<title>Account Creation</title>\n\n<body>\n\n" );
endfunction
function WriteFooter( )
WriteHtml( "\n\n</body>\n</html>" );
endfunction
Code: Select all
if ( QueryParam( "admin" ) != "YourPasswordHere" )
// More bark than bite
print( "Warning: Unauthorized account creation attempt." );
WriteHeader( );
WriteHtml( "Warning: Your IP has been logged and the Admin has been notified!");
WriteFooter( );
return;
endif
Ok for some reason its not creating any accounts why is this?use http;
use uo;
Program Create_Account( )
// Make a password check
// The URL should look like this: http://avenginguo.dnsalias.net:6060/account.html
// You can replace "YourPasswordHere" with a function to get a password from a config file if you like
// Setup the variables
var name := QueryParam( "name" );
var pass := QueryParam( "pass" );
var email := QueryParam( "email" );
WriteHeader( );
// Check to see that we have all three fields
if( !name or !pass or !email )
WriteHtml( "Error: The name, password or e-mail address field was blank.<br>\n" );
WriteFooter( );
return;
endif
// Do a little illegal character checking
while ( name["+"] )
name["+"] := " ";
endwhile
while ( pass["+"] )
pass["+"] := " ";
endwhile
while ( email["+"] )
email["+"] := " ";
endwhile
// Create the account & set e-mail address
var ret := CreateAccount( name, pass, 1 );
ret.setprop( "email", email );
// Uncomment this if you want to see this on the console
//print( "Account: " + name + " created. LBR value: " + lbr );
if ( ret == error )
WriteHtml( "Error: Account creation failed.<br>\n" );
WriteHtml( "Details: " + ret.errortext + "<br>\n" );
else
WriteHtml( "Account added successfully!" );
endif
WriteFooter( );
endprogram
function WriteHeader( )
WriteHtml( "<html>\n<head>\n<title>Account Creation</title>\n\n<body>\n\n" );
endfunction
function WriteFooter( )
WriteHtml( "\n\n</body>\n</html>" );
endfunction
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Avenging Legends Account Creator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {color: #FF0000}
.style6 {color: #999999; font-size: 12px; font-weight: bold; }
.style1 { color: #999999;
font-size: 12px;
}
.style10 {font-size: 12px}
-->
</style>
</head>
<body bgcolor="#151517" text="#FFFFFF" link="#FFFFFF" vlink="#FF0000" alink="#FFFFFF">
<FORM action="http://avenginguo.com:6060/autoaccount.ecl"
method="GET">
<p align="left"><font color="#FFFFFF" size="2" face="Verdana"><span class="style4">*<span class="style6">Apply for an account</span> </span></font></p>
<div align="center">
<table width="360" border="0" align="center" cellpadding="0" cellspacing="5" bordercolor="#000000">
<tr>
<td width="87"><div align="center"> <span class="style1">Accountname</span></div></td>
<td width="250"><input name=acctname style="HEIGHT: 25px; WIDTH: 250px" size="15" maxlength="15"></td>
</tr>
<tr>
<td><div align="center" class="style10">
<font color="#FFFFFF"><span class="style1">Password</span></font></div></td>
<td><input name=acctpass type="password" style="HEIGHT: 25px; WIDTH: 250px" size="15" maxlength="15"></td>
</tr>
<tr>
<td width="87"><div align="center"> <span class="style1">Email</span></div></td>
<td width="250"><input name=acctname style="HEIGHT: 25px; WIDTH: 250px" size="30" maxlength="30"></td>
</tr>
<tr>
<td height="26" colspan="2"><div align="center">
<input id=reset12 name=reset1 type=reset value=Cancel>
<strong></strong> <strong></strong>
<input id=submit12 name=submit1 type=submit value='Create'>
</div></td>
</tr>
</table>
<font face="Verdana"></font></div>
<p align="center" class="style1" font color="#FFFFFF" size="2" face="Verdana"></p>
<p align="center" class="style1"></a></strong></font>
</div>
Remember that the password and login will be stored on the Server!<br>
Also remember to change your email ingame, in case you shuld lose you accinfo to recover it! (.email) </p>
<p align="center" class="style1">You can login direct after creating the account! <br>
<br>
Also remember to read the rules before logging in on Avenging Legends, Developer Avenging Angel. </p>
</FORM>
</body>
</html>
use uo;
use os;
use http;
include ":accounts:accounts";
include ":accounts:settings";
/* NOTES:
*
* Expects a URL string with info for the following
* username=username (string)
* password=password (string)
* cmdlevel=default command level (integer)
* expansion=expansion (string)
* email=email ( string)
* adminpw=creation password (string) - if set in settings.cfg
*
* Example:
* ?username=Bob&password=Beer&cmdlevel=3&expansion=AOS&email=Bob@beer.org&adminpw=DistroR0x
*
*/
program HTTPScript()
var settings := ACCT_GetSettingsCfgElem("Settings");
if ( !settings.AllowWWWAccounts )
WriteHTMLRaw("Error: Web account maker is disabled.");
return 0;
endif
var username := QueryParam("username");
var password := QueryParam("password");
var cmd_lvl := QueryParam("cmdlevel");
var expansion := QueryParam("expansion");
var email := QueryParam("email");
var admin_pw := QueryParam("adminpw");
if ( settings.AuxWebPassword )
if ( settings.AuxWebPassword != admin_pw )
WriteHTMLRaw("Error: Invalid administration password.");
return 0;
endif
endif
var result := CreateNewAccount(username, password, cmd_lvl, expansion, email);
if ( result.errortext )
WriteHTMLRaw("Error: "+result.errortext);
else
WriteHTMLRaw("Success: The acount was created successfully.");
endif
return
endprogram