Subversion Repositories ALCASAR

Rev

Rev 925 | Rev 955 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 925 Rev 930
Line 25... Line 25...
25
*****************************************************************/
25
*****************************************************************/
26
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
26
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
27
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
27
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
28
 
28
 
29
/****************************************************************
29
/****************************************************************
30
*				FILE TEST			*
30
*			FILE reading test			*
31
*****************************************************************/
31
*****************************************************************/
32
//Test de présence et des droits en lecture des fichiers de configuration.
-
 
33
if (!file_exists(CONF_FILE)){
-
 
34
	exit("Fichier de configuration ".CONF_FILE." non présent");
-
 
35
}
-
 
36
if (!is_readable(CONF_FILE)){
-
 
37
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
-
 
38
}
-
 
39
 
-
 
40
//Test de présence de domaine ou IP accessibles sans authentificaion
-
 
41
$conf_files=array(DOMAIN_ALLOWED_LIST);
32
$conf_files=array(CONF_FILE,DOMAIN_ALLOWED_LIST);
42
foreach ($conf_files as $file){
33
foreach ($conf_files as $file){
43
	if (!file_exists($file)){
34
	if (!file_exists($file)){
44
		exit("Fichier ".$file." non présent");
35
		exit("Fichier ".$file." non présent");
45
	}
36
	}
46
	if (!is_readable($file)){
37
	if (!is_readable($file)){
Line 62... Line 53...
62
	}
53
	}
63
}else{
54
}else{
64
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
55
	exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
65
}
56
}
66
fclose($ouvre);
57
fclose($ouvre);
67
 
-
 
68
$organisme = $conf["ORGANISM"];
58
$organisme = $conf["ORGANISM"];
69
 
59
 
70
# Shared secret used to encrypt challenge with radius.
60
# Shared secret used to encrypt challenge with radius.
71
$uamsecret = "q8bxGdIg";
61
$uamsecret = "";
72
 
62
 
73
# URL loaded after success authenticates (let blank for browser defaults)
63
# URL loaded after success authenticates (let blank for browser defaults)
74
$adminurl = "";
64
$adminurl = "";
75
 
65
 
76
# Our own path
66
# Our own path
77
$loginpath	= $_SERVER['PHP_SELF'];
67
$loginpath	= $_SERVER['PHP_SELF'];
78
$alcasarpath = "http://alcasar";
68
$alcasarpath = "http://alcasar";
79
$statuspath = $alcasarpath."/status.php";
69
$statuspath = $alcasarpath."/status.php";
80
$debug		= false;
70
$debug		= false;
81
 
71
 
82
# Domain and url allowed without authentication
-
 
83
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
-
 
84
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
-
 
85
 
-
 
86
# Choice of language
72
# Choice of language
87
$Language = 'en';
73
$Language = 'en';
88
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
74
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
89
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
75
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
90
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
76
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
Line 487... Line 473...
487
				</ul>
473
				</ul>
488
			</td>
474
			</td>
489
		</tr>
475
		</tr>
490
	</table>";
476
	</table>";
491
 
477
 
492
// Read the "Domain alowed" file
478
// Read the "Domain allowed" file
493
$tab=file(DOMAIN_ALLOWED_LIST);
479
$tab=file(DOMAIN_ALLOWED_LIST);
494
if ($tab)  # the file isn't empty
480
if ($tab)  # the file isn't empty
495
	{
481
	{
496
	echo "<div id=\"authorized_domain\">$l_uam_domain";
482
	echo "<div id=\"authorized_domain\">$l_uam_domain";
497
	foreach ($tab as $line)
483
	foreach ($tab as $line)