Register Account Information

Hi,

I’m using Openfire server. version: 3.7.0 beta.

and I use the agsxmpp.dll.

When I try to register new account,by using the AutoRegister, set the user name and password - it works fine.

But what I wnat is to use the OnRegisterInformation even in order to fill the register form so I could be able saving the User name and email in the ofUsers table in DB.

So I register to the OnRegisterInformationEvent and got the following iq:

XMPP Client Registration Please provide the following information jabber:iq:register
    <field type="text-single" label="Full name" var="name" />
    <field type="text-single" label="Email" var="email" />
   
    <field type="text-private" label="Password" var="password">
        <required />
    </field>
</x>

Red lines represent the old method which I remove from the answer.

Notice the blue lines: email and name are not required at all.

I wrote the code below, to prepare the form as requested:

  1. I have chnage the type to “Submit”
  2. I didn’t remove the Data tag.
  3. I remove the old fields (username etc.)
  4. I remove all required tags and instead I set valuse as I wanted ( also I did it to the email and name which have not been required).
  5. I remove the title and instruction tags.

Data xData = args.Register.Data;
args.Register.RemoveTag(“username”);
args.Register.RemoveTag(“password”);
args.Register.RemoveTag(“email”);
args.Register.RemoveTag(“name”);

args.Register.RemoveTag(“required”);

xData.Type = XDataFormType.submit;
xData.GetField(“username”).SetValue(un);
xData.GetField(“password”).SetValue(pswd);
xData.GetField(“email”).SetValue(Globals.Email);
xData.GetField(“name”).SetValue(Globals.FirstName + " " + Globals.LastName);

xData.GetField(“username”).RemoveTag(“required”);
xData.GetField(“password”).RemoveTag(“required”);
xData.GetField(“email”).RemoveTag(“required”);
xData.GetField(“name”).RemoveTag(“required”);

xData.RemoveTag(“title”);
xData.RemoveTag(“instructions”);

So I got the following answer as bellow:

jabber:iq:register miki miki mouse miki@disney.com 1234

and I was so sorry to find out that it didn’t work.
the ofUsers table in the DataTable still have null value for the user I just register. Poor Miki .

Can you please help?

Rinat