Im trying to add new informations to the account when is created.
i make a c# request to this link:
var request = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:5002/webacct.ecl?user=" + user + "&pass="+pass+"&pass2=" + pass2 + "&email=" + email + "&uobase=" + cmd.usuario);
the request work and the account as created, but the CPROP dont be set, take a look on code below.
webacct.src
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
// Updated by: Edwards 8/12/07
/////////////////
use http;
use uo;
const MIN_CHARACTERS_FOR_ACCOUNT_NAME := 4;
const MAX_CHARACTERS_FOR_ACCOUNT_NAME := 10;
const MIN_CHARACTERS_FOR_PASSWORD := 4;
const MAX_CHARACTERS_FOR_PASSWORD := 10;
program account_add()
var account_name := QueryParam("user");
var password1 := QueryParam("pass");
var password2 := QueryParam("pass2");
var email_adress := QueryParam("email");
var uobase := QueryParam("uobase");
// writehtml("<html><head><title>Account Adder</title></head><body>");
// writehtml("<FONT SIZE=4><B>Account Adder</B></FONT><HR>");
if( TypeOf(account_name) != "String" || account_name == "" )
WriteHtml("<fail>Error: Login inválido.</fail>");
elseif( TypeOf(password1) != "String" || password1 == "" )
WriteHtml("<fail>Error: Senha inválida.</fail>");
elseif( TypeOf(password2) != "String" || password2 == "" )
WriteHtml("<fail>Error: Senha inválida.</fail>");
elseif( TypeOf(email_adress) != "String" || email_adress == "" )
WriteHtml("<fail>Error: Email inválido</fail>");
elseif( len(account_name) < MIN_CHARACTERS_FOR_ACCOUNT_NAME )
WriteHtml("<fail>Error: Login muito curto, mínimo 4 caracteres.</fail>");
elseif( len(account_name) > MAX_CHARACTERS_FOR_ACCOUNT_NAME )
WriteHtml("<fail>Error: Login muito longo, máximo 10 caracteres.</fail>");
elseif( len(password1) < MIN_CHARACTERS_FOR_PASSWORD )
WriteHtml("<fail>Error: Senha muito curta, mínimo 4 caracteres.</fail>");
elseif( len(password1) > MAX_CHARACTERS_FOR_PASSWORD )
WriteHtml("<fail>Error: Senha muito longa, máximo 10 caracteres.</fail>");
elseif( password1 != password2 )
WriteHtml("<fail>Error: As senhas não conferem.</fail>");
elseif( password1 == account_name )
WriteHtml("<fail>Error: Login e senha iguais, não utilize o login como a senha.</fail>");
else
var account := CreateAccount(account_name, password1, 1 );
if( !account )
case( account.errortext )
"Account already exists":
WriteHtml("<fail>Error: Este login já está em uso.</fail>");
default:
WriteHtml("<fail>Error: Este login já está em uso.</fail>");
endcase
else
account.setProp("Email", email_adress);
account.setProp("UOBASE", uobase);
WriteHtml("<success>Cadastrado com sucesso!</success>");
endif
endif
endprogram
account.setProp("Email", email_adress);
account.setProp("UOBASE", uobase);
both define data on user account but the cprop UOBASE dont be defined.
im newbie with a dream