eurysco

eurysco is a free and open source project based on PHP language, in order to enhance and simplify the remote administration of Microsoft operating systems with an intuitive, fast and responsive web interface

view my linkedin profileview my linkedin profile :)

Privacy Policy
     

Total sweet donations $23
Help me to support eurysco (^_^) !

Source auditlog





0001 <?php
0002 
0003 include(str_replace('\\server', '', $_SERVER['DOCUMENT_ROOT']) . '\\include\\init_server.php');
0004 
0005 set_time_limit(60);
0006 
0007 if (isset($_POST['cid'])) {
0008 	$cid = $_POST['cid'];
0009 } else {
0010 	$cid = '';
0011 }
0012 
0013 if (isset($_POST['exitcode'])) {
0014 	$exitcode = $_POST['exitcode'];
0015 } else {
0016 	$exitcode = '';
0017 }
0018 
0019 if (isset($_POST['auditlog'])) {
0020 	if ($_POST['auditlog'] != '') {
0021 		$fp = fopen($euryscoinstallpath . '\\audit\\audit-' . date('Ym') . '_' . date('M-Y') . '.log', 'a');
0022 		fwrite($fp, $_POST['auditlog'] . "\r\n");
0023 		fclose($fp);
0024 		$auditsec = explode('     ', $_POST['auditlog']);
0025 		$dbaudit = new SQLite3($euryscoinstallpath . '\\sqlite\\euryscoAudit');
0026 		$dbaudit->busyTimeout(30000);
0027 		$dbaudit->query('PRAGMA page_size = 2048; PRAGMA cache_size = 4000; PRAGMA temp_store = 2; PRAGMA journal_mode = OFF; PRAGMA synchronous = 0;');
0028 		$dbaudit->query('INSERT INTO auditLog (date, cid, user, node, type, description, exitcode) VALUES ("' . trim($auditsec[0]) . '", "' . $cid . '", "' . trim($auditsec[1]) . '", "' . trim($auditsec[2]) . '", "' . trim($auditsec[3]) . '", "' . urlencode(trim($auditsec[4])) . '", "' . $exitcode . '")');
0029 		$dbaudit->close();
0030 		exec('eventcreate.exe /l "Application" /t INFORMATION /so "eurysco Audit : ' . $auditsec[1] . ' : ' . $auditsec[2] . '" /id 1 /d "' . str_replace('"', '\'', $_POST['auditlog']) . '"', $errorarray, $errorlevel);
0031 	}
0032 }
0033 
0034 if (extension_loaded('zlib')) { ob_end_flush(); }
0035 
0036 ?>