|
|
|
@ -110,13 +110,11 @@ var userModule = function () {
|
|
|
|
|
* @returns {number} HTTP Status code 201 if succeeded, 409 if user already exists
|
|
|
|
|
*/
|
|
|
|
|
publicMethods.registerUser = function (username, firstname, lastname, emailAddress, password, userRoles) {
|
|
|
|
|
log.info("Register user:::::::::");
|
|
|
|
|
var carbon = require('carbon');
|
|
|
|
|
var tenantId = carbon.server.tenantId();
|
|
|
|
|
var url = carbon.server.address('https') + "/admin/services";
|
|
|
|
|
var server = new carbon.server.Server(url);
|
|
|
|
|
var userManager = new carbon.user.UserManager(server, tenantId);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (userManager.userExists(username)) {
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|