$country = array_merge($default_country, $country);
$mform->addElement('select', 'country', get_string('country'), $country);
$mform->addRule('country', get_string('missingcountry'), 'required', null, 'server');
- $mform->setDefault('country', '');
+
+ if( !empty($CFG->country) ){
+ $mform->setDefault('country', $CFG->country);
+ }else{
+ $mform->setDefault('country', '');
+ }
profile_signup_fields($mform);