Login/Logout user redirection

Authentication ::: auth_loginlogoutredir
Maintained by Felipe Carasso
Allows sysadmin to force redirection to certain pages upon login or logout.
Latest release:
344 sites
162 downloads
22 fans
Current versions available: 2

Use this plugin to force Moodle to redirect a user to specific pages.

Note that login redirection will only work if the target URL contains the "Moodle root" URL. I.e. "{$CFG->wwwroot}/something"

Logout redirection should work to any URL.

Be sure to read and follow the install instructions herehttps://raw.githubusercontent.com/hrimhari/moodle-auth_loginlogoutredir/master/INSTALL

There are manual steps that require access to your Moodle's config.php file.

Screenshots

Screenshot #0

Contributors

Felipe Carasso (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Erakutsi iruzkinak
  • Tom Kleintjens
    az., 2016(e)ko mai.ren 18(e)an, 21:38(e)tan
    This works fine on 2.9, thank you. Would it perhaps be possible to include an additional parameter to redirect guests-logins to a different url then logged in users? I'm not sure if this is at all possible, but it would be a welcome addition.
  • Tom Kleintjens
    az., 2016(e)ko mai.ren 18(e)an, 22:59(e)tan
    Adding this to line 18 in auth.php and of course adding the variable $CFG->loginguestredir to the config file fixed it for guest access.
    if ($username == "guest" && $password == "guest") {$urltogo = $CFG->loginguestredir;}
  • Nicolas Ndalpe
    al., 2016(e)ko uzt.ren 25(e)an, 14:52(e)tan
    Hi Felipe,
    Thank you for your plugin. I was just wondering if it would be difficult to add a different link for first time login?

    ie:
    - First time login = redirect to complete profile page
    - Subsequent login = redirect to course list

    Hope to hear from you soon

    Thank you
  • Felipe Carasso
    ar., 2016(e)ko uzt.ren 26(e)an, 00:42(e)tan
    Hi Nicolas,

    I can imagine how to do it, but it's unlikely that I'd do it myself. I'd look into the users table to check for a first login hint and use different url variables accordingly.

    Best regards,
    Felipe
  • Tore Tuastad
    al., 2016(e)ko abe.ren 19(e)an, 17:45(e)tan
    Hi Hav a problem where i get Abstract user_login() method must be overridden. if I login with wrong username.
    Some research led me to this article:
    https://moodle.org/mod/forum/discuss.php?d=314659
    wher e it points to youre plugin, is this somthing you are aware of?
    Regards

    Tore
  • Felipe Carasso
    al., 2016(e)ko abe.ren 19(e)an, 23:33(e)tan
    Hi Tore,

    Would you please open a new issue in github? I'll look into it as soon as possible.

    Thank you,
    Felipe
  • James Pearce
    ar., 2017(e)ko urt.ren 17(e)an, 08:08(e)tan
    Excuse my ignorance, but where in the config.php file do I add these entries?

    $CFG->loginredir = "{$CFG->wwwroot}/plus/some/different/path"
    $CFG->logoutredir = "Any URL you want"

    Thanks
  • Felipe Carasso
    ar., 2017(e)ko urt.ren 17(e)an, 09:34(e)tan
    Hi James,

    Any place between the first line where a $CFG-> appears and the end of the PHP code (before the '>' in the end) should be fine.

    Best regards,
    Felipe
  • James Pearce
    ar., 2017(e)ko urt.ren 17(e)an, 11:28(e)tan
    Thanks Felipe,

    Anywhere I paste that code gives a "Parse error" when I load the page. Any further advice?

    Regards
  • Felipe Carasso
    ar., 2017(e)ko urt.ren 17(e)an, 13:42(e)tan
    Yes, watch out for "smart quotes". If you use the wrong quotes, you'll get a parse error.
  • sulagna behera
    og., 2018(e)ko mar.ren 22(e)an, 18:05(e)tan
    Hello.
    I tried installing this plugin. I added the following code in the config.php
    $CFG->loginredir = "{$CFG->wwwroot}/admin/purgecaches.php";
    $CFG->logoutredir = "{$CFG->wwwroot}";

    It is showing "abstract user login() method must be overridden"
  • Michael Milette
    ar., 2024(e)ko mar.ren 19(e)an, 21:11(e)tan
    Good day!

    I tested the logoutredir part of this plugin in Moodle up to version 4.1 running on PHP 7.4. So far and it works great for logging out of OAuth2. Note that there is a slightly newer version of the plugin on GitHub. I have not tried it with a newer version of Moodle or PHP yet. Has anyone else?

    Best regards,

    Michael
  • Ezzeddin Hamed
    al., 2024(e)ko api.ren 29(e)an, 03:19(e)tan
    Hello,

    I used this plugin latest update from github in Moodle 4.3 and PHP 8.1, it is working fine without any issues.

    To anyone who is interested in installing it, please be reminded that after the installation, the plugin will be disabled, but you can enable it at /admin/settings.php?section=manageauths

    I hope this is useful.
  • Ivan Oliveira
    al., 2024(e)ko urr.ren 14(e)an, 21:48(e)tan
    Should I see a setting link after enabling the plugin on the Manage authentication?

  • Michael Milette
    ar., 2025(e)ko ots.ren 18(e)an, 02:20(e)tan
    Has anyone tried this plugin with Moodle 4.5 LTS yet?

    Best regards,

    Michael Milette
1 2
Please login to post comments