Subversion Repositories ALCASAR

Rev

Rev 1536 | Rev 1952 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

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