Created
May 21, 2018 12:16
-
-
Save willianmano/8fd1616322bb33fbb5a097b042fcf5b4 to your computer and use it in GitHub Desktop.
Moodle redirects after login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File located in the DB folder | |
$observers = array( | |
array( | |
'eventname' => '\core\event\user_loggedin', | |
'callback' => 'yourplugin_dashboard_redirect', | |
'includefile' => 'yourplugin/localib.php' | |
) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File located in the plugin root folder | |
function yourplugin_dashboard_redirect(){ | |
GLOBAL $CFG; | |
if(!is_siteadmin()){ | |
redirect($CFG->wwwroot.'/yourplugin/dashboard.php'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment