logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mnlrioiv  
#1 Posted : Wednesday, July 28, 2021 3:41:03 AM(UTC)
mnlrioiv

Rank: Newbie

Groups: Registered
Joined: 7/28/2021(UTC)
Posts: 2
Argentina

Thanks: 1 times
Hello everybody. I really like this forum
I configured basic access for my users in DB and it works fine.
But I have users in 2 diferente databases, I need to select or type the company in the login modal
like this:
[img]https://ibb.co/ZH937FW[/img]
And i need use this company as parameter for switch database connection
For example:
If user types "Company1" on login modal then search user and password on db1...
If user types "Company2" on login modal then search user and password on db2...
Thank you very much

Edited by user Wednesday, July 28, 2021 3:41:59 AM(UTC)  | Reason: Not specified

epf  
#2 Posted : Wednesday, July 28, 2021 9:06:08 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
For this you need to change some piece of codes:
SecurityUser.cs: add a new Company property beside WebUserName
Main.cshtml: add a new company input to the <!-- Login Modal -->
swi-main.ts, swi-gateway.ts: Add the new parameter to the call of _gateway.Login()
HomeController: add the parameter to public ActionResult SWILogin(string user, string password, string token, string company), and assign it to your new Company property.

Then, you would be able to use the Company in the security script, so you will be able to change the default connection of the Data Source or whatever you wanna do...

good luck.
thanks 1 user thanked epf for this useful post.
mnlrioiv on 8/5/2021(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.