Subversion Repositories ALCASAR

Rev

Rev 2093 | Rev 2182 | 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
 
2171 tom.houday 32
// Get current version
33
$installed_version = trim(exec("grep ^VERSION /usr/local/etc/alcasar.conf | cut -d'=' -f2"));
1911 raphael.pi 34
 
374 richard 35
# Choice of language
1325 richard 36
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
37
{
38
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
39
	$Language = strtolower(substr(chop($Langue[0]),0,2));
374 richard 40
}
1325 richard 41
if($Language == 'fr')
42
{
43
	$l_home = "ACCUEIL";
44
	$l_system = "SYSTÈME";
45
	$l_auth = "AUTHENTIFICATION";
46
	$l_filter = "FILTRAGE";
47
	$l_statistics = "STATISTIQUES";
48
	$l_backup = "SAUVEGARDES";
49
	$l_activity = "Activité";
1521 richard 50
	$l_blacklist = "Liste noire";
51
	$l_whitelist = "Liste blanche";
1536 richard 52
	$l_network = "Réseau";
1325 richard 53
	$l_ldap = "Ldap/A.D.";
54
	$l_access_nb = "Accès au centre";
55
	$l_create_user = "Créer un usager";
56
	$l_edit_user = "Éditer un usager";
57
	$l_create_group = "Créer un groupe";
58
	$l_edit_group = "Éditer un groupe";
59
	$l_import_empty = "Importer / Vider";
1521 richard 60
	$l_protocols = "Protocoles";
1536 richard 61
	$l_stat_user_day = "Usager/jour";
62
	$l_stat_con = "Connexions";
63
	$l_stat_daily ="Usage journalier";
64
	$l_stat_global_network="Trafic global";
65
	$l_stat_detail_network="Trafic détaillé";
66
	$l_security="Sécurité";
1325 richard 67
	$l_menu="Menu";
1349 richard 68
	$l_gammu="Auto enregistrement (SMS)";
1911 raphael.pi 69
	$l_archive="Archivage";
70
	$l_log="Générer les journaux";
1952 raphael.pi 71
	$l_backup_archive="Archives";
2009 raphael.pi 72
	$l_activity_report="Rapport d'activité";
2010 raphael.pi 73
	$l_backup_log="Journaux d'imputabilité";
374 richard 74
}
1325 richard 75
else
76
{
77
	$Language = 'en';
78
	$l_home = "HOME";
79
	$l_system = "SYSTEM";
80
	$l_auth = "AUTHENTICATION";
81
	$l_filter = "FILTERING";
82
	$l_statistics = "STATISTICS";
83
	$l_backup = "BACKUPS";
84
	$l_activity = "Activity";
1521 richard 85
	$l_blacklist = "Blacklist";
86
	$l_whitelist = "Whitelist";
1536 richard 87
	$l_network = "Network";
1325 richard 88
	$l_ldap = "Ldap/A.D.";
89
	$l_access_nb = "Access to center";
90
	$l_create_user = "Create a user";
91
	$l_edit_user = "Edit a user";
92
	$l_create_group = "Create a group";
93
	$l_edit_group = "Edit a group";
94
	$l_import_empty = "Import / Empty";
1521 richard 95
	$l_protocols= "Protocols";
1325 richard 96
	$l_stat_user_day = "user/day";
97
	$l_stat_con = "connections";
98
	$l_stat_daily ="daily use";
1536 richard 99
	$l_stat_global_network="global trafic";
100
	$l_stat_detail_network="detailed trafic";
1325 richard 101
	$l_security="security";
102
	$l_menu="Main";
1349 richard 103
	$l_gammu="Auto registration (SMS)";
1952 raphael.pi 104
	$l_backup_archive="Archives";
1911 raphael.pi 105
	$l_backup_log="Log generation";
2009 raphael.pi 106
	$l_activity_report="Activity report";
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){
2002 raphael.pi 124
	case 1: #admin
1911 raphael.pi 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;
2002 raphael.pi 136
	case 2: #backup
1911 raphael.pi 137
		$selection[0]=$l_backup;
138
		$fichier[0]="backup.php";
139
		break;
2002 raphael.pi 140
	case 3: #manager
1911 raphael.pi 141
		$selection[0]=$l_auth;
142
		$fichier[0]="auth.php";
143
		break;
144
	default:
145
		exit();
146
		break;
147
 
148
}
149
 
374 richard 150
$i=0;
151
$nb1=count($selection);
152
while ($i != $nb1)
153
  {
154
	if ($a==1 AND $i==$b)
155
		{
156
		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>";
157
		include($fichier[$i]);
158
		}
159
	else
160
		{
161
		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>";
162
		}
163
	$i++;
164
  }
1911 raphael.pi 165
 
374 richard 166
?>
167
		</TABLE>
168
	</td></tr>
169
</TABLE>
170
<br>
171
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
172
	<tr><th>Doc</th></tr>
173
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
174
height="2"></td></tr>
175
</TABLE>
176
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
177
	<tr bgcolor="#666666"><td>
178
		<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
179
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
811 richard 180
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-presentation-$Language.pdf"; ?>" target="_blank">Presentation</a></td></tr>
374 richard 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-installation-$Language.pdf"; ?>" target="_blank">Installation</a></td></tr>
374 richard 183
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
1025 richard 184
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-exploitation-$Language.pdf"; ?>" target="_blank">Exploitation</a></td></tr>
686 richard 185
			<tr><td valign="middle" align="left"><img src="/images/right.gif" height=10
186
width=10 border=no nosave><a href="<? echo "alcasar-$installed_version-technique.pdf"; ?>" target="_blank">Technique</a></td></tr>
374 richard 187
		</TABLE>
188
	</td></tr>
189
</TABLE>
190
<BR>
191
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
192
	<tr><th><? echo "$l_access_nb"; ?></th></tr>
193
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
194
</TABLE>
195
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
196
	<tr bgcolor="#666666"><td>
197
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
198
		<tr><td valign="middle" align="center">
2093 raphael.pi 199
		<a href="admin_log.php" target="REXY2" >
589 richard 200
		<?				// Access counter
2093 raphael.pi 201
			$name_fic="compteur.txt";
202
			if (($fp=fopen($name_fic,"r")) == false) exit;
203
			$nb=fgets($fp,10);
204
			fclose($fp);
205
			printf("%d", $nb);
374 richard 206
		?>
2093 raphael.pi 207
 
208
		</a>
1163 crox53 209
		<br>depuis le 13/08/2013<br></center></td></tr>
374 richard 210
	</TABLE>
211
	</td></tr>
1911 raphael.pi 212
 
374 richard 213
</TABLE>
214
</BODY>
215
</HTML>
1911 raphael.pi 216
 
2093 raphael.pi 217