Subversion Repositories ALCASAR

Rev

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

Rev 721 Rev 806
Line 11... Line 11...
11
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
11
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
12
 $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
12
 $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
13
 $Language = strtolower(substr(chop($Langue[0]),0,2));}
13
 $Language = strtolower(substr(chop($Langue[0]),0,2));}
14
if ($Language == 'fr'){
14
if ($Language == 'fr'){
15
 $l_backups = "Sauvegarde";
15
 $l_backups = "Sauvegarde";
16
 $l_user_db_save = "Sauvegarder la base des usagers";
16
 $l_create_user_db_backup = "Sauvegarder la base des usagers";
17
 $l_system_iso = "Créer une image ISO à chaud du système";
17
 $l_create_system_backup = "Créer une archive système";
18
 $l_execute = "Exécuter";
18
 $l_execute = "Exécuter";
19
 $l_warning = "(attention, la création de l'image ISO du système dure plusieurs dizaines de minutes)";
-
 
20
 $l_backup_files = "Fichiers disponibles pour archivage";
19
 $l_backup_files = "Fichiers disponibles pour archivage";
21
 $l_firewall_log = "Journaux du parefeu (Firewall)";
20
 $l_firewall_log = "Journaux du parefeu (Firewall)";
22
 $l_users_db_files = "Base des usagers";
21
 $l_users_db_backups = "Base des usagers";
23
 $l_iso_files = "images ISO du système";
22
 $l_system_backup = "Archive système";
24
 $l_empty = "vide";
23
 $l_empty = "vide";
25
}
24
}
26
else {
25
else {
27
 $l_backups = "Backups";
26
 $l_backups = "Backups";
28
 $l_user_db_save = "Save the users database";
27
 $l_create_user_db_backup = "Save the users database";
29
 $l_system_iso = "Create a system iso image";
28
 $l_create_system_backup = "Create a system backup";
30
 $l_execute = "Execute";
29
 $l_execute = "Execute";
31
 $l_warning = "(warning, the creation of the system iso image takes few minutes)";
-
 
32
 $l_backup_files = "Archive backup files";
30
 $l_backup_files = "Archive backup files";
33
 $l_firewall_log = "Firewall log files";
31
 $l_firewall_log = "Firewall log files";
34
 $l_users_db_files = "Users database";
32
 $l_users_db_backups = "Users database";
35
 $l_iso_files = "System ISO images";
33
 $l_system_backup = "system backup";
36
 $l_empty = "empty";
34
 $l_empty = "empty";
37
}
35
}
38
function taille_fichier($fichier)
36
function taille_fichier($fichier)
39
{
37
{
40
	$taille_fichier = filesize($fichier);
38
	$taille_fichier = filesize($fichier);
Line 54... Line 52...
54
</TABLE>
52
</TABLE>
55
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
53
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
56
	<tr><td valign="middle" align="left">
54
	<tr><td valign="middle" align="left">
57
	<FORM action="sauvegarde.php" method=POST><b>
55
	<FORM action="sauvegarde.php" method=POST><b>
58
		<select name='choix'></b>
56
		<select name='choix'></b>
59
			<option value="sauvegarde_DB"><?echo "$l_user_db_save";?>
57
			<option value="user_DB_backup"><?echo "$l_create_user_db_backup";?>
60
			<option value="image_ISO"><?echo "$l_system_iso";?>
58
			<option value="system_backup"><?echo "$l_create_system_backup";?>
61
		</select>
59
		</select>
62
		<input type=submit value="<?echo "$l_execute";?>">
60
		<input type=submit value="<?echo "$l_execute";?>">
63
	</FORM>
61
	</FORM>
64
	<?echo "$l_warning";?>
-
 
65
	</td></tr>
62
	</td></tr>
66
</TABLE>
63
</TABLE>
67
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
64
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
68
	<tr><th><?echo "$l_backup_files";?></th></tr>
65
	<tr><th><?echo "$l_backup_files";?></th></tr>
69
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
66
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
70
</TABLE>
67
</TABLE>
71
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
68
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
72
	<TR align="center">
69
	<TR align="center">
73
	<TD><b><?echo "$l_firewall_log";?></b></TD>
70
	<TD><b><?echo "$l_firewall_log";?></b></TD>
74
	<TD><b><?echo "$l_users_db_files";?></b></TD>
71
	<TD><b><?echo "$l_users_db_backups";?></b></TD>
75
	<TD><b><?echo "$l_iso_files";?></b></TD>
72
	<TD><b><?echo "$l_system_backup";?></b></TD>
76
	</TR><TR align="center">
73
	</TR><TR align="center">
77
<?
74
<?
78
if (isset($_POST['choix'])){
75
if (isset($_POST['choix'])){
79
	switch ($_POST['choix']){
76
	switch ($_POST['choix']){
80
		case 'sauvegarde_DB' :
77
		case 'user_DB_backup' :
81
			exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
78
			exec ("sudo /usr/local/sbin/alcasar-mysql.sh --dump");
82
		break;
79
		break;
83
		case 'archivage_logs' :
80
		case 'archivage_logs' :
84
			exec ("sudo /usr/local/bin/alcasar-log-export.sh");
81
			exec ("sudo /usr/local/bin/alcasar-log-export.sh");
85
		break;
82
		break;
86
		case 'image_ISO' :
83
		case 'system_backup' :
87
			exec ("sudo /usr/local/bin/alcasar-mondo.sh");
84
			exec ("sudo /usr/local/bin/alcasar-conf.sh --create");
88
		break;
85
		break;
89
	}
86
	}
90
}
87
}
91
$dir[0]="logs/firewall";
88
$dir[0]="logs/firewall";
92
$dir[1]="base";
89
$dir[1]="base";
93
$dir[2]="ISO";
90
$dir[2]="system_backup";
94
$j=0;
91
$j=0;
95
$nb=count($dir);
92
$nb=count($dir);
96
while ($j != $nb)
93
while ($j != $nb)
97
{
94
{
98
	echo "<TD>";
95
	echo "<TD>";