Subversion Repositories ALCASAR

Rev

Rev 1536 | Rev 1952 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1536 Rev 1911
Line 5... Line 5...
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
 
-
 
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
 
10
$file_version = "/var/www/html/VERSION";
33
$file_version = "/var/www/html/VERSION";
11
$handle = fopen ($file_version, "r");
34
$handle = fopen ($file_version, "r");
12
$full_version = fread ($handle, filesize ($file_version));
35
$full_version = fread ($handle, filesize ($file_version));
13
fclose ($handle);
36
fclose ($handle);
14
$tab = explode (" ", $full_version);
37
$tab = explode (" ", $full_version);
Line 45... Line 68...
45
	$l_stat_global_network="Trafic global";
68
	$l_stat_global_network="Trafic global";
46
	$l_stat_detail_network="Trafic détaillé";
69
	$l_stat_detail_network="Trafic détaillé";
47
	$l_security="Sécurité";
70
	$l_security="Sécurité";
48
	$l_menu="Menu";
71
	$l_menu="Menu";
49
	$l_gammu="Auto enregistrement (SMS)";
72
	$l_gammu="Auto enregistrement (SMS)";
-
 
73
	$l_archive="Archivage";
-
 
74
	$l_log="Générer les journaux";
50
}
75
}
51
else
76
else
52
{
77
{
53
	$Language = 'en';
78
	$Language = 'en';
54
	$l_home = "HOME";
79
	$l_home = "HOME";
Line 75... Line 100...
75
	$l_stat_global_network="global trafic";
100
	$l_stat_global_network="global trafic";
76
	$l_stat_detail_network="detailed trafic";
101
	$l_stat_detail_network="detailed trafic";
77
	$l_security="security";
102
	$l_security="security";
78
	$l_menu="Main";
103
	$l_menu="Main";
79
	$l_gammu="Auto registration (SMS)";
104
	$l_gammu="Auto registration (SMS)";
-
 
105
	$l_backup_archive="Archiving";
-
 
106
	$l_backup_log="Log generation";
80
}
107
}
81
echo "
108
echo "
82
	<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=0>
109
	<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=0>
83
	<tr><th>$l_menu</th></tr>
110
	<tr><th>$l_menu</th></tr>
84
	<tr><td bgcolor=\"#FFCC66\"><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
111
	<tr><td bgcolor=\"#FFCC66\"><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
Line 90... Line 117...
90
				<img src=\"/images/right.gif\" height=10 width=10 border=no nosave><A HREF=\"phpsysinfo/\" TARGET=\"REXY2\">$l_home</A></td></tr>";
117
				<img src=\"/images/right.gif\" height=10 width=10 border=no nosave><A HREF=\"phpsysinfo/\" TARGET=\"REXY2\">$l_home</A></td></tr>";
91
if (isset($_GET['a'])) { $a=$_GET['a']; }
118
if (isset($_GET['a'])) { $a=$_GET['a']; }
92
	else $a=0;
119
	else $a=0;
93
if (isset($_GET['b'])) { $b=$_GET['b']; }
120
if (isset($_GET['b'])) { $b=$_GET['b']; }
94
	else $b=0;
121
	else $b=0;
-
 
122
	
-
 
123
switch($right){
-
 
124
	case 1:
95
$selection[0]=$l_system;
125
		$selection[0]=$l_system;
96
$selection[1]=$l_auth;
126
		$selection[1]=$l_auth;
97
$selection[2]=$l_filter;
127
		$selection[2]=$l_filter;
98
$selection[3]=$l_statistics;
128
		$selection[3]=$l_statistics;
-
 
129
		$selection[4]=$l_backup;
99
$fichier[0]="system.php";
130
		$fichier[0]="system.php";
100
$fichier[1]="auth.php";
131
		$fichier[1]="auth.php";
101
$fichier[2]="filtering.php";
132
		$fichier[2]="filtering.php";
102
$fichier[3]="stat.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
 
103
$i=0;
152
$i=0;
104
$nb1=count($selection);
153
$nb1=count($selection);
105
while ($i != $nb1)
154
while ($i != $nb1)
106
  {
155
  {
107
	if ($a==1 AND $i==$b)
156
	if ($a==1 AND $i==$b)
Line 113... Line 162...
113
		{
162
		{
114
		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>";
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>";
115
		}
164
		}
116
	$i++;
165
	$i++;
117
  }
166
  }
118
echo "
167
		
119
			<tr><td valign=\"middle\" align=\"left\">
-
 
120
			<img src=\"/images/right.gif\" height=10 width=10 border=no nosave><A HREF=\"backup/sauvegarde.php\" TARGET=\"REXY2\">$l_backup</A></td></tr>";
-
 
121
?>
168
?>
122
		</TABLE>
169
		</TABLE>
123
	</td></tr>
170
	</td></tr>
124
</TABLE>
171
</TABLE>
125
<br>
172
<br>
Line 159... Line 206...
159
		printf("%d", $nb);
206
		printf("%d", $nb);
160
		?>
207
		?>
161
		<br>depuis le 13/08/2013<br></center></td></tr>
208
		<br>depuis le 13/08/2013<br></center></td></tr>
162
	</TABLE>
209
	</TABLE>
163
	</td></tr>
210
	</td></tr>
-
 
211
	
164
</TABLE>
212
</TABLE>
165
</BODY>
213
</BODY>
166
</HTML>
214
</HTML>
-
 
215