Subversion Repositories ALCASAR

Rev

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

Rev 830 Rev 833
Line 17... Line 17...
17
 *   along with this program; if not, write to the                         *
17
 *   along with this program; if not, write to the                         *
18
 *   Free Software Foundation, Inc.,                                       *
18
 *   Free Software Foundation, Inc.,                                       *
19
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20
 ***************************************************************************/
20
 ***************************************************************************/
21
 
21
 
22
// $Id: portail.php 830 2012-03-03 17:26:04Z richard $
22
// $Id: portail.php 833 2012-03-10 23:29:08Z franck $
23
 
23
 
24
// xml_utilisateur()
24
// xml_utilisateur()
25
 
25
 
26
function request ($texte) {
26
function request ($texte) {
27
		$strResult = 0;
27
		$strResult = 0;
Line 54... Line 54...
54
	$_text .= "  </Portail>\n";
54
	$_text .= "  </Portail>\n";
55
	
55
	
56
	return $_text;
56
	return $_text;
57
} 
57
} 
58
// Fonction de test de connectivité internet
58
// Fonction de test de connectivité internet
59
function internetTest(){
59
function internetTest($INSTALLEDVERSION){
60
        $host = "www.google.com";  # Google Test
60
        $host = "www.google.com";  # Google Test
61
        $host2 = "www.alcasar.net";
61
        $host2 = "www.alcasar.net";
62
        $port = "80";
62
        $port = "80";
63
        //var $num;     //non utilisé
63
        //var $num;     //non utilisé
64
        //var $error;   //non utilisé
64
        //var $error;   //non utilisé
Line 68... Line 68...
68
		}
68
		}
69
	else 	{   
69
	else 	{   
70
		fclose($sock);
70
		fclose($sock);
71
		$sock = fsockopen($host2, $port, $num, $error, 2);
71
		$sock = fsockopen($host2, $port, $num, $error, 2);
72
		if ($sock){
72
		if ($sock){
73
                	fputs($sock,"GET http://$host2/images/M_images/weblink24.png HTTP/1.0\n\n");
73
                	fputs($sock,"GET http://$host2/images/M_images/weblink$INSTALLEDVERSION.png HTTP/1.0\n\n");
74
			fclose($sock); }
74
			fclose($sock); }
75
		return true;
75
		return true;
76
		}
76
		}
77
}
77
}
78
// Fonction de test du filtrage
78
// Fonction de test du filtrage
Line 118... Line 118...
118
		$web_filter_status = $text['enable'];}
118
		$web_filter_status = $text['enable'];}
119
	else {	$web_filter_status = $text['disable'];}
119
	else {	$web_filter_status = $text['disable'];}
120
	if (filtrageTest("/etc/dansguardian/dansguardian.conf","/^proxyport = 8090/")){
120
	if (filtrageTest("/etc/dansguardian/dansguardian.conf","/^proxyport = 8090/")){
121
		$web_antivir_status = $text['enable'];}
121
		$web_antivir_status = $text['enable'];}
122
	else {	$web_antivir_status = $text['disable'];}
122
	else {	$web_antivir_status = $text['disable'];}
123
	if ((filtrageTest("/var/www/html/index.php","/network_pb = False/")) && (internetTest())){
123
	if ((filtrageTest("/var/www/html/index.php","/network_pb = False/")) && (internetTest($INSTALLEDVERSION))){
124
		$internet_status =  "<img src='/images/state_ok.gif'>".$text['enable'];
124
		$internet_status =  "<img src='/images/state_ok.gif'>".$text['enable'];
125
		$version = dns_get_record("version.alcasar.net",DNS_TXT);
125
		$version = dns_get_record("version.alcasar.net",DNS_TXT);
126
		$AVAILABLEDVERSION = $version[0]['txt'];
126
		$AVAILABLEDVERSION = $version[0]['txt'];
127
	} else {
127
	} else {
128
		$internet_status =  "<img src='/images/state_error.gif'>".$text['disable'];
128
		$internet_status =  "<img src='/images/state_error.gif'>".$text['disable'];