Subversion Repositories ALCASAR

Rev

Rev 2009 | Rev 2171 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2009 Rev 2010
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
2
<HTML>
2
<HTML>
3
<!-- written by Rexy ! -->
3
<!-- written by Rexy ! -->
4
<HEAD>
4
<HEAD>
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6
<TITLE>menu</TITLE>
6
<TITLE>menu</TITLE>
7
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
<link rel="stylesheet" href="/css/style.css" type="text/css">
8
</HEAD>
8
</HEAD>
9
<?
9
<?
10
 
10
 
11
//determine le droit de l'utilisateur connecté via htdigest
11
//determine le droit de l'utilisateur connecté via htdigest
12
exec('sudo alcasar-profil.sh -l | cut -d":" -f2 2>&1', $output);
12
exec('sudo alcasar-profil.sh -l | cut -d":" -f2 2>&1', $output);
13
$user_htdigest=$_SERVER['PHP_AUTH_USER'];
13
$user_htdigest=$_SERVER['PHP_AUTH_USER'];
14
 
14
 
15
if(strpos($output[0], $user_htdigest))
15
if(strpos($output[0], $user_htdigest))
16
{
16
{
17
	$right=1;
17
	$right=1;
18
}
18
}
19
elseif(strpos($output[1], $user_htdigest))
19
elseif(strpos($output[1], $user_htdigest))
20
{
20
{
21
	$right=2;
21
	$right=2;
22
}
22
}
23
elseif(strpos($output[2], $user_htdigest))
23
elseif(strpos($output[2], $user_htdigest))
24
{
24
{
25
	$right=3;
25
	$right=3;
26
}
26
}
27
else
27
else
28
{
28
{
29
	exit();
29
	exit();
30
}
30
}
31
 
31
 
32
 
32
 
