Subversion Repositories ALCASAR

Rev

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

Rev 1583 Rev 1827
Line 118... Line 118...
118
$link = @da_sql_pconnect($config);
118
$link = @da_sql_pconnect($config);
119
if (isset ($_POST ['choix'])) {	$choix = $_POST ['choix']; }
119
if (isset ($_POST ['choix'])) {	$choix = $_POST ['choix']; }
120
	else { $choix = ''; }
120
	else { $choix = ''; }
121
if ($choix == "raz")
121
if ($choix == "raz")
122
	{
122
	{
123
	exec ("sudo /usr/local/sbin/alcasar-logout.sh all");
123
	exec ("sudo /usr/local/bin/alcasar-logout.sh all");
124
	exec ("sudo /usr/local/sbin/alcasar-mysql.sh --raz");
124
	exec ("sudo /usr/local/bin/alcasar-mysql.sh --raz");
125
	}
125
	}
126
// a file is downloaded
126
// a file is downloaded
127
if(isset($_FILES['import-users']) && ($_FILES['import-users']['name'] !=""))
127
if(isset($_FILES['import-users']) && ($_FILES['import-users']['name'] !=""))
128
	{
128
	{
129
	unset($result);
129
	unset($result);
Line 133... Line 133...
133
		{
133
		{
134
		if (($extension != 'csv') && ($extension != 'txt')) $result = $l_error_ext_txt;
134
		if (($extension != 'csv') && ($extension != 'txt')) $result = $l_error_ext_txt;
135
		else 
135
		else 
136
			{
136
			{
137
			$destination = '/tmp/import_file.txt';
137
			$destination = '/tmp/import_file.txt';
138
			exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
138
			exec ("sudo /usr/local/bin/alcasar-mysql.sh --dump");
139
			move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
139
			move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
140
			$RS_in   = file ($destination);
140
			$RS_in   = file ($destination);
141
			$da_abort=0;
141
			$da_abort=0;
142
			if ($link)
142
			if ($link)
143
				{
143
				{
Line 227... Line 227...
227
	else if ($choix == "bdd") // database import
227
	else if ($choix == "bdd") // database import
228
		{
228
		{
229
		if (($extension == 'sql') || ($extension == 'sql.gz')) 
229
		if (($extension == 'sql') || ($extension == 'sql.gz')) 
230
			{
230
			{
231
			$destination = '/tmp/import_file.'.$extension;
231
			$destination = '/tmp/import_file.'.$extension;
232
			exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
232
			exec ("sudo /usr/local/bin/alcasar-mysql.sh --dump");
233
			move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
233
			move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
234
			exec ("sudo /usr/local/sbin/alcasar-mysql.sh --import $destination");
234
			exec ("sudo /usr/local/bin/alcasar-mysql.sh --import $destination");
235
			//echo "OK : $destination";
235
			//echo "OK : $destination";
236
			unlink ($destination);
236
			unlink ($destination);
237
			}
237
			}
238
		else $result = $l_error_ext_sql;
238
		else $result = $l_error_ext_sql;
239
		}
239
		}