public static function is_defined($forguests = false) {
        global $CFG;
        if (!empty($CFG->sitepolicyhandler)) {
            // This handler can also be used as a fallback in case of invalid $CFG->sitepolicyhandler,
            // in this case assume that no site policy is set.
            return false;
        }
        if (!$forguests) {
            return !empty($CFG->sitepolicy);
        } else {
            return !empty($CFG->sitepolicyguest);
        }
    }