33
$file_version = "/var/www/html/VERSION";
33
$file_version = "/var/www/html/VERSION";
34
$handle = fopen ($file_version, "r");
34
$handle = fopen ($file_version, "r");
35
$full_version = fread ($handle, filesize ($file_version));
35
$full_version = fread ($handle, filesize ($file_version));
36
fclose ($handle);
36
fclose ($handle);
37
$tab = explode (" ", $full_version);
37
$tab = explode (" ", $full_version);
38
$installed_version = $tab[0];
38
$installed_version = $tab[0];
39
# Choice of language
39
# Choice of language
40
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
40
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
41
{
41
{
42
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
42
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
43
	$Language = strtolower(substr(chop($Langue[0]),0,2));
43
	$Language = strtolower(substr(chop($Langue[0]),0,2));
44
}
44
}
45
if($Language == 'fr')
45
if($Language == 'fr')
46
{
46
{
47
	$l_home = "ACCUEIL";
47
	$l_home = "ACCUEIL";
48
	$l_system = "SYSTÈME";
48
	$l_system = "SYSTÈME";
49
	$l_auth = "AUTHENTIFICATION";
49
	$l_auth = "AUTHENTIFICATION";
50
	$l_filter = "FILTRAGE";
50
	$l_filter = "FILTRAGE";
51
	$l_statistics = "STATISTIQUES";
51
	$l_statistics = "STATISTIQUES";
52
	$l_backup = "SAUVEGARDES";
52
	$l_backup = "SAUVEGARDES";
53
	$l_activity = "Activité";
53
	$l_activity = "Activité";
54
	$l_blacklist = "Liste noire";
54
	$l_blacklist = "Liste noire";
55
	$l_whitelist = "Liste blanche";
55
	$l_whitelist = "Liste blanche";
56
	$l_network = "Réseau";
56
	$l_network = "Réseau";
57
	$l_ldap = "Ldap/A.D.";
57
	$l_ldap = "Ldap/A.D.";
58
	$l_access_nb = "Accès au centre";
58
	$l_access_nb = "Accès au centre";
59
	$l_create_user = "Créer un usager";
59
	$l_create_user = "Créer un usager";
60
	$l_edit_user = "Éditer un usager";
60
	$l_edit_user = "Éditer un usager";
61
	$l_create_group = "Créer un groupe";
61
	$l_create_group = "Créer un groupe";
62
	$l_edit_group = "Éditer un groupe";
62
	$l_edit_group = "Éditer un groupe";
63
	$l_import_empty = "Importer / Vider";
63
	$l_import_empty = "Importer / Vider";
64
	$l_protocols = "Protocoles";
64
	$l_protocols = "Protocoles";
65
	$l_stat_user_day = "Usager/jour";
65
	$l_stat_user_day = "Usager/jour";
66
	$l_stat_con = "Connexions";
66
	$l_stat_con = "Connexions";
67
	$l_stat_daily ="Usage journalier";
67
	$l_stat_daily ="Usage journalier";
68
	$l_stat_global_network="Trafic global";
68
	$l_stat_global_network="Trafic global";
69
	$l_stat_detail_network="Trafic détaillé";
69
	$l_stat_detail_network="Trafic détaillé";
70
	$l_security="Sécurité";
70
	$l_security="Sécurité";
71
	$l_menu="Menu";
71
	$l_menu="Menu";
72
	$l_gammu="Auto enregistrement (SMS)";
72
	$l_gammu="Auto enregistrement (SMS)";
73
	$l_archive="Archivage";
73
	$l_archive="Archivage";
74
	$l_log="Générer les journaux";
74
	$l_log="Générer les journaux";
75
	$l_backup_archive="Archives";
75
	$l_backup_archive="Archives";
76
	$l_activity_report="Rapport d'activité";
76
	$l_activity_report="Rapport d'activité";
-
 
77
	$l_backup_log="Journaux d'imputabilité";
77
}
78
}
78
else
79
else
79
{
80
{
80
	$Language = 'en';
81
	$Language = 'en';
81
	$l_home = "HOME";
82
	$l_home = "HOME";
82
	$l_system = "SYSTEM";
83
	$l_system = "SYSTEM";
83
	$l_auth = "AUTHENTICATION";
84
	$l_auth = "AUTHENTICATION";
84
	$l_filter = "FILTERING";
85
	$l_filter = "FILTERING";
85
	$l_statistics = "STATISTICS";
86
	$l_statistics = "STATISTICS";
86
	$l_backup = "BACKUPS";
87
	$l_backup = "BACKUPS";
87
	$l_activity = "Activity";
88
	$l_activity = "Activity";
88
	$l_blacklist = "Blacklist";
89
	$l_blacklist = "Blacklist";
89
	$l_whitelist = "Whitelist";
90
	$l_whitelist = "Whitelist";
90
	$l_network = "Network";
91
	$l_network = "Network";
91
	$l_ldap = "Ldap/A.D.";
92
	$l_ldap = "Ldap/A.D.";
92
	$l_access_nb = "Access to center";
93
	$l_access_nb = "Access to center";
93
	$l_create_user = "Create a user";
94
	$l_create_user = "Create a user";
94
	$l_edit_user = "Edit a user";
95
	$l_edit_user = "Edit a user";
95
	$l_create_group = "Create a group";
96
	$l_create_group = "Create a group";
96
	$l_edit_group = "Edit a group";
97
	$l_edit_group = "Edit a group";
97
	$l_import_empty = "Import / Empty";
98
	$l_import_empty = "Import / Empty";
98
	$l_protocols= "Protocols";
99
	$l_protocols= "Protocols";
99
	$l_stat_user_day = "user/day";
100
	$l_stat_user_day = "user/day";
100
	$l_stat_con = "connections";
101
	$l_stat_con = "connections";
101
	$l_stat_daily ="daily use";
102
	$l_stat_daily ="daily use";
102
	$l_stat_global_network="global trafic";
103
	$l_stat_global_network="global trafic";
103
	$l_stat_detail_network="detailed trafic";
104
	$l_stat_detail_network="detailed trafic";
104
	$l_security="security";
105
	$l_security="security";
105
	$l_menu="Main";
106
	$l_menu="Main";
106
	$l_gammu="Auto registration (SMS)";
107
	$l_gammu="Auto registration (SMS)";
107
	$l_backup_archive="Archives";
108
	$l_backup_archive="Archives";
108
	$l_backup_log="Log generation";
109
	$l_backup_log="Log generation";
109
	$l_activity_report="Activity report";
110
	$l_activity_report="Activity report";
110
}
111
}
111
echo "
112
echo "
112
	<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=0>
