We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10165
    • 129 Posts
    freshwaterwest Reply #1, 14 years ago
    Just wondered if anyone has needed to do this sort of thing before?

    Would like to be able to allow the manager/admin the ability to click on any listed webuser and be automatically logged in as that user - thereby having all the relevant users information / views.

    This is basically so they can complete an order over the phone and take advantage of the users details being already available in the system.

    any ideas of where might be best to start?
    many thanks
      • 10165
      • 129 Posts
      freshwaterwest Reply #2, 14 years ago
      I forgot to say - I've been using WebloginPE for the user registration / login but I guess this might be done without the need to involve webloginPE?

      cheers
        • 30023
        • 172 Posts
        It's possible, but there is AFAIK no 'out of the box' solution available. You need to write a script that sets up the appropriate session variables for a particular webuser.

        I once did a similar thing where one group of webusers could impersonate another (for a site where the teachers in a school needed to view things as a pupil would). Although that was webuser/webuser not manager/webuser as in your case, the principle is the same in terms of the session variables.

        To be honest it wasn't a neat solution and seemed quite hacky. If you can have an alternative way where the manager user need not be impersonating a webuser it would be far better and less prone to pitfalls.

        -- Tim.
          • 10165
          • 129 Posts
          freshwaterwest Reply #4, 14 years ago
          thanks for your reply Tim - just to clarify did you create a new script or modify/use parts of weblogin or webloginpe?
          If the manager had to logout and re-login as a webuser that would be no problem.

          I wonder if I could look at this another way and show manager the user list with password for each user, (obviously it would be encrypted straight from the database) - maybe I could provide a special login url that asks for/checks the manager login details and the users' username/encrypted password?

          Maybe your solution might point me in the right direction tho.

          thanks
          Phil
            • 30023
            • 172 Posts
            I created a new script. There is no functionality in either of those snippets to do what you want.

            Forget playing around with the webuser's encrypted password. You risk introducing security holes.

            If you really want to have manager users log in as webusers (and as noted above, I don't actually advise this) then you need to familiarise yourself with how weblogin(pe) sets up session variables when a webuser logs in, and write a snippet to do the same.

            -- Tim.