Subversion Repositories ALCASAR

Rev

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

Rev 3028 Rev 3030
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: network.php 3028 2022-06-30 22:25:09Z rexy $
2
# $Id: network.php 3030 2022-07-04 22:29:44Z rexy $
3
 
3
 
4
// written by steweb57, Rexy, Tom HOUDAYER & Pierre RIVAULT
4
// written by steweb57, Rexy, Tom HOUDAYER & Pierre RIVAULT
5
 
5
 
6
/********************
6
/********************
7
*  READ CONF FILES  *
7
*  READ CONF FILES  *
Line 76... Line 76...
76
	$l_validated		= "Validé par :";
76
	$l_validated		= "Validé par :";
77
	$l_empty		= "Vide";
77
	$l_empty		= "Vide";
78
	$l_yes			= "Oui";
78
	$l_yes			= "Oui";
79
	$l_no			= "Non";
79
	$l_no			= "Non";
80
	$l_ssl_title		= "Chiffrer les flux d'authentification entre les utilisateurs et ALCASAR";
80
	$l_ssl_title		= "Chiffrer les flux d'authentification entre les utilisateurs et ALCASAR";
-
 
81
	$l_cert_from	= "Date d'émission";
81
	$l_cert_expiration	= "Date d'expiration :";
82
	$l_cert_expiration	= "Date d'expiration :";
82
	$l_cert_commonname	= "Nom commun :";
83
	$l_cert_commonname	= "Nom commun :";
83
	$l_cert_organization	= "Organisation :";
84
	$l_cert_organization	= "Organisation :";
84
	$l_upload_certificate	= "Importer un certificat officiel";
85
	$l_upload_certificate	= "Importer un certificat officiel";
-
 
86
	$l_le_renewal	= "Renouveler le certificat Let's Encrypt";
85
	$l_le_integration	= "Intégrer un certificat Let's Encrypt";
87
	$l_le_integration	= "Intégrer un certificat Let's Encrypt";
86
	$l_le_status		= "Status :";
88
	$l_le_status		= "Status :";
87
	$l_disabled		= "Inactif";
89
	$l_disabled		= "Inactif";
88
	$l_pending_validation	= "En attente de validation";
90
	$l_pending_validation	= "En attente de validation";
89
	$l_enabled		= "Actif";
91
	$l_enabled		= "Actif";
Line 139... Line 141...
139
	$l_validated		= "Validado por :";
141
	$l_validated		= "Validado por :";
140
	$l_empty		= "Vacío";
142
	$l_empty		= "Vacío";
141
	$l_yes			= "Si";
143
	$l_yes			= "Si";
142
	$l_no			= "No";
144
	$l_no			= "No";
143
	$l_ssl_title		= "La autenticación de cifrado fluye entre usuarios y ALCASAR";
145
	$l_ssl_title		= "La autenticación de cifrado fluye entre usuarios y ALCASAR";
-
 
146
	$l_cert_from	= "Fecha de emisión";
144
	$l_cert_expiration	= "Fecha de vencimiento:";
147
	$l_cert_expiration	= "Fecha de vencimiento:";
145
	$l_cert_commonname	= "Common name:";
148
	$l_cert_commonname	= "Common name:";
146
	$l_cert_organization	= "Organización:";
149
	$l_cert_organization	= "Organización:";
147
	$l_upload_certificate	= "Importar un certificado";
150
	$l_upload_certificate	= "Importar un certificado";
148
	$l_le_integration	= "Integración con Let's Encrypt";
151
	$l_le_integration	= "Integración con Let's Encrypt";
-
 
152
	$l_le_renewal	= "Renovación del certificado Let's Encrypt";
149
	$l_le_status		= "Estado:";
153
	$l_le_status		= "Estado:";
150
	$l_disabled		= "Desactivado";
154
	$l_disabled		= "Desactivado";
151
	$l_pending_validation	= "Validación pendiente";
155
	$l_pending_validation	= "Validación pendiente";
152
	$l_enabled		= "Activado";
156
	$l_enabled		= "Activado";
153
	$l_le_email		= "Email:";
157
	$l_le_email		= "Email:";
Line 201... Line 205...
201
	$l_validated		= "Validated by :";
205
	$l_validated		= "Validated by :";
202
	$l_empty		= "Empty";
206
	$l_empty		= "Empty";
203
	$l_yes			= "Yes";
207
	$l_yes			= "Yes";
204
	$l_no			= "No";
208
	$l_no			= "No";
205
	$l_ssl_title		= "Cipher authentication flows between users and ALCASAR";
209
	$l_ssl_title		= "Cipher authentication flows between users and ALCASAR";
-
 
210
	$l_cert_from	= "Date of issue";
206
	$l_cert_expiration	= "Expiration date:";
211
	$l_cert_expiration	= "Expiration date:";
207
	$l_cert_commonname	= "Common name:";
212
	$l_cert_commonname	= "Common name:";
208
	$l_cert_organization	= "Organization:";
213
	$l_cert_organization	= "Organization:";
209
	$l_upload_certificate	= "Import an officlal certificate";
214
	$l_upload_certificate	= "Import an officlal certificate";
210
	$l_le_integration	= "Integrate a Let's Encrypt certificate";
215
	$l_le_integration	= "Integrate a Let's Encrypt certificate";
-
 
216
	$l_le_renewal	= "Renewing the Let's Encrypt certificate";
211
	$l_le_status		= "Status:";
217
	$l_le_status		= "Status:";
212
	$l_disabled		= "Disabled";
218
	$l_disabled		= "Disabled";
213
	$l_pending_validation	= "Pending validation";
219
	$l_pending_validation	= "Pending validation";
214
	$l_enabled		= "Enabled";
220
	$l_enabled		= "Enabled";
215
	$l_le_email		= "Email:";
221
	$l_le_email		= "Email:";
Line 1163... Line 1169...
1163
<div class="panel">
1169
<div class="panel">
1164
	<div class="panel-header"><?= $l_import_cert ?></div>
1170
	<div class="panel-header"><?= $l_import_cert ?></div>
1165
	<div class="panel-row">
1171
	<div class="panel-row">
1166
		<div class="panel-cell">
1172
		<div class="panel-cell">
1167
			<?php
1173
			<?php
1168
			$certificateInfos = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
1174
			$certificateInfos     = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
1169
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
1175
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
-
 
1176
			$cert_from_date       = date('d-m-Y H:i:s', $certificateInfos['validFrom_time_t']);
1170
			$domain               = $certificateInfos['subject']['CN'];
1177
			$domain               = $certificateInfos['subject']['CN'];
1171
			$organization         = (isset($certificateInfos['subject']['O'])) ? $certificateInfos['subject']['O'] : '';
1178
			$organization         = (isset($certificateInfos['subject']['O'])) ? $certificateInfos['subject']['O'] : '';
1172
			$CAdomain             = $certificateInfos['issuer']['CN'];
1179
			$CAdomain             = $certificateInfos['issuer']['CN'];
1173
			$CAorganization       = (isset($certificateInfos['issuer']['O'])) ? $certificateInfos['issuer']['O'] : '';
1180
			$CAorganization       = (isset($certificateInfos['issuer']['O'])) ? $certificateInfos['issuer']['O'] : '';
1174
			?>
1181
			?>
1175
			<h3><?= $l_current_certificate ?></h3>
1182
			<h3><?= $l_current_certificate ?></h3>
1176
			<b><?= $l_cert_commonname ?></b> <?= $domain ?><br>
1183
			<b><?= $l_cert_commonname ?></b> <?= $domain ?><br>
-
 
1184
			<b><?= $l_cert_from ?></b> <?= $cert_from_date ?><br>
1177
			<b><?= $l_cert_expiration ?></b> <?= $cert_expiration_date ?><br>
1185
			<b><?= $l_cert_expiration ?></b> <?= $cert_expiration_date ?><br>
1178
			<b><?= $l_cert_organization ?></b> <?= $organization ?><br>
1186
			<b><?= $l_cert_organization ?></b> <?= $organization ?><br>
1179
			<b><?= $l_validated ?></b> <?= $CAdomain ?> (<?= $CAorganization ?>)<br>
1187
			<b><?= $l_validated ?></b> <?= $CAdomain ?> (<?= $CAorganization ?>)<br>
1180
		</div>
1188
		</div>
1181
		<div class="panel-cell">
1189
		<div class="panel-cell">
Line 1214... Line 1222...
1214
			} else if (($domain === $LE_conf['domainRequest']) && (empty($LE_conf['challenge']))) {
1222
			} else if (($domain === $LE_conf['domainRequest']) && (empty($LE_conf['challenge']))) {
1215
				$step = 3;
1223
				$step = 3;
1216
			} else {
1224
			} else {
1217
				$step = 1;
1225
				$step = 1;
1218
			}
1226
			}
-
 
1227
			if ($step === 2) {
-
 
1228
				echo "<h3>$l_le_renewal</h3>";
-
 
1229
			} else { echo "<h3>$l_le_integration</h3>";}
1219
			?>
1230
			?>
1220
			<h3><?= $l_le_integration ?></h3>
-
 
1221
			<?php if ($step === 1): ?>
1231
			<?php if ($step === 1): ?>
1222
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
1232
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
1223
					<input type="hidden" name="choix" value="le_issueCert">
1233
					<input type="hidden" name="choix" value="le_issueCert">
1224
					<?= $l_le_status ?> <?= $l_disabled ?><br>
1234
					<?= $l_le_status ?> <?= $l_disabled ?><br>
1225
					<?= $l_le_email ?> <input type="text" name="email" placeholder="adresse@email.com"<?= ((!empty($LE_conf['email'])) ? ' value="'.$LE_conf['email'].'"' : '') ?>><br>
1235
					<?= $l_le_email ?> <input type="text" name="email" placeholder="adresse@email.com"<?= ((!empty($LE_conf['email'])) ? ' value="'.$LE_conf['email'].'"' : '') ?>><br>
Line 1229... Line 1239...
1229
			<?php elseif ($step === 2): ?>
1239
			<?php elseif ($step === 2): ?>
1230
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
1240
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
1231
					<input type="hidden" name="choix" value="le_renewCert">
1241
					<input type="hidden" name="choix" value="le_renewCert">
1232
					<?= $l_le_status ?> <?= $l_pending_validation ?><br>
1242
					<?= $l_le_status ?> <?= $l_pending_validation ?><br>
1233
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
1243
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
1234
					<?= $l_le_ask_on ?> <?= date('d-m-Y H:i:s', $LE_conf['dateIssueRequest']) ?><br>
-
 
1235
					<?= $l_le_dns_entry_txt ?> "<?= '_acme-challenge.'.$LE_conf['domainRequest'] ?>"<br>
1244
					<?= $l_le_dns_entry_txt ?> "<?= '_acme-challenge.'.$LE_conf['domainRequest'] ?>"<br>
1236
					<?= $l_le_challenge ?> "<?= $LE_conf['challenge'] ?>"<br>
1245
					<?= $l_le_challenge ?> "<?= $LE_conf['challenge'] ?>"<br>
1237
					<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" name="recheck" value="<?= $l_recheck ?>"> <input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" name="cancel" value="<?= $l_cancel ?>"><br>
1246
					<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" name="recheck" value="<?= $l_recheck ?>"> <input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" name="cancel" value="<?= $l_cancel ?>"><br>
1238
				</form>
1247
				</form>
1239
			<?php elseif ($step === 3): ?>
1248
			<?php elseif ($step === 3): ?>