MDL-15544 Disable email signup in new installation - add danger warning

This commit is contained in:
skodak 2008-07-04 23:53:13 +00:00
parent f8f817b73d
commit e9180ff830
4 changed files with 22 additions and 11 deletions

View file

@ -523,6 +523,8 @@
/// check that site is properly customized
if (empty($site->shortname)) {
// probably new installation - lets return to frontpage after this step
// remove settings that we want uninitialised
unset_config('registerauth');
redirect('upgradesettings.php?return=site');
}

View file

@ -20,7 +20,15 @@ if ($data = data_submitted() and confirm_sesskey()) {
$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 = '';
if (empty($adminroot->errors) and $newsettingshtml === '') {

View file

@ -362,7 +362,7 @@ $string['nopasswordchangeforced'] ='You cannot proceed without changing your pas
$string['passwordhandling'] = 'Password field handling';
$string['plaintext'] = 'Plain text';
$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['showguestlogin'] = 'You can hide or show the guest login button on the login page.';
$string['stdchangepassword'] = 'Use standard Change Password Page';

View file

@ -3621,7 +3621,7 @@ class admin_setting_grade_profilereport extends admin_setting_configselect {
*/
class admin_setting_special_registerauth extends admin_setting_configselect {
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() {
@ -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) {
$return = '';
$return = array();
if (is_a($node, 'admin_category')) {
$entries = array_keys($node->children);
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')) {
@ -4513,8 +4513,8 @@ function admin_output_new_settings_by_page($node) {
}
if (count($newsettings) > 0) {
$adminroot =& admin_get_root();
$return .= print_heading(get_string('upgradesettings','admin').' - '.$node->visiblename, '', 2, 'main', true);
$return .= '<fieldset class="adminsettings">'."\n";
$page = print_heading(get_string('upgradesettings','admin').' - '.$node->visiblename, '', 2, 'main', true);
$page .= '<fieldset class="adminsettings">'."\n";
foreach ($newsettings as $setting) {
$fullname = $setting->get_full_name();
if (array_key_exists($fullname, $adminroot->errors)) {
@ -4525,10 +4525,11 @@ function admin_output_new_settings_by_page($node) {
$data = $setting->get_defaultsetting();
}
}
$return .= '<div class="clearer"><!-- --></div>'."\n";
$return .= $setting->output_html($data);
$page .= '<div class="clearer"><!-- --></div>'."\n";
$page .= $setting->output_html($data);
}
$return .= '</fieldset>';
$page .= '</fieldset>';
$return[$node->name] = $page;
}
}