113
	<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=0>
113
	<tr><th>$l_menu</th></tr>
114
	<tr><th>$l_menu</th></tr>
114
	<tr><td bgcolor=\"#FFCC66\"><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
115
	<tr><td bgcolor=\"#FFCC66\"><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
115
</TABLE>
116
</TABLE>
116
<TABLE width=\"100%\" border=1 cellspacing=0 cellpadding=0>
117
<TABLE width=\"100%\" border=1 cellspacing=0 cellpadding=0>
117
	<tr bgcolor=\"#666666\"><td>
118
	<tr bgcolor=\"#666666\"><td>
118
		<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=2>
119
		<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=2>
119
			<tr><td valign=\"middle\" align=\"left\">
120
			<tr><td valign=\"middle\" align=\"left\">
120
				<img src=\"/images/right.gif\" height=10 width=10 border=no nosave><A HREF=\"phpsysinfo/\" TARGET=\"REXY2\">$l_home</A></td></tr>";
121
				<img src=\"/images/right.gif\" height=10 width=10 border=no nosave><A HREF=\"phpsysinfo/\" TARGET=\"REXY2\">$l_home</A></td></tr>";
121
if (isset($_GET['a'])) { $a=$_GET['a']; }
122
if (isset($_GET['a'])) { $a=$_GET['a']; }
122
	else $a=0;
123
	else $a=0;
123
if (isset($_GET['b'])) { $b=$_GET['b']; }
124
if (isset($_GET['b'])) { $b=$_GET['b']; }
124
	else $b=0;
125
	else $b=0;
125
	
126
	
126
switch($right){
127
switch($right){
127
	case 1: #admin
128
	case 1: #admin
128
		$selection[0]=$l_system;
129
		$selection[0]=$l_system;
129
		$selection[1]=$l_auth;
130
		$selection[1]=$l_auth;
130
		$selection[2]=$l_filter;
131
		$selection[2]=$l_filter;
131
		$selection[3]=$l_statistics;
132
		$selection[3]=$l_statistics;
132
		$selection[4]=$l_backup;
133
		$selection[4]=$l_backup;
133
		$fichier[0]="system.php";
134
		$fichier[0]="system.php";
134
		$fichier[1]="auth.php";
135
		$fichier[1]="auth.php";
135
		$fichier[2]="filtering.php";
136
		$fichier[2]="filtering.php";
136
		$fichier[3]="stat.php";
137
		$fichier[3]="stat.php";
137
		$fichier[4]="backup.php";
138
		$fichier[4]="backup.php";
138
		break;
139
		break;
139
	case 2: #backup
140
	case 2: #backup
140
		$selection[0]=$l_backup;
141
		$selection[0]=$l_backup;
141
		$fichier[0]="backup.php";
142
		$fichier[0]="backup.php";
142
		break;
143
		break;
143
	case 3: #manager
144
	case 3: #manager
144
		$selection[0]=$l_auth;
145
		$selection[0]=$l_auth;
145
		$fichier[0]="auth.php";
146
		$fichier[0]="auth.php";
146
		break;
147
		break;
147
	default:
148
	default:
148
		exit();
149
		exit();
149
		break;
150
		break;
150
 
151
 
151
}
152
}
152
 
153
 
