<commit_before><?PHP  // $Id$
       // enrol.php - allows admin to edit all enrollment variables
       //             Yes, enrol is correct English spelling.

    include("../config.php");

    $enrol = optional_param('enrol', $CFG->enrol);

    require_login();

    if (!$site = get_site()) {
        redirect("index.php");
    }

    if (!isadmin()) {
        error("Only the admin can use this page");
    }

    if (!confirm_sesskey()) {
        error(get_string('confirmsesskeybad', 'error'));
    }

    $enrol = clean_filename($enrol);
    require_once("$CFG->dirroot/enrol/$enrol/enrol.php");   /// Open the class

    $enrolment = new enrolment_plugin();


/// If data submitted, then process and store.

	if ($frm = data_submitted()) {
        if ($enrolment->process_config($frm)) {
            set_config('enrol', $frm->enrol);
            redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
        }
	} else {
        $frm = $CFG;
    }

/// Otherwise fill and print the form.

    /// get language strings
    $str = get_strings(array('enrolments', 'users', 'administration', 'settings'));<commit_msg>Some not-very-significant cleanups while fixing another bug<commit_after><?PHP  // $Id$
       // enrol.php - allows admin to edit all enrollment variables
       //             Yes, enrol is correct English spelling.

    include("../config.php");

    $enrol = optional_param('enrol', $CFG->enrol, PARAM_ALPHA);

    require_login();

    if (!$site = get_site()) {
        redirect("index.php");
    }

    if (!isadmin()) {
        error("Only the admin can use this page");
    }

    if (!confirm_sesskey()) {
        error(get_string('confirmsesskeybad', 'error'));
    }

    require_once("$CFG->dirroot/enrol/$enrol/enrol.php");   /// Open the class

    $enrolment = new enrolment_plugin();


/// If data submitted, then process and store.

	if ($frm = data_submitted()) {
        if ($enrolment->process_config($frm)) {
            set_config('enrol', $frm->enrol);
            redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
        }
	} else {
        $frm = $CFG;
    }

/// Otherwise fill and print the form.

    /// get language strings
    $str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
{'fraction_non_alphanumeric': 0.16406926406926406, 'fraction_numerical': 0.0008658008658008658, 'mean_word_length': 2.5829457364341084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '754695', 'n_tokens_mistral': 748, 'n_tokens_neox': 710, 'n_words': 166}