Update app_defaults.php

This commit is contained in:
FusionPBX
2017-01-10 01:14:14 -07:00
committed by GitHub
parent 3226641a1b
commit 00ddb5365b
+26 -23
View File
@@ -24,32 +24,35 @@
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
if ($domains_processed == 1) {
//update the notifications table if ($domains_processed == 1) {
$sql = "select count(*) as num_rows from v_notifications ";
$prep_statement = $db->prepare($sql); //update the notifications table
if ($prep_statement) { if (is_array($_SESSION['switch']['scripts'])) {
$prep_statement->execute(); $sql = "select count(*) as num_rows from v_notifications ";
$row = $prep_statement->fetch(PDO::FETCH_ASSOC); $prep_statement = $db->prepare($sql);
if ($row['num_rows'] == 0) { if ($prep_statement) {
$sql = "insert into v_notifications "; $prep_statement->execute();
$sql .= "("; $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
$sql .= "notification_uuid, "; if ($row['num_rows'] == 0) {
$sql .= "project_notifications "; $sql = "insert into v_notifications ";
$sql .= ")"; $sql .= "(";
$sql .= "values "; $sql .= "notification_uuid, ";
$sql .= "("; $sql .= "project_notifications ";
$sql .= "'".uuid()."', "; $sql .= ")";
$sql .= "'false' "; $sql .= "values ";
$sql .= ")"; $sql .= "(";
$db->exec(check_sql($sql)); $sql .= "'".uuid()."', ";
unset($sql); $sql .= "'false' ";
} $sql .= ")";
unset($prep_statement, $row); $db->exec(check_sql($sql));
unset($sql);
} }
unset($prep_statement, $row);
}
} }
} }
?> ?>