diff --git a/app/Migrations/Schema/V111/Version20160713180000.php b/app/Migrations/Schema/V111/Version20160713180000.php
new file mode 100644
index 0000000000..f6f30603fd
--- /dev/null
+++ b/app/Migrations/Schema/V111/Version20160713180000.php
@@ -0,0 +1,39 @@
+addSql("DELETE FROM settings_current WHERE variable = 'allow_browser_sniffer'");
+ $this->addSql("DELETE FROM settings_options WHERE variable = 'allow_browser_sniffer'");
+ }
+
+ /**
+ * @param Schema $schema
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \Doctrine\DBAL\Schema\SchemaException
+ */
+ public function down(Schema $schema)
+ {
+ $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle','AllowBrowserSnifferComment',NULL,NULL, 0)");
+ $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_browser_sniffer','true','Yes') ");
+ $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_browser_sniffer','false','No') ");
+ }
+}
\ No newline at end of file
diff --git a/main/install/data.sql b/main/install/data.sql
index 1065037819..4349ed8764 100644
--- a/main/install/data.sql
+++ b/main/install/data.sql
@@ -269,7 +269,6 @@ VALUES
('languagePriority4', NULL, 'radio', 'Languages', 'platform_lang','LanguagePriority4Title', 'LanguagePriority4Comment', NULL, NULL, 0),
('login_is_email', NULL, 'radio', 'Platform', 'false', 'LoginIsEmailTitle', 'LoginIsEmailComment', NULL, NULL, 0),
('courses_default_creation_visibility', NULL, 'radio', 'Course', '2', 'CoursesDefaultCreationVisibilityTitle', 'CoursesDefaultCreationVisibilityComment', NULL, NULL, 1),
-('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle', 'AllowBrowserSnifferComment', NULL, NULL, 0),
('gradebook_enable_grade_model', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableGradeModelTitle', 'GradebookEnableGradeModelComment', NULL, NULL, 1),
('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1),
('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0),
@@ -596,8 +595,6 @@ VALUES
('courses_default_creation_visibility', '2', 'OpenToThePlatform'),
('courses_default_creation_visibility', '1', 'Private'),
('courses_default_creation_visibility', '0', 'CourseVisibilityClosed'),
-('allow_browser_sniffer', 'true', 'Yes'),
-('allow_browser_sniffer', 'false', 'No'),
('teachers_can_change_score_settings', 'true', 'Yes'),
('teachers_can_change_score_settings', 'false', 'No'),
('teachers_can_change_grade_model_settings', 'true', 'Yes'),
diff --git a/main/install/index.php b/main/install/index.php
index b9139242b4..3104eb5ce1 100755
--- a/main/install/index.php
+++ b/main/install/index.php
@@ -258,8 +258,8 @@ if (!isset($_GET['running'])) {
$checkEmailByHashSent = 0;
$ShowEmailNotCheckedToStudent = 1;
$userMailCanBeEmpty = 1;
- $allowSelfReg = 1;
- $allowSelfRegProf = 1;
+ $allowSelfReg = 'approval';
+ $allowSelfRegProf = 1; //by default, a user can register as teacher (but moderation might be in place)
$encryptPassForm = 'bcrypt';
if (!empty($_GET['profile'])) {
$installationProfile = api_htmlentities($_GET['profile'], ENT_QUOTES);
@@ -570,7 +570,7 @@ if (@$_POST['step2']) {
$encryptPassForm = 'none';
}
- $allowSelfReg = false;
+ $allowSelfReg = 'approval';
$tmp = get_config_param_from_db('allow_registration');
if (!empty($tmp)) {
$allowSelfReg = $tmp;
@@ -616,7 +616,7 @@ if (@$_POST['step2']) {
echo get_lang('AdminLogin') . ' : ' . $loginForm . '
';
echo get_lang('AdminPass') . ' : ' . $passForm . '
'; /* TODO: Maybe this password should be hidden too? */
}
-
+ $allowSelfRegistrationLiteral = ($allowSelfReg == 'true') ? get_lang('Yes') : ($allowSelfReg == 'approval' ? get_lang('Approval') : get_lang('No'));
echo get_lang('AdminFirstName').' : '.$adminFirstName, '
', get_lang('AdminLastName').' : '.$adminLastName, '
';
echo get_lang('AdminEmail').' : '.$emailForm; ?>
@@ -626,7 +626,7 @@ if (@$_POST['step2']) {
'.$dbNameForm; ?>
-
+
diff --git a/main/install/install.lib.php b/main/install/install.lib.php
index 313556353b..0fe3f878c0 100755
--- a/main/install/install.lib.php
+++ b/main/install/install.lib.php
@@ -1671,13 +1671,13 @@ function display_configuration_settings_form(
} else {
$html .= '