First of all, I'd like to say thankyou to this community. Without your help I wouldn't have got my shard to where it is today, and it's come a long way (ZHFactions.com).
I still require your help with setting up a website automatic account creator though.
1. Here's the webserver part of my pol.cfg settings:
Code: Select all
#############################################################################
## Integrated Web Server
#############################################################################
#
# WebServer: in multithread mode only, run the internal web server
# This may be a security risk. It's susceptible to DoS attacks.
# If someone knows a little about TCP/IP, they could cause you
# trouble if it's enabled.
#
WebServer=1
#
# WebServerPort: What TCP/IP port to listen for web requests
#
WebServerPort=6060
#
# WebServerLocalOnly: Only allow access from localhost
#
WebServerLocalOnly=0
#
# WebServerDebug: Print trace information about http requests
#
WebServerDebug=1
#
# WebServerPassword: username/password required for access to the web server.
# if not specified, no password is required.
#
# WebServerPassword=2. Also, there seems to be two preset files in my c://shardfiles/scripts/www folder; accounts.htm and webacct.src.
Here is the code for accounts.htm:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ZuluHotel Factions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#FFFFFF" link="#FFFFFF" vlink="#FF0000" alink="#FFFFFF">
<FORM action="webacct.ecl"
method="GET">
<div align="center">
<table width="362" border="2" align="center" cellpadding="0" cellspacing="5" bordercolor="#000000">
<tr>
<td width="87"><div align="center"><font size="1" face="Verdana"><b> <font color="#333333">Account:</font></b></font></div></td>
<td width="252"><font size="1" face="Verdana">
<input name=acctname id="acctname" style="HEIGHT: 25px; WIDTH: 250px">
</font></td>
</tr>
<tr>
<td><div align="center"><font size="1" face="Verdana"><b><font color="#333333"> Password:</font></b></font></div></td>
<td><font size="1" face="Verdana">
<input name=acctpass type="password" id="acctpass" style="HEIGHT: 25px; WIDTH: 250px">
</font></td>
</tr>
<tr>
<td><div align="center"><font size="1" face="Verdana"><b><font color="#333333"> Email:</font></b></font></div></td>
<td><font size="1" face="Verdana">
<input name=acctemail type="email" id="acctemail" style="HEIGHT: 25px; WIDTH: 250px">
</font></td>
</tr>
<tr>
<td height="26" colspan="2"><div align="center">
<font size="1" face="Verdana">
<input id=reset12 name=reset1 type=reset value=Cancel>
<input id=submit12 name=submit1 type=submit value='Create'>
</font></div></td>
</tr>
</table>
</div>
<p align="center" font color="#000000" size="2" face="Verdana"><font size="2" face="Tahoma">loginserver=login.zhchronicles.com,2593</font></p>
<font size="2" face="Tahoma"></a></strong></font>
</div>
</font>
</FORM>
</body>
</html>
Code: Select all
/////////////////
// Web POL Account adder for use with the POL web server
//
// * place webacct.ecl and acctadd.html in the pol/scripts/www directory
// * enable the POL webserver in pol.cfg and set the port for http connections
// * set WebServerLocalOnly=1 to only allow connections from the server
// set it =0 to allow everyone to access the server and the account adder page
// * accounts will be available immediately if successfully added
//
// Notes: I don't know if someone's done something that serves this function
// but I thought I'd do it just for kicks.
//
// Author: Racalac, 2/6/00
/////////////////
use http;
use uo;
use cfgfile;
program account_add()
var hisip := QueryIP();
Var cfg := ReadConfigFile( "accip" );
Var elem := FindConfigElem( cfg, hisip );
if(!elem)
var acctname := QueryParam( "acctname" );
var acctpass := QueryParam( "acctpass" );
var acctemail := QueryParam( "acctemail" );
var account;
writehtml("<html><head><title><font color=#333333>ZuluHotel Factions Account Creator</font></title></head><body>");
writehtml("<FONT SIZE=4 color=#333333><B>ZuluHotel Factions Account Creator</B></FONT><HR>");
if( !acctname or !acctpass or !acctemail )
writehtml("Accountname, Password or Email was left empty. Please go back and try again");
else
while (acctname["+"])
acctname["+"] := " ";
endwhile
while (acctpass["+"])
acctpass["+"] := " ";
endwhile
while (acctemail["+"])
acctemail["+"] := " ";
endwhile
var ret := CreateAccount( acctname, acctpass, 1 );
if( ret == error )
writehtml("Sorry, account creation failed.<P>");
writehtml("Error: " + ret.errortext );
else
Var rcfg := ReadConfigFile( "accip" );
Var elems := array;
AppendConfigFileElem( "accip" , "IP" , hisip , elems );
UnloadConfigFile( "accip" );
account := FindAccount(acctname);
account.setprop("Email", acctemail);
writehtml("<font color=#333333>Account added successfully.</font>");
endif
endif
else
writehtml("You have already created an account on that IP, please contact an Admin or Developer for another account!");
endif
endprogramI am told by a scripter friend that if I go to the URL http://93.174.138.23;6060/accounts.htm (note: 93.174.138.23 is my server's static IP) then I should be able to see accounts.htm, but I cannot, the request times out.
When I open accounts.htm just from my server's hard drive, I can enter the username/password/email fields, but when I click to 'create' the account, it asks me to save webacct.ecl instead of perhaps running the file or something, I'm not sure what it's supposed to do.
Any help appreciated, thanks.