Alpha Video Training
Results 1 to 17 of 17

Thread: Multi-user, multi company one server web application

  1. #1
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Multi-user, multi company one server web application

    Basically what I'd like to do is host 1 web application for say 20 companies that will use the same system.
    I find that this method would be more cost effective for them since they will all be using the same functions and user interface within the system.
    Conceptually, all the information in the database tables will be filtered/segregated by a company_id from a company table in MySQL back-end DB.

    My main problem with the design for this system is how to integrate A5 login & web security - even if it could be integrated - for many users from these multiple companies. Users are also ideally filtered by the company_id and can still have groups e.g. manager & staff.

    Has anyone had such an experience or have an interesting idea on how best to approach this scenario?

  2. #2
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: Multi-user, multi company one server web application

    Yep. You still just have the three security groups: company, manager, staff plus one more for Administrators.

    Add Company_id as a field to your local user table. Mine is called web_users. When a user is added or registers, set their Company_Id to the proper value (up to you how you do that, I do it automatially at Sign-Up by validating who they are against previous invoice details plus a company-specific "invite code"). Then on login, include code that will set a value for session.__protected__companyid. I have a header on top of every page that does that, other's set it in the login.a5w page so it is set only on login. The expression will look like this:

    session.__protected__companyid = sql_lookup("conn","web_users","ulink="+session.__protected__ulink,company_id)

    Where ulink is the logged in users security framework identifier.

    Now when someone logs in, their company_id is in that session var.

    More later if you need help, but you use that session var to provide each Company with their own filtered web_users information, or list of employees, etc. And you can use it to add, modify employee lists and still maintain the company_id in those records.

    Some of this may not be clear because I am using a specific database model that I'm pretty familiar with, so ask more questions as they arise.

    This design originated with an application that does have one owner (Admin), several hundred Companies and each Company has a few to several thousand Customers. The Customers login to pay their bill to the Customers using electronic check. That means it is storing the eCheck details of thousands of Customers and the Merchant ID's for the several hundred Companies - so I trust that this arrangement works and is secure!
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  3. #3
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,620

    Default Re: Multi-user, multi company one server web application

    Yup, I'll echo Steve Wood that this can be done, and works just fine. Every User is sent to the regular Home page menu at login. But if a User is a multi-company user, he is first sent to a page to select the oompany to work with at this time.

    As Steve Wood notes, there's more to consider about how to do all this. At login time I establish session.__protected__IsMultiComapanyUser to help manage some of this.
    -Steve


  4. #4
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    Hey guys, glad to see we are on the same page but another confusion is with how to set up the security to accommodate the company group and link it with the back end mysql db. I know I can easily create groups for the different users but company seems to be a particularly special case - especially since there are additional attributes to the company.

    I feel I might be "over thinking" this but I'm really a noobie for A5.

    As for creating a page that lists the different companies, my plan is to avoid that by having the company admin create the users and in that process the company ID would be included in the user's credentials. When the user logs in, the company_id would then be used throughout the session to filter users that may CRUD the information specific to their company.

  5. #5
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,620

    Default Re: Multi-user, multi company one server web application

    After a user logs in, you can use the Ulink value to get more information from the User table. The User table should contain not only the linking value that matches the Ulink value, but also the Company_ID.

    So, you have the Ulink value, then use it to lookup to the User table to establish session.__protected__CompanyID. This latter variable can then be used to filter grids by Company_ID.
    -Steve


  6. #6
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    Hey Steve, I like that perspective man, thanks a lot. So with that said I do not need to create a company group in the web security - correct?

  7. #7
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: Multi-user, multi company one server web application

    I think you are using "Manager" to represent the Manager of the Company. So in that case, you don't need a Company secuirty level because you using the word Manager to mean the same thing that I am by Company. I personally use "Company" because I am describing the entity that is logging in - a Company (person). Manager to me is vague, Department Manager, Office Manager, etc. But Company is any guy at that company given the keys to login an see Company information.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  8. #8
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    Ok great clarification there Steve, thank you for that. Manager & staff will suffice for the purpose of this app.
    Many thanks for all your contributions everyone.

  9. #9
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,629

    Default Re: Multi-user, multi company one server web application

    Quincy,

    It is very helpful in this design to use MySQL tables to hold the security information. Alpha has a paper that describes how to do that by setting the Alpha dbf security tables as active link tables to the MySQL versions of those tables.

    Pat
    Pat Bremkamp
    MindKicks Consulting

  10. #10
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    Hey Pat, I believe the attached PDF was what you were referring to.

  11. #11
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,629

    Default Re: Multi-user, multi company one server web application

    That's it. I've got a bunch of clients using that approach and it works very well, especially if you have thousands of users.

    Pat
    Pat Bremkamp
    MindKicks Consulting

  12. #12
    Member
    Real Name
    John Portal
    Join Date
    Aug 2010
    Posts
    105

    Default Re: Multi-user, multi company one server web application

    For self clarification. This is my situation. Is this what you are talking about? I will use different titles for a better picture of the relationships and activities.
    Multiple vendors selling, multi vendor employees, multi buyers.
    There is one overall system administrator-that is you.
    Each vendor has an administrator that can do everything for their account only, each vendor has employees that must access the system to do something, perhaps enter orders, but the vendor admin does not want them to be able to access (change or enter)sensitive info like pricing. So the admins for each individual vendor will create the accounts for their employees and give them linited access(permissions), and the admins will delete the employee account when appropriate. Vendor employees cannot self register.

    Buyers can place orders with any vendor, the buyer selects the vendor before ordering.
    Is this scenario the same as yours?
    Will the solution provided work for the above scenario?

    Thanks,

  13. #13
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    MY situation is this: Multiple users, possibly a few admins. Group permissions easily takes care of this.
    Each user should have the ability to change their password and security Question & answer internally in the web app.
    Admins can list user accounts, lock & unlock user accounts, select which company & group(s) a user is associated with.
    I apologise for not responding much sooner to your post.

    BTW this proves to be a very tricky implementation.

  14. #14
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: Multi-user, multi company one server web application

    qfactor - I read the thread, don't we already suggest how to do this, did you give it a try?
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  15. #15
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    Yes I did, I got web security going on now with mysql. I was responding to Portal 6 clarification post. Thanks again to everyone.

    I still have only 2 other outstanding challenges though and they are to listing the native a5 security questions in a drop down field in a grid detail view in web app, and allowing users to change their password internally. When I overcome those issues I would have completed the user admin section. I noticed someone had the same problem else where on the forum for weeks now. Can listing the native a5 security questions in a drop down field be done in a grid detail view? If so what's is the proper way?

  16. #16
    Member
    Real Name
    Quincy Johnson
    Join Date
    Dec 2010
    Location
    Jamaica
    Posts
    15

    Default Re: Multi-user, multi company one server web application

    OK on careful observation I realised that to have the web security questions listed it has to be in a dialog component, not a grid component as I hoped :( I can now move on in completing this app and once again thanks you all for your contributions.

  17. #17
    Member Kamel's Avatar
    Real Name
    Kamel Jazmati
    Join Date
    Nov 2010
    Location
    Jeddah, Saudi Arabia
    Posts
    97

    Default Re: Multi-user, multi company one server web application

    hi all, please I have question, is their way to fetch all users that is now logged in to the application now ???

    thanks,,,

Similar Threads

  1. Designing for a Multi-user Application
    By Scott Axton in forum Database Design
    Replies: 4
    Last Post: 05-17-2009, 11:29 AM
  2. Multi Company - Multi User Shared Website
    By Kevin Callanan in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 01-19-2009, 06:13 AM
  3. Single user to Multi user Application
    By George in forum Alpha Four Version 6 and Prior
    Replies: 1
    Last Post: 05-25-2001, 07:22 PM
  4. Multi-user Application Module
    By manoys in forum Announcements
    Replies: 1
    Last Post: 06-19-2000, 12:10 PM
  5. Multi-user Application Module
    By manoys in forum Alpha Five Version 4
    Replies: 0
    Last Post: 06-18-2000, 09:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •