Line 1... |
Line 1... |
1 |
<!DOCTYPE html>
|
1 |
<!DOCTYPE html>
|
- |
|
2 |
<html>
|
- |
|
3 |
<head>
|
2 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
3 |
<TITLE>ALCASAR Report</TITLE>
|
5 |
<title>ALCASAR Report</title>
|
4 |
<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css">
|
6 |
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
- |
|
7 |
<link rel="stylesheet" href="/css/acc.css">
|
5 |
<script src="../../../js/jquery.min.js"></script>
|
8 |
<script src="/js/jquery.min.js"></script>
|
6 |
<script src="../../../js/bootstrap.min.js"></script>
|
9 |
<script src="/js/bootstrap.min.js"></script>
|
7 |
<link rel="stylesheet" href="../manager/htdocs/style.css">
|
- |
|
8 |
<style>
|
- |
|
9 |
body{
|
- |
|
10 |
background-color: #EFEFEF;
|
- |
|
11 |
}
|
- |
|
12 |
</style>
|
- |
|
13 |
</HEAD>
|
10 |
</head>
|
14 |
<body>
|
11 |
<body>
|
15 |
|
- |
|
16 |
<?php
|
12 |
<?php
|
17 |
# $Id $
|
- |
|
18 |
|
- |
|
19 |
#Cette page permet de générer les journaux d'imputabilité dans une archive avec mot de passe.
|
13 |
# Cette page permet de générer les journaux d'imputabilité dans une archive avec mot de passe.
|
20 |
#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.
|
14 |
# 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.
|
21 |
#Cette page a été créé suite à la demande d'une préfecture de police afin de faciliter le déroulement des affaires judiciaires UNIQUEMENT.
|
- |
|
22 |
|
- |
|
23 |
|
15 |
|
24 |
# Choice of language
|
16 |
# Choice of language
|
25 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
17 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
26 |
{
|
18 |
{
|
27 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
19 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
28 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
20 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
29 |
}
|
21 |
}
|
30 |
if($Language == 'fr')
|
22 |
if($Language == 'fr')
|
31 |
{
|
23 |
{
|
- |
|
24 |
$l_title = "Journaux d'imputabilité";
|
32 |
$l_info = "Génération des journaux d'imputabilité";
|
25 |
$l_info = "Génération des journaux d'imputabilité";
|
33 |
$l_log_info = "Vous allez générer un document réservé aux autorités dans le cadre d'une requête judiciaire ou administrative. Tout les utilisateurs seront avertis de la génération de ce document.";
|
26 |
$l_log_info = "Vous allez générer un document réservé aux autorités dans le cadre d'une requête judiciaire ou administrative. Tout les utilisateurs seront avertis de la génération de ce document.";
|
34 |
$l_password = "Entrez votre mot de passe afin de protéger l'archive contenant le document généré";
|
27 |
$l_password = "Entrez votre mot de passe afin de protéger l'archive contenant le document généré";
|
35 |
$l_submit = "Continuer";
|
28 |
$l_submit = "Continuer";
|
36 |
$l_date1="Commençant le ...";
|
29 |
$l_date1="Commençant le ...";
|
Line 51... |
Line 44... |
51 |
$l_empty_log="Les journaux sont vides";
|
44 |
$l_empty_log="Les journaux sont vides";
|
52 |
|
45 |
|
53 |
}
|
46 |
}
|
54 |
else
|
47 |
else
|
55 |
{
|
48 |
{
|
- |
|
49 |
$l_title = "Imputabilities logs";
|
56 |
$l_info = "Imputabilities logs generation";
|
50 |
$l_info = "Imputabilities logs generation";
|
57 |
$l_log_info = "You are in progress to generate a document reserved for a judicial or administrative investigation. All users will be warned.";
|
51 |
$l_log_info = "You are in progress to generate a document reserved for a judicial or administrative investigation. All users will be warned.";
|
58 |
$l_password = "Enter your password to protect the archive which contains the document.";
|
52 |
$l_password = "Enter your password to protect the archive which contains the document.";
|
59 |
$l_submit = "Proceed";
|
53 |
$l_submit = "Proceed";
|
60 |
$l_date1="Start at ...";
|
54 |
$l_date1="Start at ...";
|
Line 72... |
Line 66... |
72 |
$l_commentary="Reason :";
|
66 |
$l_commentary="Reason :";
|
73 |
$l_info_form="User Information";
|
67 |
$l_info_form="User Information";
|
74 |
$l_logtab="Last entries :";
|
68 |
$l_logtab="Last entries :";
|
75 |
$l_empty_log="Logs are empty";
|
69 |
$l_empty_log="Logs are empty";
|
76 |
}
|
70 |
}
|
77 |
|
- |
|
78 |
|
- |
|
79 |
$filename='/var/www/html/acc/backup/log_info.txt';
|
71 |
$filename='/var/www/html/acc/backup/log_info.txt';
|
80 |
|
- |
|
81 |
if(isset($_POST['submit']))
|
72 |
if(isset($_POST['submit']))
|
82 |
{
|
73 |
{
|
83 |
$password=$_POST['password'];
|
74 |
$password=$_POST['password'];
|
84 |
$demandeur=$_POST['demandeur'];
|
75 |
$demandeur=$_POST['demandeur'];
|
85 |
$raison=$_POST['comment'];
|
76 |
$raison=$_POST['comment'];
|
86 |
#si le mot de passe est vide ou si il contient des espaces
|
77 |
# si le mot de passe est vide ou si il contient des espaces
|
87 |
if($password != "" && $demandeur != "" && $raison != "")
|
78 |
if($password != "" && $demandeur != "" && $raison != "")
|
88 |
{
|
79 |
{
|
89 |
#Génération de log
|
80 |
# Génération de log
|
90 |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR'];
|
81 |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR'];
|
91 |
#supprimer les nouvelles lignes
|
82 |
# supprimer les nouvelles lignes
|
92 |
$text = str_replace("\n", ' ', $text);
|
83 |
$text = str_replace("\n", ' ', $text);
|
93 |
$text = str_replace("\r", ' ', $text);
|
84 |
$text = str_replace("\r", ' ', $text);
|
94 |
|
- |
|
95 |
|
- |
|
96 |
file_put_contents($filename, $text.PHP_EOL, FILE_APPEND);
|
85 |
file_put_contents($filename, $text.PHP_EOL, FILE_APPEND);
|
97 |
|
- |
|
98 |
|
- |
|
99 |
|
- |
|
100 |
#Création des journaux dans une archive avec mot de passe.
|
86 |
# Création des journaux dans une archive avec mot de passe.
|
101 |
$filename_logs="imputabilities_logs.zip";
|
87 |
$filename_logs="imputabilities_logs.zip";
|
102 |
switch($_POST['submit'])
|
88 |
switch($_POST['submit'])
|
103 |
{
|
89 |
{
|
104 |
case 'query_all':
|
90 |
case 'query_all':
|
105 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password));
|
91 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password));
|
Line 111... |
Line 97... |
111 |
break;
|
97 |
break;
|
112 |
case 'query_simple':
|
98 |
case 'query_simple':
|
113 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
99 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
114 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected));
|
100 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected));
|
115 |
break;
|
101 |
break;
|
116 |
|
- |
|
117 |
}
|
102 |
}
|
118 |
|
- |
|
119 |
|
- |
|
120 |
#Interface permettant de télécharger les journaux d'imputabilité
|
103 |
# Interface permettant de télécharger les journaux d'imputabilité
|
121 |
echo "<h3>$l_create</h3>";
|
104 |
echo "<h3>$l_create</h3>";
|
122 |
echo "<a href=\"$filename_logs\" class=\"btn btn-info btn-lg\">";
|
105 |
echo "<a href=\"$filename_logs\" class=\"btn btn-info btn-lg\">";
|
123 |
echo " <span class=\"glyphicon glyphicon-download-alt\"></span> $l_download";
|
106 |
echo " <span class=\"glyphicon glyphicon-download-alt\"></span> $l_download";
|
124 |
echo "</a>";
|
107 |
echo "</a>";
|
125 |
}
|
108 |
}
|
Line 128... |
Line 111... |
128 |
echo "$l_error";
|
111 |
echo "$l_error";
|
129 |
}
|
112 |
}
|
130 |
}
|
113 |
}
|
131 |
else
|
114 |
else
|
132 |
{
|
115 |
{
|
133 |
#Interface permettant de configurer la génération des journaux d'imputabilité.
|
116 |
# Interface permettant de configurer la génération des journaux d'imputabilité.
|
134 |
|
- |
|
135 |
echo "<table class=\"tableTop\" border='0' cellspacing='0' cellpadding='0'>";
|
- |
|
136 |
echo "<tbody >";
|
- |
|
137 |
echo " <tr>";
|
- |
|
138 |
echo "<th class='thBasicACC'>";
|
117 |
echo "<div class=\"panel\">\n";
|
139 |
echo "ALCASAR Report";
|
- |
|
140 |
echo "</th>";
|
- |
|
141 |
echo "</tr>";
|
- |
|
142 |
echo "</tbody>";
|
- |
|
143 |
echo "<tr bgcolor='#FFCC66'><td class=\"tdSizeACC\">
|
118 |
echo "<div class=\"panel-header\">$l_title</div>";
|
144 |
<img src='/images/pix.gif' width='1' height='2'></td></tr>";
|
- |
|
145 |
echo "</table>";
|
- |
|
146 |
echo "<div class =\"frameBorderACC\">";
|
119 |
echo "<div class=\"panel-row\">";
|
147 |
echo " <div style=\"margin-top:16px;margin-left:15px;\">";
|
120 |
echo " <div style=\"margin-top:16px;margin-left:15px;\">";
|
148 |
echo " <div>";
|
121 |
echo " <div>";
|
149 |
|
- |
|
150 |
echo " <fieldset>";
|
122 |
echo " <fieldset>";
|
151 |
echo " <h3>$l_info</h3>";
|
123 |
echo " <h3>$l_info</h3>";
|
152 |
echo " <p>$l_log_info</p>";
|
124 |
echo " <p>$l_log_info</p>";
|
153 |
echo " </fieldset>";
|
125 |
echo " </fieldset>";
|
154 |
|
- |
|
155 |
echo "<h4> $l_options_info </h4>";
|
126 |
echo "<h4> $l_options_info </h4>";
|
156 |
echo "<div class=\"radio\">";
|
127 |
echo "<div class=\"radio\">";
|
157 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact1()\" style=\"margin-top: -1px;\" checked> $l_options_1 </label>";
|
128 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact1()\" style=\"margin-top: -1px;\" checked> $l_options_1 </label>";
|
158 |
echo "</div>";
|
129 |
echo "</div>";
|
159 |
echo "<div class=\"radio\">";
|
130 |
echo "<div class=\"radio\">";
|
Line 167... |
Line 138... |
167 |
echo "<h2>$l_info_form</h2>";
|
138 |
echo "<h2>$l_info_form</h2>";
|
168 |
echo "<p>$l_demandeur</p><textarea name='demandeur' style=\"height:25px;\"></textarea>";
|
139 |
echo "<p>$l_demandeur</p><textarea name='demandeur' style=\"height:25px;\"></textarea>";
|
169 |
echo "<p>$l_commentary</p><textarea name='comment'></textarea>";
|
140 |
echo "<p>$l_commentary</p><textarea name='comment'></textarea>";
|
170 |
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>";
|
141 |
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>";
|
171 |
}
|
142 |
}
|
172 |
|
- |
|
173 |
echo "<br><div style=\"height:1px;background:#717171;border-bottom:1px solid #313030:\"></div>";
|
143 |
echo "<br><div style=\"height:1px;background:#717171;border-bottom:1px solid #313030:\"></div>";
|
174 |
echo "<h2>$l_logtab</h2>";
|
144 |
echo "<h2>$l_logtab</h2>";
|
175 |
if(file_exists($filename)){
|
145 |
if(file_exists($filename)){
|
176 |
echo "<div class=\"container\">";
|
146 |
echo "<div class=\"container\">";
|
177 |
echo "<table class=\"table table-striped\">";
|
147 |
echo "<table class=\"table table-striped\">";
|
Line 387... |
Line 357... |
387 |
echo "</form>";
|
357 |
echo "</form>";
|
388 |
echo "</div>";
|
358 |
echo "</div>";
|
389 |
echo "</div>";
|
359 |
echo "</div>";
|
390 |
echo "</div>";
|
360 |
echo "</div>";
|
391 |
?>
|
361 |
?>
|
392 |
|
362 |
</div>
|
393 |
</body>
|
363 |
</body>
|
394 |
</html>
|
364 |
</html>
|