Formulaire d'installation

This commit is contained in:
Fred Tempez 2023-06-12 21:13:33 +02:00
parent 1306097cab
commit 8aeddf77c1
2 changed files with 38 additions and 39 deletions

View File

@ -1806,7 +1806,6 @@ class core extends common
public function router() public function router()
{ {
//
$layout = new layout($this); $layout = new layout($this);
// Installation // Installation
@ -1910,21 +1909,23 @@ class core extends common
*/ */
$accessInfo['userName'] = ''; $accessInfo['userName'] = '';
$accessInfo['pageId'] = ''; $accessInfo['pageId'] = '';
foreach ($this->getData(['user']) as $userId => $userIds) { if ($this->getData(['user'])) {
if (!is_null($this->getData(['user', $userId, 'accessUrl']))) { foreach ($this->getData(['user']) as $userId => $userIds) {
$t = explode('/', $this->getData(['user', $userId, 'accessUrl'])); if (!is_null($this->getData(['user', $userId, 'accessUrl']))) {
} $t = explode('/', $this->getData(['user', $userId, 'accessUrl']));
if ( }
$this->getUser('id') && if (
$userId !== $this->getUser('id') && $this->getUser('id') &&
$this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() && $userId !== $this->getUser('id') &&
array_intersect($t, self::$accessList) && $this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() &&
array_intersect($t, self::$accessExclude) !== false && array_intersect($t, self::$accessList) &&
time() < $this->getData(['user', $userId, 'accessTimer']) + self::ACCESS_TIMER array_intersect($t, self::$accessExclude) !== false &&
) { time() < $this->getData(['user', $userId, 'accessTimer']) + self::ACCESS_TIMER
$access = false; ) {
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']); $access = false;
$accessInfo['pageId'] = end($t); $accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
$accessInfo['pageId'] = end($t);
}
} }
} }
// Accès concurrent stocke la page visitée // Accès concurrent stocke la page visitée

View File

@ -11,12 +11,32 @@
</span> </span>
</summary> </summary>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6">
<?php echo template::text('installFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
]); ?>
</div>
<div class="col6">
<?php echo template::text('installLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('installId', [ <?php echo template::text('installId', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Identifiant' 'label' => 'Identifiant'
]); ?> ]); ?>
</div> </div>
<div class="col6">
<?php echo template::mail('installMail', [
'autocomplete' => 'off',
'label' => 'Adresse électronique'
]); ?>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
@ -32,28 +52,6 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row">
<div class="col12">
<?php echo template::mail('installMail', [
'autocomplete' => 'off',
'label' => 'Adresse électronique'
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::text('installFirstname', [
'autocomplete' => 'off',
'label' => 'Prénom'
]); ?>
</div>
<div class="col6">
<?php echo template::text('installLastname', [
'autocomplete' => 'off',
'label' => 'Nom'
]); ?>
</div>
</div>
</details> </details>
</div> </div>
</div> </div>