Skip to content

Commit

Permalink
Update pdo.php
Browse files Browse the repository at this point in the history
When the user is not logged in then set the domain_uuid and domain_name based on domain from the URL.
  • Loading branch information
markjcrane authored Oct 27, 2020
1 parent b5f85d4 commit 8d4d42b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions resources/pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,20 @@ function php_sqlite_data_type($string, $field) {
unset($result);
}

if (is_array($domains)) {
if (is_array($domains)) {
foreach($domains as $row) {
if (count($domains) == 1) {
$_SESSION["domain_uuid"] = $row["domain_uuid"];
$_SESSION["domain_name"] = $row['domain_name'];
}
else {
if ($row['domain_name'] == $domain_array[0] || $row['domain_name'] == 'www.'.$domain_array[0]) {
if (!isset($_SESSION['username'])) {
if (count($domains) == 1) {
$_SESSION["domain_uuid"] = $row["domain_uuid"];
$_SESSION["domain_name"] = $row["domain_name"];
$_SESSION["domain_name"] = $row['domain_name'];
}
}
else {
if ($row['domain_name'] == $domain_array[0] || $row['domain_name'] == 'www.'.$domain_array[0]) {
$_SESSION["domain_uuid"] = $row["domain_uuid"];
$_SESSION["domain_name"] = $row["domain_name"];
}
}
}
$_SESSION['domains'][$row['domain_uuid']] = $row;
}
unset($domains, $prep_statement);
Expand Down

0 comments on commit 8d4d42b

Please sign in to comment.