removing unnecessary code -refs #6839

1.9.x
unknown 10 years ago
parent 04b987f2cf
commit da3b9de7e4
  1. 4
      main/admin/user_import.php
  2. 14
      main/admin/user_update_import.php

@ -469,8 +469,8 @@ if ($count_fields > 0) {
<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
<blockquote>
<pre>
<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;ExpiryDate;OfficialCode;PhoneNumber;Status;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId;
<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;0000-00-00 00:00:00;xxx;xxx;user/teacher/drh;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br />
<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId;
<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br />
</pre>
</blockquote>
<p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>

@ -441,11 +441,9 @@ $user_id_error = array();
$error_message = '';
if (isset($_POST['formSent']) && $_POST['formSent'] AND $_FILES['import_file']['size'] !== 0) {
if (!isset($_POST['file_type'])) {
$file_type = 'csv';
} else {
$file_type = $_POST['file_type'];
}
$file_type = 'csv';
Security::clear_token();
$tok = Security::get_token();
$allowed_file_mimetype = array('csv', 'xml');
@ -492,7 +490,7 @@ if (isset($_POST['formSent']) && $_POST['formSent'] AND $_FILES['import_file']['
if (strcmp($file_type, 'csv') === 0) {
updateUsers($users_to_insert);
} else {
$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption1');
}
if (count($errors) > 0) {
@ -519,7 +517,7 @@ if (isset($_POST['formSent']) && $_POST['formSent'] AND $_FILES['import_file']['
$warning_message = 'session_message';
if ($error_kind_file) {
$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption1');
$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
} else {
header('Location: '.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=show_message&warn='.urlencode($warning_message).'&message='.urlencode($see_message_import).'&sec_token='.$tok);
exit;
@ -532,7 +530,7 @@ if (!empty($error_message)) {
Display::display_error_message($error_message);
}
$form = new FormValidator('user_import','post','user_import.php');
$form = new FormValidator('user_update_import','post','user_update_import.php');
$form->addElement('header', '', $tool_name);
$form->addElement('hidden', 'formSent');
$form->addElement('file', 'import_file', get_lang('ImportFileLocation'));

Loading…
Cancel
Save