Moodle plugins directory: Login/Logout user redirection | Moodle.org
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:
277 sites
44 downloads
18 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 here: https://raw.githubusercontent.com/hrimhari/moodle-auth_loginlogoutredir/master/INSTALL
There are manual steps that require access to your Moodle's config.php file.
Useful links
Contributors
Felipe Carasso (Lead maintainer)
Please login to view contributors details and/or to contact them
Thank you for the plugin submission. I tested your plugin on Moodle 2.8 and 2.7 and seems to function properly.
Are you aware of the codechecker plugin that will check your code for Moodle coding style? You can download here https://moodle.org/plugins/view.php?plugin=local_codechecker. Once installed you can run it on your code and fix the styling errors I observed. Most of which were generated because you did not have the standard boiler plate at top of every php file.
Also it would be great if the admin could set the login/logout urls from the admin settings panel instead of modifying config.php. To do this you would need to include a settings.php in your repo. Take a look at some other plugins that have admin settings.
Carl
As Carl suggests, admins might prefer having this configurable via admin UI. I am sure you may get further feature requests like this in the future.
Please make sure the post-installation setup instructions are available at the plugin description here as well. Not everybody is checking the INSTALL files, especially with the in-built plugin installer. Again, admins might be confused on why the plugin is not working.
This seems to be simple and save enough at the moment to be approved so you can get wider feedback from the community. Good luck with maintaining this. You are cleared to land now, welcome to the Plugins directory!
The "INSTALL" hint not always being read is a valid one. It might explain why some people seem to be having trouble with my other plug-in.
Also, the plug-in being installed from within Moodle does make for a good argument against putting the settings in config.php.
I'll follow up with the suggestions as soon as I find a slot, maybe last week of November.
Best regards,
Felipe
does it work in moodle 2.9?
Can share the config.php sample with me, when I change my config.php. the moodle freeze , do not work
My website is : www.besttopractice.com/moodle/
my config.php
...
$CFG->loginredir = "$CFG->loginredir = "{CFG->wwwroot}/moodle/my"
$CFG->logoutredir = "www.besttopractice.com"
...
it does not work
You seem to have an infinite loop in your config.php when you try to assign $CFG->loginredir. Please review your configuration.
Best regards,
Felipe
can't get it to work (moodle 2.9.2), no redirection.
config.php is:
$CFG->loginredir = "{$CFG->wwwroot}/course/view.php?id=3";
$CFG->logoutredir = "{$CFG->wwwroot}";
Best regards
Dirk
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/';
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