Jump to content

Mariano

Members
  • Posts

    23
  • Joined

  • Last visited

About Mariano

  • Birthday 01/17/1985

Profile Information

  • Gender
    Male
  • Location
    Argentina

Mariano's Achievements

  1. Hello, I wanted to share what i did to the souce code of the core to get some advice if there something can go wrong (the logic works, but in case I am missing something) and if there could be a better way to implement it or some idea so I don't need to change/check so much files after updates. It is for multi-company. The goal of the changes is that: a staff member, a client of company A and a client of a company B can use (or not) the same username (is not the same account, just the same username, these are independent users). What i did: Step 1: split the Users model functions in two, same logic, only changes the filter: getByUsername -> getByUsernameOnlyClient / getByUsernameOnlyStaff -> It filters only users in one company (current) that are client / filters only users that are staff validateUniqueUser -> validateUniqueUserOnlyClient and validateUniqueUserOnlyStaff -> Same as before Step 2: split the rest of the Users model functions in two as before (validateUser, add, getRules, ...), to use the new previous functions (same logic, only changed wich function is called). Step 3: updated all the controllers to use the "OnlyClient" functions when is a client action (login, register, recovery, create, update, ...) and "OnlyStaff" functions when is a staff action. Step 4: removed the username unique key in the database. I tried to keep the old functions and not just edit these ones to keep better track of changes. Any idea or recommendation is welcome. Thank you in advance, regards.
  2. Hello Paul, thank you for the reply. The problem about it is that CORE-3942 is too big compared with my topic. Plus to it the multi-company part is potential, is not the main subject of these task. The only issue i see is what i was trying to explain: if i have 2 (or more) companies (supposed to be diferent business units, is why there are separated systems, if they werent i would use only 1 company) and using email as username (customers uses email for login, as they do now) a pontential customer can only signup in 1 company using it's email. Additionally it can cause confusion as to why he can't use his own email account or recovery his access (because it tells him it's already in use) if he never signed up for that service before (in the other businesses after the 1st in which it is registered). My stuff is not about sharing login or similar, managing multiple accounts, same credentials for diferent companies, is just what I try to remark. Except it fixes the issue. I think customers credentials should be associated with a single company, so the username user1 (or the username email1@example.com) could exist in more than one company or not, each one with its password, regardless of who uses it, and not be related to each other, be independent. Because from their point of view, they are separate services (or companies, or businesses). In short, limit the availability of usernames, and access in each company independently. If this is what we are talking about, of course i would consider sponsoring it (I should see how that works). But if this is not what we are talking about it is not going to solve the problem I see. For me it is the bug of the multi-company system and maybe nobody uses it or found it but it works how I say now and I think is not ok. Anyway, I do not demand this. Maybe at some point the team can see it and agree . Thank you again, regards!
  3. Hello, I was just visting here after 1 year from the last visit and wondering if there is some plan to fix the username problem betwen companies in multi-company. Maybe one day i will be able to start using Blesta and use the licenses I got ? Regards!
  4. I think these is the correct way to do this. Regards.
  5. Thank you Paul. I missed that task, i always was searching "user" in the task title. Looks good. Lets see if it can help fix this problem when is implemented. Regards.
  6. Hello, I open this thread to see if after 2.5 years there are some plans to solve this. The scenary: - I have Blesta multi-company with 2 companies: "Company A" and "Company B". There are diferent brands that offers diferent services. - Both companies have set "use email as username". - John wants a service that is offered by "Company A". - John, register in "Company A" using his email, "john@example.com". He starts using his services. - Then John, finds a service he likes in "Company B". - So John, try to register in "Company B" to buy the service using his email, "john@example.com". - The register system of "Company B" says to John that can't use that email, because it is in use. - So, John thinks: ohh, maybe I have an account in "Company B", so I will try to restore my password for login. - Then John discovers he can't restore his password, he can't use his email, he dont understand why because it is his email and is confused. Sorry for the imaginary story, I try to explain the problem in the most clear way possible for me. No plans to do something about it? I never was able to finish implementing Blesta because of this. I the real life we have situations like this. I want to start using it, but with this i am not sure we can. Is the only thing I see as a problem, in multi-company. If they are diferent companies, users must be able to use his emails in any of them. I hope is clear my situation and I hope someone can see this problem too! Thank you, regards!
  7. Thank you for your reply. Useful tips. I thought that too. I will go for dedicated modules. Regards.
  8. Hello, I wanted to know what are your toughts in a situation like mine. I am having a few web apps (SaaS) and the subscription is managed from Blesta. I have only 1 set right now, and I manage packages and actions (create, upgrade, suspend) from Blesta using Universal Module (that calls a bridge in the application server). I am going to add the other apps to Blesta but i have a doubt. Which one is a best practice for this? Add all the applications to the Universal Module or create a custom module for each application? In terms of flexibility in the future, better organization, prevent future problems, etc. What are your thoughts about it? Another detail, is that probably (if at some point some stuff in the multi-company functionality changes) I would split the apps in diferent companies, and the universal module is too attached to the company for what i see. Thank you, regards.
  9. It is not working on my side. Maybe do you have some additional plugin installed (like the blesta-addons one)? Please consider it. I bet it is easy to implement ?. I correct my first message, i see an error now. Where i said: "currency=Spanish&currency=3", I meant: "language=Spanish&currency=3" Regards.
  10. Hello, thank you. I have searched in forums, all posts i have seen send OPs to the blesta addons plugin. I was seraching if there is some included feature or some tip about how to implement this because that part of code isn't unencrypted (to check how combobox that change that works). If there is some post that has a closer solution I will be glad if you point it! Thank you, i have seen your modules. But i don't understand at 100% the subscription model and is not compatible with multi-company (you need a suscription for every company). So for now is not an option to me at this moment. Maybe in the near future! Regards!
  11. Hello, i wanted to see if there is some way to set the language and currency in the URL (GET parameter). Right now, I have a multilanguage and multicurrency Website, that links to WHMCS. When the user goes to order, login into the account, register, or anything related to the billing system, i send them to (as example): domain.com/cart.php?currency=Spanish&currency=3 (so he see the billing system in spanish and prices in the particular currency. I can't find how to implement this in Blesta. It doesn't support a similar functionality. I was checking the source code too (for see how language works), and it looks like the core language part for example, is inside the 1% encrypted code (correct me if i am wrong), or i am not finding it. Is there some way to implement this? Thank you, regards.
  12. I don't think so. Of course, is my point of view, i don't think because ("taking in account we use email as username", from the staff perspective): - In our case, honestly, never paid attention to usernames. We identify customers by number or name. Who minds the username is the customer that needs it to login. - Rignt now in Blesta multi-company everything is separated. So staff needs to go to inside the admin of company A for see the company A tickets, invoices, services... so the customer is the customer inside company A, regardless of the username. In change from a customer perspective is more confusing: - He signups in company A using his email. He doesn't mind his name and customer number. But he needs to remember the email (username) for login or restore his password. - He wants to signup now in company B, but is says his username (email) is in use or exists (because exsists in company A). So he tries to restore the password and the discover the username doesn't exists. So, he asks you if the account exists or not, why can't use his email if never signed up before in company B. This point doesn't make any sense. If happens what you say, that someone signed up in company A using the username "example" (again, in our case is the email) and the someone signs in company B using the username "example", the second one did come first in company B and wins. In our case as force email as username, who owns the email account owns the companies accounts because they can get access to it. So if you use someone else email, you loose the account at that moment. (an email verification would make it perfect). Right now how it is, you have to create a new user anyway for evey company. Even if the username "exists or not" in that company. With this change at least you can use the same username if doesn't exists in that company. You go from nothing so something. Anyway, is complex. Not all business runs in the same way. But i am convinced this change that I propose is the right solution from how it works now, fix the no sense error about the pseudo existence of the username, and make the customer life easier. All the rest can stay like it is. Regards.
  13. Hello Paul, Thank you for your answer. Something similar to option 2 is what I mean. The ablility to create a new user for each company using the same username (can use diferent passwords). Not a switch between companies or something like that. Just to be able to use the same username in any of the companies. Not related profiles. Just individual accounts in each company (just in case someone tries to use the same username in another service). What i think, If someone registers using the same username in company A and company B, needs to login in company A to access the services in company A, or login in company B to access the services in company B. Is more, if someone uses the username "example" in company A, maybe another person uses the username "example" in company B. So they are diferent person that don't have to share anything. To sum up, the same username (same person or not, same password or not) can exist in all companies. Access every company separated. Profiles are not related each one. Not switch betwen companies. All this for the customer users. Staff users work perfect just as they work. Thank you. Regards.
  14. I have the same problem here. And i was asked why the can't login with the same email in 2 services (luckily people known for now). And idk if is good to modify the core for this, because the updates. I pray every day to see that change in development roadmap ?. @Paul is there not way to take a look into this and add this feature to the core? (allow customers to use same email as username in 2 companies in a multi-company setup). Regards!
  15. Hello again, i wanted to do a question related to this topic (specially for who know a little the blesta structure). I want to use multi-company but this of the "unique username" in all companies is not going to work for me. I didn't get multi company yet so i can't try this. But i really need separate the brands, because 2 or the services i will offer are free and then probably much users and same users using more than 1 brand. What can happens if I modify all users in database (table users) changing all the usernames (username field) after registration or when sending the form: For example, in company 1 registers someone with the username "myusername" (or myusername@something, lets take the "myusername" for examples). Then in the register function, i change his username for example to "1#myusername" (lets say in the submit form or something like that, puting something like the company id); Then, in company 2 registers someone with the username "myusername" and is going to be free to use, because the other one is now "1#myusername". So, when register, i register this one like "2#myusername". if someone wants to register in compay 1 or comany 2 now using the name "myusername" that will no be possible because "1#myusername" and "2#myusername" are in use. Then modify the login form and recovery password form for example, so when someone of them want to login or reset password, they use "myusername" and i appned in the form depending in the company they are, 1# or 2# before the username. Can work something like this? Or there I would need to make more major changes? Can this break some functionality? Thank you, regards.
×
×
  • Create New...