Hi All,
Quite new to Moodle but I work with PHP. I have been looking into redirecting to a different website on logout of moodle. I have seen code level hacks... but then I found a thread with a nice plugin that would let me redirect.
Please see below for plugin code:
<?php
require_once('../../lib/authlib.php');
class auth_plugin_logout_redirect extends auth_plugin_base {
function user_login($username, $password) {
return true;
}
function logoutpage_hook() {
global $redirect;
$redirect='http://www.google.com'; //just for testing
}
}
?>
In the thread there was also instruction on how to create a folder in "moodle/auth/plugin_name/". In the folder I created "auth.php" and added the source code from above. I then went to admin -> users -> manage authentication. I am told I would find my plugin here but nothing is showing!
I then purposefully changed the name of auth.php to auth_a.php and I got an error message saying that moodle failed to load my plugin. When I changed the name back the error disapeared, but nothing is showing for my plugin not even a plugin loaded confirmation.
1) I need to know if the code above will work as a plugin?
2) Am doing the right things to let moodle know that I want this plugin to run?
3) Is this the correct way to do this particular task or there a better solution?
I am working with Moodle 1.9x
Many Thanks In Advance For Your Help
Bob