Subversion Repositories ALCASAR

Rev

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

Rev 2559 Rev 2609
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: network.php 2559 2018-06-10 12:56:39Z rexy $
2
# $Id: network.php 2609 2018-08-22 07:55:28Z rexy $
3
 
3
 
4
// written by steweb57, Rexy & Tom HOUDAYER
4
// written by steweb57, Rexy & Tom HOUDAYER
5
 
5
 
6
/********************
6
/********************
7
*  READ CONF FILES  *
7
*  READ CONF FILES  *
Line 73... Line 73...
73
	$l_current_certificate  = "Certificat actuel";
73
	$l_current_certificate  = "Certificat actuel";
74
	$l_validated		= "Validé par :";
74
	$l_validated		= "Validé par :";
75
	$l_empty		= "Vide";
75
	$l_empty		= "Vide";
76
	$l_yes			= "Oui";
76
	$l_yes			= "Oui";
77
	$l_no			= "Non";
77
	$l_no			= "Non";
78
	$l_allow_unsecured_login	= "Autoriser les utilisateurs à se connecter de manière non sécurisée (HTTP) :";
78
	$l_ssl_title		= "Chiffrer les flux réseau entre les utilisateurs et ALCASAR";
79
	$l_unsecured_login_warning	= "/!\\ Les identifiants de connexion seront envoyés en clair.";
-
 
80
	$l_cert_expiration	= "Date d'expiration :";
79
	$l_cert_expiration	= "Date d'expiration :";
81
	$l_cert_commonname	= "Nom commun :";
80
	$l_cert_commonname	= "Nom commun :";
82
	$l_cert_organization	= "Organisation :";
81
	$l_cert_organization	= "Organisation :";
83
	$l_upload_certificate	= "Importer un certificat";
82
	$l_upload_certificate	= "Importer un certificat";
84
	$l_le_integration	= "Intégration Let's Encrypt";
83
	$l_le_integration	= "Intégration Let's Encrypt";
Line 128... Line 127...
128
	$l_current_certificate  = "Current certificate";
127
	$l_current_certificate  = "Current certificate";
129
	$l_validated		= "Validated by :";
128
	$l_validated		= "Validated by :";
130
	$l_empty		= "Empty";
129
	$l_empty		= "Empty";
131
	$l_yes			= "Yes";
130
	$l_yes			= "Yes";
132
	$l_no			= "No";
131
	$l_no			= "No";
133
	$l_allow_unsecured_login	= "Allow users to login with insecure connection (HTTP):";
-
 
134
	$l_unsecured_login_warning	= "/!\\ Credentials will be sent in plain text.";
132
	$l_ssl_title		= "Cypher the network flows between users and ALCASAR";
135
	$l_cert_expiration	= "Expiration date:";
133
	$l_cert_expiration	= "Expiration date:";
136
	$l_cert_commonname	= "Common name:";
134
	$l_cert_commonname	= "Common name:";
137
	$l_cert_organization	= "Organization:";
135
	$l_cert_organization	= "Organization:";
138
	$l_upload_certificate	= "Importer un certificat";
136
	$l_upload_certificate	= "Importer un certificat";
139
	$l_le_integration	= "Let's Encrypt integration";
137
	$l_le_integration	= "Let's Encrypt integration";
Line 756... Line 754...
756
</tr>
754
</tr>
757
</table>
755
</table>
758
<br>
756
<br>
759
 
757
 
760
<table width="100%" cellspacing="0" cellpadding="0" border="0">
758
<table width="100%" cellspacing="0" cellpadding="0" border="0">
-
 
759
	<tr><th><?= $l_ssl_title?></th></tr>
-
 
760
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
-
 
761
</table>
-
 
762
<table width="100%" cellspacing="0" cellpadding="5" border="1">
-
 
763
	<tr><td valign="middle" align="left">
-
 
764
		<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-
 
765
		<input type="hidden" name="choix" value="https_login">
-
 
766
		<span><?= $l_allow_unsecured_login ?></span><br>
-
 
767
		<select name="https_login">
-
 
768
			<option value="on"<?=  (($conf['HTTPS_LOGIN'] === 'on')  ? ' selected' : '') ?>><?= $l_yes ?></option>
-
 
769
			<option value="off"<?= (($conf['HTTPS_LOGIN'] === 'off') ? ' selected' : '') ?>><?= $l_no ?></option>
-
 
770
		</select>
-
 
771
		<input type="submit" value="<?= $l_apply ?>"><br>
-
 
772
		</form>
-
 
773
		<br>
-
 
774
	</td></tr>
-
 
775
</table>
-
 
776
<br>
-
 
777
 
-
 
778
<table width="100%" cellspacing="0" cellpadding="0" border="0">
761
	<tr><th><?= $l_import_cert ?></th></tr>
779
	<tr><th><?= $l_import_cert ?></th></tr>
762
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
780
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
763
</table>
781
</table>
764
<table width="100%" cellspacing="0" cellpadding="5" border="1">
782
<table width="100%" cellspacing="0" cellpadding="5" border="1">
765
	<tr>
783
	<tr>
766
		<td width="50%" valign="top">
784
		<td width="50%" valign="top">
767
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-
 
768
				<input type="hidden" name="choix" value="https_login">
-
 
769
				<span><?= $l_allow_unsecured_login ?></span><br>
-
 
770
				<select name="https_login">
-
 
771
					<option value="on"<?=  (($conf['HTTPS_LOGIN'] === 'on')  ? ' selected' : '') ?>><?= $l_no ?></option>
-
 
772
					<option value="off"<?= (($conf['HTTPS_LOGIN'] === 'off') ? ' selected' : '') ?>><?= $l_yes ?></option>
-
 
773
				</select>
-
 
774
				<input type="submit" value="<?= $l_apply ?>"><br>
-
 
775
				<span><?= $l_unsecured_login_warning ?></span>
-
 
776
			</form>
-
 
777
			<br>
-
 
778
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-
 
779
				<input type="hidden" name="choix" value="default_cert">
-
 
780
				<input type="submit" value="<?= $l_default_cert ?>" <?= (!file_exists('/etc/pki/tls/certs/alcasar.crt.old') || !file_exists('/etc/pki/tls/private/alcasar.key.old')) ? ' disabled' : '' ?>>
-
 
781
			</form>
-
 
782
		</td>
-
 
783
		<td width="50%" valign="top">
-
 
784
			<?php
785
			<?php
785
			$certificateInfos = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
786
			$certificateInfos = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
786
 
787
 
787
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
788
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
788
			$domain               = $certificateInfos['subject']['CN'];
789
			$domain               = $certificateInfos['subject']['CN'];
Line 796... Line 797...
796
			<?= $l_cert_organization ?> <?= $organization ?><br/>
797
			<?= $l_cert_organization ?> <?= $organization ?><br/>
797
			<h4><?=  $l_validated ?></h4>
798
			<h4><?=  $l_validated ?></h4>
798
			<?= $l_cert_commonname ?> <?= $CAdomain ?><br>
799
			<?= $l_cert_commonname ?> <?= $CAdomain ?><br>
799
			<?= $l_cert_organization ?> <?= $CAorganization ?><br>
800
			<?= $l_cert_organization ?> <?= $CAorganization ?><br>
800
		</td>
801
		</td>
-
 
802
		<td width="50%" valign="center">
-
 
803
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-
 
804
				<input type="hidden" name="choix" value="default_cert">
-
 
805
				<input type="submit" value="<?= $l_default_cert ?>" <?= (!file_exists('/etc/pki/tls/certs/alcasar.crt.old') || !file_exists('/etc/pki/tls/private/alcasar.key.old')) ? ' disabled' : '' ?>>
-
 
806
			</form>
-
 
807
		</td>
801
	</tr>
808
	</tr>
802
	<tr>
809
	<tr>
803
		<td width="50%" valign="top">
810
		<td width="50%" valign="top">
804
			<h3><?= $l_upload_certificate ?></h3>
811
			<h3><?= $l_upload_certificate ?></h3>
805
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" enctype="multipart/form-data">
812
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" enctype="multipart/form-data">