Update pdo.php

Prevent php warnings.
This commit is contained in:
FusionPBX 2017-01-04 20:40:36 -07:00 committed by GitHub
parent a01218c749
commit 5744d4b673
1 changed files with 32 additions and 23 deletions

View File

@ -17,15 +17,17 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2015
Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Raymond Chandler <intralanman@gmail.com>
*/
include "root.php";
require_once "resources/functions.php";
//includes
include "root.php";
require_once "resources/functions.php";
//set defaults
if (isset($dbtype)) {
@ -267,31 +269,38 @@ if ($db_type == "pgsql") {
unset($prep_statement);
//put the domains in natural order
natsort($domain_names);
//build the domains array in the correct order
foreach ($domain_names as $dn) {
foreach ($result as $row) {
if ($row['domain_name'] == $dn) {
$domains[] = $row;
}
}
if (is_array($domain_names)) {
natsort($domain_names);
}
unset($result);
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]) {
$_SESSION["domain_uuid"] = $row["domain_uuid"];
$_SESSION["domain_name"] = $row["domain_name"];
//build the domains array in the correct order
if (is_array($domain_names)) {
foreach ($domain_names as $dn) {
foreach ($result as $row) {
if ($row['domain_name'] == $dn) {
$domains[] = $row;
}
}
}
$_SESSION['domains'][$row['domain_uuid']] = $row;
unset($result);
}
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]) {
$_SESSION["domain_uuid"] = $row["domain_uuid"];
$_SESSION["domain_name"] = $row["domain_name"];
}
}
$_SESSION['domains'][$row['domain_uuid']] = $row;
}
unset($domains, $prep_statement);
}
unset($domains, $prep_statement);
}
//get the software name