Add more fields to user registration

i am trying to register a new user over openfire , so far i am able to register it over server but i want to add some more fields like phone , address in the user registration form

as of now there is only a provision of setting username , fullname , password and email at the time of registering a user over server

but i want to add more fields , how can i do that ?

i tried followin code , but i dont know how to sent **fromToSend **to the server as a packet or something ?

Form formToSend = new Form(Form.TYPE_FORM);

FormField username = new FormField(“username”);

username.setType(FormField.TYPE_TEXT_SINGLE);

formToSend.addField(username);

FormField name = new FormField(“name”);

name.setType(FormField.TYPE_TEXT_SINGLE);

formToSend.addField(name);

FormField password = new FormField(“password”);

password.setType(FormField.TYPE_TEXT_PRIVATE);

formToSend.addField(password);

FormField email = new FormField(“email”);

name.setType(FormField.TYPE_TEXT_SINGLE);

formToSend.addField(email);

FormField phone = new FormField(“phone”);

phone.setType(FormField.TYPE_TEXT_SINGLE);

formToSend.addField(phone);

i am taking referece of folloing xml stanza

<form_type>

jabber:iq:register

XEP-0077

Standardization of fields related to registration use case.

<field

var=‘username’

type=‘text-single’

label=‘Username’/>

<field

var=‘name’

type=‘text-single’

label=‘Full name’/>

<field

var=‘password’

type=‘text-private’

label=‘Password’/>

<field

var=‘email’

type=‘text-single’

label=‘Email address of the user’/>

<field

var=‘phone’

type=‘text-single’

label=‘Mobile Phone’/>

</form_type>

HI All,

I am with same issue…

How i can add more fields in admin registration process.

I want to fully customise admin panel…

Any help…

Hi All,

Continue with same issue when i added one field “last name” in to registration process from admin side

i got 15 errors .

What i did…

1)I have added one field into createUser() function that is

createUser(String username, String password, String name, String email, String lname)

and for this i made chagnes into

UserManager.java

DefaultUserProvider.java

UserProvider.java

User-create.jsp

but i got error 15 errors

D:\workspace\openfire\src\java\org\jivesoftware\openfire\user\HybridUserProvider .java:135: error: method createUser in interface UserProvider cannot be applied to given types;

[javac] returnvalue = primaryProvider.createUser(username, password, name, email);

same error into other Provider files

My question is if i did some changes into DefaultUserProvider.java then is any need to do same changes

into other provider files…

HI All,

Solved this issue also…

To add new fields in any modules like in Registration or Group module we need to do some customisation

in function…

If any one need this ans in more details i will give steps…

When you found the solution just post it , you dont need to ask for it

Hunt

Yes sure bro…

For this ans i need to explain in very technically way and so it is very difficult to explain me…

As i made lots of changes in function and also in files…

But sure once i get time i will post ans for this detail.

The registration is one thing, and for registration only a few fields are stored in the Openfire database / users table.

You want to populate also the vCard with more information, and this does likely happen as the second step by updating the vCard.

HI LG,

I am not getting what exactly you want to say…

Do you means i dont need to do the chagnes into core files?

The ofUser table in Openfire stores only the username(JID), name and email. They are currently used for registration. One could extend the table and add there more columns like phone etc. So the user could provide more information during registration. Anyhow I think that this information can not me modified later, only password changes are supported.

Other users can not access the contents of the ofUser table, so it is often useless to store there more information. Unless the server admin needs it.

Usually users use the vCard to store the user information, so other users can look it up.

I don’t know what your use case it. Hopefully the vCard is the place to store the user information - otherwise you need to modify Smack and Openfire.

Yes actully we need to fully customise Openfire and Spark…

We want to set user permission and many more fields so we made customisation in files and function.

Any new information on that? Would like to have a field “phone” too. Or is there a way to search users for vCard values?