153
$i=0;
154
$i=0;
154
$nb1=count($selection);
155
$nb1=count($selection);
155
while ($i != $nb1)
156
while ($i != $nb1)
156
  {
157
  {
157
	if ($a==1 AND $i==$b)
158
	if ($a==1 AND $i==$b)
158
		{
159
		{
159
		echo "<tr><td valign=\"middle\" align=\"left\"><img src=\"/images/down2.gif\" height=10 width=10 border=no nosave><a href=\"menu.php?a=0&b=0\"><font color=\"black\"><b>$selection[$i]</b></font></a></td></tr>";
160
		echo "<tr><td valign=\"middle\" align=\"left\"><img src=\"/images/down2.gif\" height=10 width=10 border=no nosave><a href=\"menu.php?a=0&b=0\"><font color=\"black\"><b>$selection[$i]</b></font></a></td></tr>";
160
		include($fichier[$i]);
161
		include($fichier[$i]);
161
		}
162
		}
162
	else
163
	else
163
		{
164
		{
164
		echo "<tr><td valign=\"middle\" align=\"left\"><img src=\"/images/right.gif\" height=10 width=10 border=no nosave><a href=\"menu.php?a=1&b=$i\">$selection[$i]</a></td></tr>";
165
		echo "<tr><td valign=\"middle\" align=\"left\"><img src=\"/images/right.gif\" height=10 width=10 border=no nosave><a href=\"menu.php?a=1&b=$i\">$selection[$i]</a></td></tr>";
165
		}
166
		}
166
	$i++;
167
	$i++;
167
  }
168
  }
168
		
169
		
169
?>
170
?>
170
		</TABLE>
171
		</TABLE>
171
	</td></tr>
172
	</td></tr>
172
</TABLE>
173
</TABLE>
173
<br>
174
<br>
174
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
175
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
175
	<tr><th>Doc</th></tr>
176
	<tr><th>Doc</th></tr>
176
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
177
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
177
height="2"></td></tr>
178
height="2"></td></tr>
178
</TABLE>
179
</TABLE>
179
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
180
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
180
	<tr bgcolor="#666666"><td>
181
	<tr bgcolor="#666666"><td>
181
		<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
182
		<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
182
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
183
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
183
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-presentation-$Language.pdf"; ?>" target="_blank">Presentation</a></td></tr>
184
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-presentation-$Language.pdf"; ?>" target="_blank">Presentation</a></td></tr>
184
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
185
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
185
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-installation-$Language.pdf"; ?>" target="_blank">Installation</a></td></tr>
186
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-installation-$Language.pdf"; ?>" target="_blank">Installation</a></td></tr>
186
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
187
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
187
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-exploitation-$Language.pdf"; ?>" target="_blank">Exploitation</a></td></tr>
188
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-exploitation-$Language.pdf"; ?>" target="_blank">Exploitation</a></td></tr>
188
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
189
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
189
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-technique.pdf"; ?>" target="_blank">Technique</a></td></tr>
190
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-technique.pdf"; ?>" target="_blank">Technique</a></td></tr>
190
		</TABLE>
191
		</TABLE>
191
	</td></tr>
192
	</td></tr>
192
</TABLE>
193
</TABLE>
193
<BR>
194
<BR>
194
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
195
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
195
	<tr><th><? echo "$l_access_nb"; ?></th></tr>
196
	<tr><th><? echo "$l_access_nb"; ?></th></tr>
196
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
197
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
197
</TABLE>
198
</TABLE>
198
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
199
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
199
	<tr bgcolor="#666666"><td>
200
	<tr bgcolor="#666666"><td>
200
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
201
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
201
		<tr><td valign="middle" align="center">
202
		<tr><td valign="middle" align="center">
202
		<?				// Access counter
203
		<?				// Access counter
203
		$name_fic="compteur.txt";
204
		$name_fic="compteur.txt";
204
		if (($fp=fopen($name_fic,"r")) == false) exit;
205
		if (($fp=fopen($name_fic,"r")) == false) exit;
205
		$nb=fgets($fp,10);
206
		$nb=fgets($fp,10);
206
		fclose($fp);
207
		fclose($fp);
207
		printf("%d", $nb);
208
		printf("%d", $nb);
208
		?>
209
		?>
209
		<br>depuis le 13/08/2013<br></center></td></tr>
210
		<br>depuis le 13/08/2013<br></center></td></tr>
210
	</TABLE>
211
	</TABLE>
211
	</td></tr>
212
	</td></tr>
212
	
213
	
213
</TABLE>
214
</TABLE>
214
</BODY>
215
</BODY>
215
</HTML>
216
</HTML>
216
 
217
 
217
 
218