/web/acc/admin_log.php |
---|
1,72 → 1,83 |
<HTML> |
<HEAD> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<TITLE>Admin Logs</TITLE> |
<link rel="stylesheet" href="../css/bootstrap.min.css"> |
<script src="../js/jquery.min.js"></script> |
<script src="../js/bootstrap.min.js"></script> |
<style> |
<?php |
# $Id $ |
body { |
background-color: #EFEFEF; |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]), 0, 2)); |
} |
</style> |
</HEAD> |
<body> |
<?php |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
{ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); |
if ($Language === 'fr') { |
$l_title_amdin_log = "Connexion à l'ALCASAR Control Center (ACC)"; |
} else { |
$l_title_amdin_log = "Connection to ALCASAR Control Center (ACC)"; |
} |
if($Language == 'fr') |
{ |
$l_title_amdin_log="Connexion à l'ALCASAR Control Center (ACC)"; |
} |
else |
{ |
$l_title_amdin_log="Connection to ALCASAR Control Center (ACC)"; |
} |
echo '<center><h3>'; |
echo "$l_title_amdin_log"; |
echo '</h3></center><div class="container"><table class="table table-striped">'; |
echo "<thead>"; |
echo "<tr>"; |
echo "<th>Date</th>"; |
echo "<th>User</th>"; |
echo "<th>IP address</th>"; |
echo "</tr>"; |
echo "</thead>"; |
echo "<tbody>"; |
$fichier='admin_log.txt'; |
$pointeur=fopen($fichier,"r"); |
if ($pointeur){ |
while (!feof($pointeur)){ |
$ligne=fgets($pointeur); |
$infos=explode("|||",$ligne); |
echo "<tr>"; |
echo "<td>$infos[0]</td>"; |
echo "<td>$infos[1]</td>"; |
echo "<td>$infos[2]</td>"; |
echo "</tr>"; |
// Read access log |
$accessLogs = []; |
$accessLogFilename = 'admin_log.txt'; |
$filePtn = fopen($accessLogFilename, 'r'); |
if ($filePtn !== false){ |
while (!feof($filePtn)) { |
$ligne = fgets($filePtn); |
if (empty($ligne)) { |
continue; |
} |
$infos = explode('|||', $ligne); |
$accessLogs[] = (object) [ |
'date' => trim($infos[0]), |
'username' => trim($infos[1]), |
'ip' => trim($infos[2]) |
]; |
} |
fclose($filePtn); |
} |
else |
{ |
echo '<tr><center>Empty</center></tr>'; |
} |
fclose($pointeur); |
echo '</tbody></table></div>'; |
$accessLogs = array_reverse($accessLogs); |
?> |
<!doctype html> |
<html> |
<head> |
<meta charset="utf-8"> |
<title>Admin Logs</title> |
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"> |
<style> |
body { |
background-color: #EFEFEF; |
} |
</style> |
<script src="../js/jquery.min.js"></script> |
<script src="../js/bootstrap.min.js"></script> |
</head> |
<body> |
<div class="container"> |
<center> |
<h3><?= $l_title_amdin_log ?></h3> |
</center> |
<table class="table table-striped"> |
<thead> |
<tr> |
<th>Date</th> |
<th>User</th> |
<th>IP address</th> |
</tr> |
</thead> |
<tbody> |
<?php if (empty($accessLogs)): ?> |
<tr> |
<td colspan="3"><center>Empty</center></td> |
</tr> |
<?php else: ?> |
<?php foreach ($accessLogs as $access): ?> |
<tr> |
<td><?= $access->date ?></td> |
<td><?= $access->username ?></td> |
<td><?= $access->ip ?></td> |
</tr> |
<?php endforeach; ?> |
<?php endif; ?> |
</tbody> |
</table> |
</div> |
</body> |
</HTML> |
</html> |
Property changes: |
Added: svn:keywords |
+Id |
\ No newline at end of property |
/web/acc/backup/log_generation.php |
---|
13,6 → 13,7 |
<body> |
<?php |
# $Id $ |
#Cette page permet de générer les journaux d'imputabilité dans une archive avec mot de passe. |
#Lors de la création de cette archive, tous les utilisateurs d'alcasar seront prévenus lors de leur prochaine connexion par un message d'alerte. |
86,7 → 87,7 |
if($password != "" && $demandeur != "" && $raison != "") |
{ |
#Génération de log |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR']."|||"; |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR']; |
#supprimer les nouvelles lignes |
$text = str_replace("\n", ' ', $text); |
$text = str_replace("\r", ' ', $text); |
126,10 → 127,6 |
{ |
echo "$l_error"; |
} |
} |
else |
{ |
159,15 → 156,11 |
echo "<p>$l_demandeur</p><textarea name='demandeur' style=\"height:25px;\"></textarea>"; |
echo "<p>$l_commentary</p><textarea name='comment'></textarea>"; |
echo "<p id=\"query_option\"></br></br><button type=\"submit\" onClick=\"this.classList.add('disabled');\" class=\"btn btn-primary\" name=\"submit\" value=\"query_all\"> $l_submit </button></p>"; |
} |
echo "<br><div style=\"height:1px;background:#717171;border-bottom:1px solid #313030:\"></div>"; |
echo "<h2>$l_logtab</h2>"; |
if(file_exists($filename)){ |
echo "<div class=\"container\">"; |
echo "<table class=\"table table-striped\">"; |
echo "<thead>"; |
179,23 → 172,21 |
echo "</tr>"; |
echo "</thead>"; |
echo "<tbody>"; |
$fichier = fopen($filename, "r"); |
$content = file($filename); |
foreach($content as $line){ |
$fichier = fopen($filename, "r"); |
$content = file($filename); |
$content = array_reverse($content); |
foreach($content as $line){ |
$infos=explode("|||", $line); |
echo "<tr>"; |
echo "<td>$infos[0]</td>"; |
echo "<td>$infos[1]</td>"; |
echo "<td>$infos[2]</td>"; |
echo "<td>$infos[3]</td>"; |
echo "<td>$infos[0]</td>"; |
echo "<td>$infos[1]</td>"; |
echo "<td>$infos[2]</td>"; |
echo "<td>$infos[3]</td>"; |
echo "</tr>"; |
} |
echo "</tbody>"; |
echo "</table>"; |
echo "</div>"; |
} |
echo "</tbody>"; |
echo "</table>"; |
echo "</div>"; |
} |
else |
{ |
389,7 → 380,3 |
</body> |
</html> |
Property changes: |
Added: svn:keywords |
+Id |
\ No newline at end of property |
/web/acc/haut.php |
---|
1,46 → 1,48 |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0"> |
<!-- Writen by Rexy --> |
<!-- ACC Top Window --> |
<HTML> |
<HEAD> |
<TITLE>Top</TITLE> |
<SCRIPT LANGUAGE="JavaScript"> |
function ouvrir(page) |
{ |
window.open(page, "portail", "alwaysRaised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,hotkeys=no,width=640 ,height=480"); |
} |
</SCRIPT> |
<?php |
# $Id$ |
// Access counter incrementation |
$name_fic="compteur.txt"; |
if (($fp=fopen($name_fic,"r")) == false) exit; |
$nb=fgets($fp,10); |
$counterFilename = 'compteur.txt'; |
$fp = fopen($counterFilename, 'r+'); |
if ($fp === false) { |
exit(); |
} |
$nbAccess = intval(fgets($fp, 10)); |
$nbAccess++; |
rewind($fp); |
fputs($fp, $nbAccess.PHP_EOL); |
fclose($fp); |
$nb+=1; |
if (($fp=fopen($name_fic,"w")) == false) exit; |
fputs($fp, "$nb\n"); |
fclose($fp); |
//Inform admin log about his last connection |
$admin_log="admin_log.txt"; |
$user_htdigest=$_SERVER['PHP_AUTH_USER']; |
$date_system=date('d/m/Y H:i:s'); |
$user_ip=$_SERVER["REMOTE_ADDR"]; |
$text=$date_system."|||".$user_htdigest."|||".$user_ip."|||"; |
// Inform admin log about his last connection |
$admin_log = 'admin_log.txt'; |
$user_htdigest = $_SERVER['PHP_AUTH_USER']; |
$date_system = date('d/m/Y H:i:s'); |
$user_ip = $_SERVER['REMOTE_ADDR']; |
$text = $date_system . '|||' . $user_htdigest . '|||' . $user_ip; |
file_put_contents($admin_log, $text.PHP_EOL, FILE_APPEND); |
?> |
<link rel="stylesheet" href="/css/style.css" type="text/css"> |
</HEAD> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<TR> |
<TD valign="top" align="left"><A HREF="javascript:ouvrir('about.htm')"><IMG height="80" border="0" SRC="/images/logo-alcasar.png"></A></TD> |
<TD valign="top" align="center"><A HREF="http://www.alcasar.net" TARGET="_new"><IMG height="80" border="0" SRC="/images/titre-alcasar.png"></A></TD> |
<TD valign="top" align="right"><A HREF="admin/logo.php" TARGET="REXY2"><IMG height="80" border="0" SRC="/images/organisme.png"></A></TD> |
</TR> |
</TABLE> |
</BODY> |
</HTML> |
<!doctype html> |
<!-- Writen by Rexy --> |
<!-- ACC Top Window --> |
<html> |
<head> |
<meta charset="utf-8"> |
<title>Top</title> |
<script> |
function ouvrir(page) { |
window.open(page, "portail", "alwaysRaised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,hotkeys=no,width=640 ,height=480"); |
} |
</script> |
<link rel="stylesheet" type="text/css" href="/css/style.css"> |
</head> |
<body> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr> |
<td valign="top" align="left"><a href="javascript:ouvrir('about.htm')"><img height="80" border="0" src="/images/logo-alcasar.png"></a></td> |
<td valign="top" align="center"><a href="http://www.alcasar.net" target="_new"><img height="80" border="0" src="/images/titre-alcasar.png"></a></td> |
<td valign="top" align="right"><a href="admin/logo.php" target="REXY2"><img height="80" border="0" src="/images/organisme.png"></a></td> |
</tr> |
</table> |
</body> |
</html> |
/web/acc/menu.php |
---|
1,3 → 1,22 |
<?php |
# $Id $ |
define ('CONF_FILE', '/usr/local/etc/alcasar.conf'); |
// Read CONF_FILE |
$file_conf = fopen(CONF_FILE, 'r'); |
if (!$file_conf) { |
exit('Error opening the file '.CONF_FILE); |
} |
while (!feof($file_conf)) { |
$tampon = fgets($file_conf, 4096); |
if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) { |
$tmp = explode('=', $tampon); |
$conf[$tmp[0]] = trim($tmp[1]); |
} |
} |
fclose($file_conf); |
?> |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0"> |
<HTML> |
<!-- written by Rexy ! --> |
29,8 → 48,7 |
exit(); |
} |
// Get current version |
$installed_version = trim(exec("grep ^VERSION /usr/local/etc/alcasar.conf | cut -d'=' -f2")); |
$installed_version = $conf['VERSION']; |
# Choice of language |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
/web/acc/phpsysinfo/includes/xml/portail.php |
---|
29,7 → 29,7 |
$host = "localhost"; |
$DB_USER = "radius"; |
$DB_RADIUS = "radius"; |
$radiuspwd = "J7YI65SW"; |
$radiuspwd = ""; |
// Connexion au serveur |
$mysqli = new mysqli($host, $DB_USER, $radiuspwd, $DB_RADIUS); |
if ($texte == 'user') {$query = "SELECT UserName FROM userinfo";} |
98,9 → 98,25 |
global $webpath; |
global $XPath; |
global $text; |
// Read CONF_FILE |
define ('CONF_FILE', '/usr/local/etc/alcasar.conf'); |
$file_conf = fopen(CONF_FILE, 'r'); |
if (!$file_conf) { |
exit('Error opening the file '.CONF_FILE); |
} |
while (!feof($file_conf)) { |
$tampon = fgets($file_conf, 4096); |
if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) { |
$tmp = explode('=', $tampon); |
$conf[$tmp[0]] = trim($tmp[1]); |
} |
} |
fclose($file_conf); |
exec ("sudo /usr/local/bin/alcasar-watchdog.sh -lt"); |
// Get current version |
$INSTALLEDVERSION = trim(exec("grep ^VERSION /usr/local/etc/alcasar.conf | cut -d'=' -f2")); |
$INSTALLEDVERSION = $conf['VERSION']; |
$VERSIONBL = date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README')); |
$nbr_user = request ('user'); |
$nbr_grp = request ('group'); |