mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-15544 Disable email signup in new installation - add danger warning
This commit is contained in:
parent
f8f817b73d
commit
e9180ff830
4 changed files with 22 additions and 11 deletions
|
@ -523,6 +523,8 @@
|
||||||
/// check that site is properly customized
|
/// check that site is properly customized
|
||||||
if (empty($site->shortname)) {
|
if (empty($site->shortname)) {
|
||||||
// probably new installation - lets return to frontpage after this step
|
// probably new installation - lets return to frontpage after this step
|
||||||
|
// remove settings that we want uninitialised
|
||||||
|
unset_config('registerauth');
|
||||||
redirect('upgradesettings.php?return=site');
|
redirect('upgradesettings.php?return=site');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,15 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||||
$adminroot =& admin_get_root(true); //reload tree
|
$adminroot =& admin_get_root(true); //reload tree
|
||||||
}
|
}
|
||||||
|
|
||||||
$newsettingshtml = admin_output_new_settings_by_page($adminroot);
|
$newsettings = admin_output_new_settings_by_page($adminroot);
|
||||||
|
if (isset($newsettings['frontpagesettings'])) {
|
||||||
|
$frontpage = $newsettings['frontpagesettings'];
|
||||||
|
unset($newsettings['frontpagesettings']);
|
||||||
|
array_unshift($newsettings, $frontpage);
|
||||||
|
}
|
||||||
|
$newsettingshtml = implode($newsettings);
|
||||||
|
unset($newsettings);
|
||||||
|
|
||||||
$focus = '';
|
$focus = '';
|
||||||
|
|
||||||
if (empty($adminroot->errors) and $newsettingshtml === '') {
|
if (empty($adminroot->errors) and $newsettingshtml === '') {
|
||||||
|
|
|
@ -362,7 +362,7 @@ $string['nopasswordchangeforced'] ='You cannot proceed without changing your pas
|
||||||
$string['passwordhandling'] = 'Password field handling';
|
$string['passwordhandling'] = 'Password field handling';
|
||||||
$string['plaintext'] = 'Plain text';
|
$string['plaintext'] = 'Plain text';
|
||||||
$string['selfregistration'] = 'Self registration';
|
$string['selfregistration'] = 'Self registration';
|
||||||
$string['selfregistration_help'] = 'Choose which auth plugin will handle user self-registration.';
|
$string['selfregistration_help'] = 'If an authentication plugin, such as email-based self-registration, is selected, then it enables potential users to register themselves and create accounts. This results in the possibility of spammers creating accounts in order to use forum posts, blog entries etc. for spam. To avoid this risk, self-registration should be disabled or limited by <em>Allowed email domains</em> setting.';
|
||||||
$string['sha1'] = 'SHA-1 hash';
|
$string['sha1'] = 'SHA-1 hash';
|
||||||
$string['showguestlogin'] = 'You can hide or show the guest login button on the login page.';
|
$string['showguestlogin'] = 'You can hide or show the guest login button on the login page.';
|
||||||
$string['stdchangepassword'] = 'Use standard Change Password Page';
|
$string['stdchangepassword'] = 'Use standard Change Password Page';
|
||||||
|
|
|
@ -3621,7 +3621,7 @@ class admin_setting_grade_profilereport extends admin_setting_configselect {
|
||||||
*/
|
*/
|
||||||
class admin_setting_special_registerauth extends admin_setting_configselect {
|
class admin_setting_special_registerauth extends admin_setting_configselect {
|
||||||
function admin_setting_special_registerauth() {
|
function admin_setting_special_registerauth() {
|
||||||
parent::admin_setting_configselect('registerauth', get_string('selfregistration', 'auth'), get_string('selfregistration_help', 'auth'), 'email', null);
|
parent::admin_setting_configselect('registerauth', get_string('selfregistration', 'auth'), get_string('selfregistration_help', 'auth'), '', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_defaultsettings() {
|
function get_defaultsettings() {
|
||||||
|
@ -4493,15 +4493,15 @@ function admin_search_settings_html($query) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal function - prints list of uninitialised settings
|
* Internal function - returns arrays of html pages with uninitialised settings
|
||||||
*/
|
*/
|
||||||
function admin_output_new_settings_by_page($node) {
|
function admin_output_new_settings_by_page($node) {
|
||||||
$return = '';
|
$return = array();
|
||||||
|
|
||||||
if (is_a($node, 'admin_category')) {
|
if (is_a($node, 'admin_category')) {
|
||||||
$entries = array_keys($node->children);
|
$entries = array_keys($node->children);
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
$return .= admin_output_new_settings_by_page($node->children[$entry]);
|
$return += admin_output_new_settings_by_page($node->children[$entry]);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (is_a($node, 'admin_settingpage')) {
|
} else if (is_a($node, 'admin_settingpage')) {
|
||||||
|
@ -4513,8 +4513,8 @@ function admin_output_new_settings_by_page($node) {
|
||||||
}
|
}
|
||||||
if (count($newsettings) > 0) {
|
if (count($newsettings) > 0) {
|
||||||
$adminroot =& admin_get_root();
|
$adminroot =& admin_get_root();
|
||||||
$return .= print_heading(get_string('upgradesettings','admin').' - '.$node->visiblename, '', 2, 'main', true);
|
$page = print_heading(get_string('upgradesettings','admin').' - '.$node->visiblename, '', 2, 'main', true);
|
||||||
$return .= '<fieldset class="adminsettings">'."\n";
|
$page .= '<fieldset class="adminsettings">'."\n";
|
||||||
foreach ($newsettings as $setting) {
|
foreach ($newsettings as $setting) {
|
||||||
$fullname = $setting->get_full_name();
|
$fullname = $setting->get_full_name();
|
||||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||||
|
@ -4525,10 +4525,11 @@ function admin_output_new_settings_by_page($node) {
|
||||||
$data = $setting->get_defaultsetting();
|
$data = $setting->get_defaultsetting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return .= '<div class="clearer"><!-- --></div>'."\n";
|
$page .= '<div class="clearer"><!-- --></div>'."\n";
|
||||||
$return .= $setting->output_html($data);
|
$page .= $setting->output_html($data);
|
||||||
}
|
}
|
||||||
$return .= '</fieldset>';
|
$page .= '</fieldset>';
|
||||||
|
$return[$node->name] = $page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue