I need a web based auto account
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
I need a web based auto account
Can someone help me with that please. Thanks.
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
Here is the script i found here I need to know why it dont work
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
well, theres more to the address than what the author put and I'm not sure what type of system the author developed it for since if a player does this, they would see the Admin Password in the address bar. So heres how I would do it but I dont know what security options you want and such in terms of limiting how many accounts someone can actually create...
If you dont have a specific need to have an admin password, Remove
then I would create a simple webpage form that asks for the username, password, and email address. Then when they hit submit, it will go to (replace parentheses with whats needed of course)
http://(server IP:Port)/(script).ecl?name=(username)&pass=(password)&email=(email)
as for the LBR prop, if your shard uses the "LBR" account prop, then append to the address (without quotes) "&LBR=(LBR value)", otherwise, you can remove
var lbr := QueryParam( "LBR" );
and
// Set account as LBR if requested
if ( lbr )
ret.setprop( "LBR", 1 );
endif
If you dont have a specific need to have an admin password, Remove
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
http://(server IP:Port)/(script).ecl?name=(username)&pass=(password)&email=(email)
as for the LBR prop, if your shard uses the "LBR" account prop, then append to the address (without quotes) "&LBR=(LBR value)", otherwise, you can remove
var lbr := QueryParam( "LBR" );
and
// Set account as LBR if requested
if ( lbr )
ret.setprop( "LBR", 1 );
endif
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
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
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
<FORM action="http://avenginguo.com:6060/autoaccount.ecl"
method="GET">
method="GET">
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
here is the html code i am using
<!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>
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
ok... like if I entered in the form
Username: CWO
Password: testpass
Email: Testing@testing.com
the address should look like this...
autoaccount.ecl?name=CWO&pass=testpass&email=Testing@testing.com
Username: CWO
Password: testpass
Email: Testing@testing.com
the address should look like this...
autoaccount.ecl?name=CWO&pass=testpass&email=Testing@testing.com
Last edited by CWO on Tue Sep 26, 2006 7:39 pm, edited 1 time in total.
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
http://avenginguo.com:6060/autoaccount. ... it1=Create
when I hit submit it has this link. So whats wrong?
when I hit submit it has this link. So whats wrong?
Basically in the webpage address after .ecl you put the question mark. This means that there are variables being declared after it. Now the syntax for declaring a variable is
varname=value
and they are seperated by
&
so the variables are declared and given their values in the address. The script now needs to receive these variables from the address and set them to EScript variables for use within the script. This is what
var name := QueryParam( "name" );
is for. It looks for
name=...
in the address. Thats how they are translated from the address into the script so whats in the address must match what QueryParam is looking for.
varname=value
and they are seperated by
&
so the variables are declared and given their values in the address. The script now needs to receive these variables from the address and set them to EScript variables for use within the script. This is what
var name := QueryParam( "name" );
is for. It looks for
name=...
in the address. Thats how they are translated from the address into the script so whats in the address must match what QueryParam is looking for.
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
Not sure how useful this will be.. but there is an accounts package in the distro that has various account creation methods in it that you can learn from.
http://svn.sourceforge.net/viewvc/pol-d ... iew=markup
http://svn.sourceforge.net/viewvc/pol-d ... iew=markup
-
Avenging Angel
- Neophyte Poster
- Posts: 33
- Joined: Sat Aug 19, 2006 12:47 pm
i am using this script now but it wont compile why?
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