Browse Source

Fix PHP warnings when user not logged in

main
Miraty 3 months ago
parent
commit
1beeb45280
  1. 12
      form.ns.php
  2. 11
      public/ht/le.php
  3. 9
      public/reg/ds.php
  4. 5
      public/reg/ns.php

12
form.ns.php

@ -17,13 +17,11 @@
<br>
<select required="" name="zone" id="zone">
<option value="" disabled="" selected="">-</option>
<?php
$zones = nsListUserZones($_SESSION['username']);
if (!empty($zones))
foreach ($zones as $zone)
echo "<option value='" . $zone . "'>" . $zone . "</option>";
?>
<?php
if (isset($_SESSION['username']))
foreach (nsListUserZones($_SESSION['username']) as $zone)
echo "<option value='" . $zone . "'>" . $zone . "</option>";
?>
</select>
</div>

11
public/ht/le.php

@ -7,12 +7,15 @@
<label for="domain">Domaine ciblé</label><br>
<select required="" name="domain">
<option value="" disabled="" selected="">---</option>
<?php
<?php
if (isset($_SESSION['username'])) {
$sites = selectSites($_SESSION['username'], "dns", "http", false);
$leAvailable = selectSites($_SESSION['username'], "dns", "http", true);
foreach ($sites as $site) { ?>
<option value="<?= $site['domain'] ?>"><?= $site['domain'] . " (/" . $site['siteDir'] . ")" ?></option>
<?php } ?>
foreach ($sites as $site)
echo '<option value="' . $site['domain'] . '">' . $site['domain'] . " (/" . $site['siteDir'] . ")</option>";
}
?>
</select>
<br>
<input value="Valider" type="submit">

9
public/reg/ds.php

@ -12,11 +12,12 @@
<select required="" name="zone" id="zone">
<option value="" disabled="" selected="">---</option>
<?php
if (isset($_SESSION['username'])) {
$domains = regListUserDomains($_SESSION['username']);
$domains = regListUserDomains($_SESSION['username']);
foreach($domains as $domain)
echo " <option value='" . $domain . "'>" . $domain . "</option>";
foreach($domains as $domain)
echo " <option value='" . $domain . "'>" . $domain . "</option>";
}
?>
</select>

5
public/reg/ns.php

@ -12,8 +12,9 @@
<select required="" name="domain" id="domain">
<option value="" disabled="" selected="">---</option>
<?php
foreach(regListUserDomains($_SESSION['username']) as $suffix)
echo " <option value='" . $suffix . "'>." . $suffix . "</option>\n";
if (isset($_SESSION['username']))
foreach(regListUserDomains($_SESSION['username']) as $suffix)
echo " <option value='" . $suffix . "'>." . $suffix . "</option>\n";
?>
</select>

Loading…
Cancel
Save