19,7 → 19,6 |
$l_text_import = "Importer à partir d'un fichier texte ('.txt')"; |
$l_text_import_help = "Ce fichier ne doit contenir que des noms d'usagers écrits les uns sous les autres."; |
$l_file = "Fichier"; |
$l_users_service = "Définissez leur service (facultatif)"; |
$l_users_group = "Définissez leur groupe (conseillé)"; |
$l_send = "Envoyer"; |
$l_imported_files = "Fichiers des identifiants/mot_de_passe importés durant les dernières 24h :"; |
41,7 → 40,6 |
$l_text_import = "Import from a text file ('.txt')"; |
$l_text_import_help = "In this file, you must write only the user login one below the other."; |
$l_file = "File"; |
$l_users_service = "Define their service (optional)"; |
$l_users_group = "Define their group (advisable)"; |
$l_send = "Send"; |
$l_imported_files = "Logins/passwords file imported during the last 24h :"; |
120,6 → 118,7 |
else { $choix = ''; } |
if ($choix == "raz") |
{ |
exec ("sudo /usr/local/sbin/alcasar-logout.sh all"); |
exec ("sudo /usr/local/sbin/alcasar-mysql.sh --raz"); |
} |
// a file is downloaded |
126,11 → 125,9 |
if(isset($_FILES['import-users']) && ($_FILES['import-users']['name'] !="")) |
{ |
unset($result); |
if (isset ($_POST['service'])) $service = $_POST['service']; |
if (isset ($_POST['groupe'])) $group = $_POST ['groupe']; |
$destination = '/tmp/import_file.txt'; |
list($file_name , $extension) = explode("." , $_FILES['import-users']['name']); |
echo "choix = ".$choix.", service = ".$service.", groupe = ".$group.", file_name = ".$file_name.", extension = ".$extension; |
if ($choix == "csv") // import of a txt file |
{ |
if (($extension != 'csv') && ($extension != 'txt')) $result = $l_error_ext_txt; |
177,7 → 174,6 |
{ |
// create the user informations file |
fputs($RS_out,"$l_out_title\r\n\r\n"); |
if ($service != "" ) { fputs($RS_out,"Service : $service\r\n\r\n");} |
fputs($RS_out,"$l_out_login $login | $l_out_passwd $password\r\n\r\n"); |
fputs($RS_out,"$l_out_mind\r\n\r\n"); |
fputs($RS_out,"--------------------------------------------------------------------------------\r\n\r\n"); |
190,7 → 186,7 |
{ |
if (!@da_sql_num_rows($res,$config)) |
{ |
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_user_info_table] (username,department) VALUES ('$login','$service');"); |
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_user_info_table] (username) VALUES ('$login');"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
265,7 → 261,6 |
echo "<tr><td valign=\"middle\" align=\"left\">"; |
echo "<br><FORM action='$_SERVER[PHP_SELF]' method=POST ENCTYPE=\"multipart/form-data\">"; |
echo "$l_file (.txt) : <input type=\"file\" name=\"import-users\"><br>"; |
echo "$l_users_service : <input type=\"input\" name=\"service\" value=\"\"><br>"; |
echo "$l_users_group : "; |
require("../lib/defaults.php"); |
include_once("../lib/$config[general_lib_type]/group_info.php"); |