We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44231
    • 126 Posts
    hi there

    Currently I'm developing a website(drug directory site) and I need some advice on how to create a registration/signin/signup module for my website. My website has approximately 3 type of users the patient ,doctors and guest users.And I want to do the following:

    A. when a patients signup or log on to my page they will see webpages only for patients the same as with the doctor and guest users.
    B.different previlage/restrictions in different users

    I hope I made a clear discussion, if not I'm happy to elaborate more!

    thanks laugh
      • 3749
      • 24,544 Posts
      One way to go would be to use three versions of the Register snippet, one for each group, and put each one on a separate registration page.

      It might make it easier to know that protecting/hiding pages and registering the users are two completely independent processes.

      The registration process is just about getting the users registered in the right User Groups and nothing else.

      Determining which pages they can see is done in Resource Group Access ACL entries, which connect User Groups to Resource Groups to allow users in a User Group access to resources in a Resource Group. It has nothing to do with registration.

      You shouldn't need to worry about controlling access to the pages until after you can successfully register users into the Patients, Doctors, and Guests user groups, and once the registration part is done, the rest is relatively straightforward. You may want to just have two groups, Patients and Doctors, and let non-logged in users be Guests. Not-logged-in users are automatically members of the Anonymous User Group, so that would work fine, unless you have pages that Guests should see, but not-logged-in users shouldn't.

      You might also look at the Subscribe extra (http://bobsguides.com/subscribe-tutorial.html), which will manage user registration and putting the users into groups for you. Again, I think you'll need three separate registration pages, one for each group, but there won't be anything on them but the Subscribe snippet tag with the appropriate properties set.

      You can see Subscribe in action at Bob's Guides (see my sig.). It also lets users select their interests. That's optional, but you might want to do it. Feel free to register yourself there. wink
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        oops, this sat here too long and Bob beat me to it.

        The extras Login and Subscribe will help you.
        http://rtfm.modx.com/display/ADDON/Login
        http://bobsguides.com/subscribe-tutorial.html

        Tip, install and configure Login first, at least make the login resource and get it initially set up. Subscribe will use this information upon install although you can change it any time in system settings.

        Security and permissions can be tricky, so it will help to review in great detail, the security/permissions information in the documentation http://rtfm.modx.com/display/revolution20/Security, as well as at Bob's Guides http://bobsguides.com.

        More resources:
        http://modxpo.eu/2012/schedule/sessions/modx-revolution-security-permissions-system
        http://lithiumlab.com/modx/revo_permissions.html
        http://jgulledge.wordpress.com/2010/07/31/learning-modx-tutorial-2-permissions/
        https://vimeo.com/13785684
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 44231
          • 126 Posts
          thank you very much for your reply I appreciate it laugh

          @bob

          - for example doctors successfully register where do I save the information I get from them?
          - another question is , there's a ready made database of doctors information for our clients I want to use it, so that the doctors listed in our database will no more register instead log in already when they visit the site, is this possible?

          thanks glad you guys are giving us newbie wink a guidelines in developing a modx website

          cheers laugh
            • 3749
            • 24,544 Posts
            Your first question is not easy to answer, because as is usually the case with MODX, there are many answers. Here are some of them:

            - create a resource for each Doctor and store the data in Template Variables attached to the template used in those documents.
            - (a variation of the one above) use the MIGX extra.
            - store the data in the extended field of the user profile
            - extend the modUser object to provide extra fields for the data
            - create a custom database table for the data


            All these methods have pros and cons. Unfortunately, the ones that are easiest to implement are the slowest and hardest to maintain. I believe MIGX is an exception to that, but I'm not sure because I've never used it on a production web site.

            The first one is by far the easiest to implement, but it is very difficult to do searching and sorting with it and page loads can be very slow. OTOH, if you don't have a lot of doctors, their data doesn't change often (so pages can be cached), and you won't be doing searches for subsets of doctors very often, it might work for you.

            I would probably do one of the last two, but for you that might mean learning how to use xPDO in Object-Oriented PHP code, so how much time you have to implement things is also a factor.

            On your second question, it depends on what form the database is in, which of the methods above you use to store the data, and whether you're up for writing the code to import the data. It's almost certainly doable, though.




              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 44231
              • 126 Posts
              yeah I agree with you I think one of this two will help me,maybe I should use a custom table.

              - extend the modUser object to provide extra fields for the data
              - create a custom database table for the data

              and for my second question, sorry its not a database but a Table I planning to add it in modx database

              - another question is , there's a ready made database of doctors information for our clients I want to use it, so that the doctors listed in our database will no more register instead log in already when they visit the site, is this possible?

              Conclusion:

              base in this information adding a doctors/patients tables as a custom tables in my modx database is possible and for my 1st question I think this is also the answer.


              thank your very much laugh [ed. note: johnrobert27 last edited this post 13 years, 2 months ago.]
                • 3749
                • 24,544 Posts
                It sounds like you will have just two simple custom tables, unless you have a DoctorPatient table relating doctors to patients, which might raise HIPPAA issues: http://www.hhs.gov/ocr/privacy/


                You should use a different table prefix for your tables than the one used for the MODX tables, but put them in the same DB.

                There's a tutorial here on setting them up so they'll work with xPDO (which you definitely want to do): http://bobsguides.com/custom-db-tables.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting