Re: [Architecture] Issues when using email address as the userName in Appfactory

2014-04-10 Thread Amila Maha Arachchi
There should be only one place where the code should refer to get the username, tenant domain etc.. If there is no such method available in app mgt code, whoever going to fix this, first need to add that method. Then when we come across places where we need to change the code, we should point to

Re: [Architecture] Issues when using email address as the userName in Appfactory

2014-04-10 Thread Asanka Dissanayake
Hi Amila, There are two methods in the manager module, var getTenantAwareUsername = function (username) { if(!username){ username = jagg.getUser(); } var tenantAwareUsername = 'null'; if (username.indexOf(@) != -1) { tenantAwareUsername = username.substring(0,

[Architecture] Issues when using email address as the userName in Appfactory

2014-04-09 Thread Amani Soysa
Hi All, We are changing the current tenant model with a flat hierarchy in the cloud, where we keep the email address as the user name. In this model, the logged in user will be am...@wso2.com@abc.com, where my domain name will be abc.com and user name will be am...@wso2.com This introduce couple

Re: [Architecture] Issues when using email address as the userName in Appfactory

2014-04-09 Thread Amani Soysa
Hi Dilshan What I meant is the following tenantDomain = userName.substring(userName.lastIndexOf('@') + 1); Since we are sure that domain name cannot contain @ taking lastIndexOf is enough and safe rather than writing a regular expression to get the tenant domain .. Is there any reason why

Re: [Architecture] Issues when using email address as the userName in Appfactory

2014-04-09 Thread Udara Liyanage
+1 for using a regex which is more readable and maintaiwnance friendly. Touched, not typed. Erroneous words are a feature, not a typo. ___ Architecture mailing list Architecture@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture