Skip to content

Instantly share code, notes, and snippets.

@ostearn
Created May 25, 2018 09:23
Show Gist options
  • Save ostearn/ee87538caecb87c36fe12185da1294c9 to your computer and use it in GitHub Desktop.
Save ostearn/ee87538caecb87c36fe12185da1294c9 to your computer and use it in GitHub Desktop.
Way to stop the anoying moodle login -> redirect to edit profile page (in user/edit.php)
require_once('../config.php');
require_once($CFG->libdir.'/gdlib.php');
require_once($CFG->dirroot.'/user/edit_form.php');
require_once($CFG->dirroot.'/user/editlib.php');
require_once($CFG->dirroot.'/user/profile/lib.php');
require_once($CFG->dirroot.'/user/lib.php');
$referer = get_local_referer(false);
if($referer == $CFG->httpswwwroot . '/login/index.php'){
redirect(new moodle_url($CFG->httpswwwroot . '/'));
echo $referer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment