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 .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; } @@ -1965,9 +1965,10 @@ function installSettings( $allowTeacherSelfRegistration, $installationProfile = '' ) { - $allowRegistration = $allowRegistration ? 'true' : 'false'; + //$allowRegistration = $allowRegistration ? 'true' : 'false'; $allowTeacherSelfRegistration = $allowTeacherSelfRegistration ? 'true' : 'false'; + error_log($allowRegistration); // Use PHP 5.3 to avoid issue with weird peripherical auto-installers like travis-ci $settings = array( 'Institution' => $organizationName, diff --git a/main/session/add_users_to_session.php b/main/session/add_users_to_session.php index 75b8564f76..5ad58a43c5 100644 --- a/main/session/add_users_to_session.php +++ b/main/session/add_users_to_session.php @@ -51,11 +51,21 @@ $new_field_list = array(); if (is_array($extra_field_list)) { foreach ($extra_field_list as $extra_field) { //if is enabled to filter and is a "'; echo ''; foreach ($new_field['data'] as $option) { $checked=''; - if (isset($_POST[$varname])) { - if ($_POST[$varname]==$option[1]) { - $checked = 'selected="true"'; - } - } - echo ''; - } - echo ''; - echo '  '; + if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { + if (isset($_POST[$varname])) { + if ($_POST[$varname] == $option['tag']) { + $checked = 'selected="true"'; + } + } + echo ''; + } else { + if (isset($_POST[$varname])) { + if ($_POST[$varname] == $option[1]) { + $checked = 'selected="true"'; + } + } + echo ''; + } + } + echo ''; + $extraHidden = $fieldtype == ExtraField::FIELD_TYPE_TAG ? '' : ''; + echo $extraHidden; + echo '  '; } echo ''; echo '

'; diff --git a/main/work/upload.php b/main/work/upload.php index cd6b065ef5..98574322c5 100755 --- a/main/work/upload.php +++ b/main/work/upload.php @@ -105,6 +105,11 @@ if ($form->validate()) { if ($is_allowed_to_edit) { $script = 'work_list_all.php'; } + if (!$result) { + Display::addFlash(Display::return_message(get_lang('UploadError'), 'error')); + } else { + Display::addFlash(Display::return_message(get_lang('UplUploadSucceeded'), 'success')); + } header('Location: '.api_get_path(WEB_CODE_PATH).'work/'.$script.'?'.api_get_cidreq().'&id='.$work_id); exit; } else {