Hi,

I'm trying to create a new Jahia user from within a jahia page visible only to the root user.

This is the code I've used:

String name = "harvey";
String password = "harvey";
Properties properties = new Properties();
properties.setProperty("firstname", "Harvey");
properties.setProperty("lastname", "Rabbit");
properties.setProperty("email", "[EMAIL PROTECTED]");
JahiaUserManagerRoutingService userService =
                JahiaUserManagerRoutingService.getInstance();
JahiaUser newUser = userService.createUser(name, password,
                                          name + ":1",
                                          jData.params().getSiteID(),
                                          properties);

No errors are thrown when the page is viewed but newUser is always null.

I've tried several variations on the code (including adding the ":1" to both name and userKey and leaving it off both), but the result is always a null value in the user variable, and no new user appears in the user administration list.

Any suggestions?

cheers
Edd

--
Edd Dawson
Head of Development

MitchellConnerSearson
3-5 High Pavement
The Lace Market
Nottingham  NG1 1HF
Tel +44 (0)115 959 6455
Fax +44 (0)115 959 6456
Direct +44 (0)115 959 6463
www.choosemcs.co.uk <http://www.choosemcs.co.uk/>

Confidentiality: This e-mail and its attachments are intended for the above 
named only and may be confidential. If they have come to you in error you must 
take no action based on them, nor must you copy or show them to anyone; please 
reply to this e-mail and highlight the error.

Security Warning: Please note that this e-mail has been created in the 
knowledge that Internet e-mail is not a 100% secure communications medium. We 
advise that you understand and observe this lack of security when e-mailing us.

Viruses: Although we have taken steps to ensure that this e-mail and 
attachments are free from any virus, we advise that in keeping with good 
computing practice the recipient should ensure they are actually virus free.




Reply via email to