Subversion Repositories ALCASAR

Rev

Rev 1300 | Rev 1508 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1300 Rev 1502
Line 121... Line 121...
121
if ($choix == "raz")
121
if ($choix == "raz")
122
	{
122
	{
123
	exec ("sudo /usr/local/sbin/alcasar-mysql.sh --raz");
123
	exec ("sudo /usr/local/sbin/alcasar-mysql.sh --raz");
124
	}
124
	}
125
# un fichier est importé
125
# un fichier est importé
126
if(isset($_FILES['import-users']))
126
if(isset($_FILES['import-users']) && ($_FILES['import-users']['name'] !=""))
127
	{
127
	{
128
	unset($result);
128
	unset($result);
129
	if (isset ($_POST['service'])) $service = $_POST['service'];
129
	if (isset ($_POST['service'])) $service = $_POST['service'];
130
	if (isset ($_POST['groupe'])) $group = $_POST ['groupe'];
130
	if (isset ($_POST['groupe'])) $group = $_POST ['groupe'];
131
	$destination = '/tmp/import_file.txt';
131
	$destination = '/tmp/import_file.txt';
132
	list($name_file , $extension) = explode("." , $_FILES['import-users']['name']); 
132
	list($file_name , $extension) = explode("." , $_FILES['import-users']['name']); 
133
	$extension = strstr($_FILES['import-users']['name'], '.');
133
	$extension = strstr($_FILES['import-users']['name'], '.');
134
	if ($choix == "csv")
134
	if ($choix == "csv")
135
//import d'un fichier txt
135
//import d'un fichier txt
136
		{
136
		{
137
		if (($extension != '.csv') && ($extension != '.txt')) $result = $l_error_ext_txt;
137
		if (($extension != '.csv') && ($extension != '.txt')) $result = $l_error_ext_txt;
Line 145... Line 145...
145
				{
145
				{
146
				if (is_file($LIBpath."crypt/$config[general_encryption_method].php"))
146
				if (is_file($LIBpath."crypt/$config[general_encryption_method].php"))
147
					{
147
					{
148
					include($LIBpath."crypt/$config[general_encryption_method].php");			
148
					include($LIBpath."crypt/$config[general_encryption_method].php");			
149
					$tmpdate = date("Ymd-his");
149
					$tmpdate = date("Ymd-his");
150
					$file_out = "/tmp/$tmpdate-$name_file.pwd" ;
150
					$file_out = "/tmp/$tmpdate-$file_name.pwd" ;
151
					$RS_out = fopen ("$file_out", "wb");
151
					$RS_out = fopen ("$file_out", "wb");
152
					foreach ($RS_in as $no => $ligne)
152
					foreach ($RS_in as $no => $ligne)
153
						{
153
						{
154
						if (substr($ligne,0,3) == pack('CCC',239,187,191)) # remove UTF8-BOM 
154
						if (substr($ligne,0,3) == pack('CCC',239,187,191)) # remove UTF8-BOM 
155
							{
155
							{