We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    i made this script because need a faster login logout in my site whith a lot of content and the default login logout method show a page when login and when is finished reload again a new page. this is a strange effect for the users and this easy code skip this. think is very usefoul.
    you can do two plugiins to give the user a specific page on login and another on logout.
    you can code too for show a specific page if is in a specific webgrop or user.
    only change the location and mark weblogin weblogout events.
    hi
    header("Location: /inicio/CUBO.html");
    exit();
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 30735
      • 18 Posts
      Hey, I dont suppose you could give me a hand? I dont really understand what your saying for implementing it but this is exactly what i need. Any help would be appreciated.
        • 32982
        • 674 Posts
        sorry y dont undertand well english
        you only need to put this code into a plugin and select onweblogin and in weblogout events
        think it help you
          Jabiertxof (formerly XYZVISUAL)
          My bussines: http://marker.es
          https://www.youtube.com/user/jabiertxof/videos
          • 10298
          • 53 Posts
          Hi
          I have 5 different usergroups how do you do this quick login for these. They must all be directed to different pages but have the same logout page.

          Could you please write the statement for this plug-in code.

          By the way works excellent
            • 32982
            • 674 Posts
            $first=array(admin);
            $second=array(secondgroup);
            $third-......
            if($modx->isMemberOfWebGroup($first){
            header("Location: /inicio/CUBO.html");
            exit();}


              Jabiertxof (formerly XYZVISUAL)
              My bussines: http://marker.es
              https://www.youtube.com/user/jabiertxof/videos
              • 14796
              • 59 Posts
              This is exactly what I need to do, as I don’t want the "do you wish to logout" page to show up. I just want it to automatically go to the homepage after logging in. I tried a few things, but I’m not sure where to stop the first reload (as the second reload takes the user to the homepage). I don’t quite understand what xyzvisual is saying in how to fix this problem...

              If someone, or xyzvisual could help me out with this, I would greatly appreciate it smiley
                • 32982
                • 674 Posts
                for go to the homepage on weblogin use the first post and change to the URL you want
                header("Location: /inicio/CUBO.html");
                exit();
                put in a plugin and check onweblogin (do the same in web logout if you want)
                think it help you but i don’t know if i fully understand your post.
                hi
                  Jabiertxof (formerly XYZVISUAL)
                  My bussines: http://marker.es
                  https://www.youtube.com/user/jabiertxof/videos
                  • 14796
                  • 59 Posts
                  It took me a bit to understand, but I got it to work smiley

                  Thanks XYZVisual for the help!
                    • 4129
                    • 15 Posts
                    Hi everybody and specialy xyzvisual,

                    Thanks for the solution. I have test it and it worked... until I used other plugin (like SMF one) that use OnWebLogin event too...
                    The refresh was done before calling the others callback functions and so the authentification in the SMF login wasn’t done.

                    I don’t know if it is possible to specify the order in wich the callback function on events are called.

                    So, in orders to keep everything working without having double reload, here is my solution (based on xyzvisual one):

                    In the file "assets/snippets/weblogin/weblogin.processor.inc.php", replace all:

                    $modx->sendRedirect($url,0,'REDIRECT_REFRESH');


                    by

                    header("Location: ".$url);


                    Hope this will work fine in every situation wink
                      • 7923
                      • 4,213 Posts
                      Also, if you would use:

                      $modx->sendRedirect($url);
                      


                      it should do a header redirect.


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."