|
@@ -16,32 +16,36 @@
|
|
|
|
|
|
<?php
|
|
|
|
|
|
- $fsDirs = listFsDirs($_SESSION['username']);
|
|
|
- $dbUsedDirs = listDbDirs($_SESSION['username'], "dns", "http");
|
|
|
- $i = 0;
|
|
|
- $j = 0;
|
|
|
- $alreadyEnabledDirs = NULL;
|
|
|
- $notYetEnabledDirs = NULL;
|
|
|
- if ($fsDirs) {
|
|
|
- foreach ($fsDirs as $fsDir) {
|
|
|
- if ($dbUsedDirs AND in_array($fsDir, $dbUsedDirs)) {
|
|
|
- $alreadyEnabledDirs[$i] = $fsDir;
|
|
|
- $i++;
|
|
|
- } else {
|
|
|
- $notYetEnabledDirs[$j] = $fsDir;
|
|
|
- $j++;
|
|
|
+
|
|
|
+
|
|
|
+ if (isset($_SESSION['username'])) {
|
|
|
+ $fsDirs = listFsDirs($_SESSION['username']);
|
|
|
+ $dbUsedDirs = listDbDirs($_SESSION['username'], "dns", "http");
|
|
|
+ $i = 0;
|
|
|
+ $j = 0;
|
|
|
+ $alreadyEnabledDirs = NULL;
|
|
|
+ $notYetEnabledDirs = NULL;
|
|
|
+ if ($fsDirs) {
|
|
|
+ foreach ($fsDirs as $fsDir) {
|
|
|
+ if ($dbUsedDirs AND in_array($fsDir, $dbUsedDirs)) {
|
|
|
+ $alreadyEnabledDirs[$i] = $fsDir;
|
|
|
+ $i++;
|
|
|
+ } else {
|
|
|
+ $notYetEnabledDirs[$j] = $fsDir;
|
|
|
+ $j++;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (!is_null($notYetEnabledDirs)) {
|
|
|
- foreach ($notYetEnabledDirs as $dir) {
|
|
|
- echo "<option value='" . $dir . "'>" . $dir . "</option>";
|
|
|
+ if (!is_null($notYetEnabledDirs)) {
|
|
|
+ foreach ($notYetEnabledDirs as $dir) {
|
|
|
+ echo "<option value='" . $dir . "'>" . $dir . "</option>";
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (!is_null($alreadyEnabledDirs)) {
|
|
|
- foreach ($alreadyEnabledDirs as $dir) {
|
|
|
- echo "<option disabled='' value='" . $dir . "'>" . $dir . "</option>";
|
|
|
+ if (!is_null($alreadyEnabledDirs)) {
|
|
|
+ foreach ($alreadyEnabledDirs as $dir) {
|
|
|
+ echo "<option disabled='' value='" . $dir . "'>" . $dir . "</option>";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|