return;
}
- if (is_siteadmin()) {
- // no sync for admin user, please use admin accounts only for admin tasks like the unix root user!
- // if plugin fails on sync admins need to be able to log in and fix the settings
- return;
- }
+ // originally there was a broken admin test, but accidentally it was non-functional in 2.2,
+ // which proved it was actually not necessary.
static $inprogress = array(); // To prevent this function being called more than once in an invocation
function enrol_get_shared_courses($user1, $user2, $preloadcontexts = false, $checkexistsonly = false) {
global $DB, $CFG;
- $user1 = !empty($user1->id) ? $user1->id : $user1;
- $user2 = !empty($user2->id) ? $user2->id : $user2;
+ $user1 = isset($user1->id) ? $user1->id : $user1;
+ $user2 = isset($user2->id) ? $user2->id : $user2;
if (empty($user1) or empty($user2)) {
return false;