Maintained by Felipe Carasso
Allows sysadmin to force redirection to certain pages upon login or logout.
Latest release:
241 sites
17 fans
Current versions available: 1

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 ### Contributors Felipe Carasso (Lead maintainer) Please login to view contributors details and/or to contact them ### Comments Show comments • Tue, Jan 26, 2016, 4:20 AM in moodle 2.9.2 not work to redirect to frontpage i hack moodle\login\lib.php line 308 if ($urltogo == $CFG->wwwroot or$urltogo == $CFG->wwwroot.'/' or$urltogo == $CFG->wwwroot.'/index.php') { //$urltogo = $CFG->wwwroot.'/my/'; } comment line$urltogo = $CFG->wwwroot.'/my/'; • Wed, Mar 9, 2016, 8:30 AM This plugin seems to work on Moodle 3.0. The only nagging issue is that it generates a lot of strict warnings. Opened issue in github repo (https://github.com/hrimhari/moodle-auth_loginlogoutredir/issues/3). Any assistance welcomed. Thx • Fri, Mar 18, 2016, 7:37 PM I've created a pull request to address those strict warnings. https://github.com/hrimhari/moodle-auth_loginlogoutredir/pull/4 • Mon, Apr 4, 2016, 6:19 PM Its works in Moodle 2.6, in plugin folder, change de version required to version of the moodle 2.6, and works :D • Wed, May 18, 2016, 9:38 PM 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. • Wed, May 18, 2016, 10:59 PM 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;}
• Mon, Jul 25, 2016, 2:52 PM
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
• Tue, Jul 26, 2016, 12:42 AM
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
• Mon, Dec 19, 2016, 5:45 PM
Hi Hav a problem where i get Abstract user_login() method must be overridden. if I login with wrong username.
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
• Mon, Dec 19, 2016, 11:33 PM
Hi Tore,

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

Thank you,
Felipe
• Tue, Jan 17, 2017, 8:08 AM
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 • Tue, Jan 17, 2017, 9:34 AM 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
• Tue, Jan 17, 2017, 11:28 AM
Thanks Felipe,

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

Regards
• Tue, Jan 17, 2017, 1:42 PM
Yes, watch out for "smart quotes". If you use the wrong quotes, you'll get a parse error.
• Thu, Mar 22, 2018, 6:05 PM
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"