Subversion Repositories ALCASAR

Rev

Rev 2171 | Rev 2222 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

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