Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-185

Move login-related code away from UsersEventHandler class

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3.9
    • Fix Version/s: 5.1.0-B1
    • Component/s: Optimization
    • Labels:
      None

      Description

      Currently we have very large method (u:OnLogin event) in UsersEventHandler, that is used only once during user login. It sits there and eats memory in each user event handler created even, when user is already logged-in or not logged-in at all. I propose to

      • create UserHelper class and move all login-related code to it;
      • make loginUser method, that will have 3 input parameters: $username, $password, $dry_run = false

      This method will login user with given credentials and return error as constant otherwise. When $dry_run parameter is specified, then it's only checked, that user with given credentials will be able to login if he tries to.

      As the result of this optimization we will be able to transparently login users we want. Also we can upgrade this method, so it can login user by given ID (login and password not checked). Also we can specify where user should be logged-in: front-end or admin. This way it will be easy to implement feature, when administrator can login as any of front-end users without even knowing their password.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: