Decrypt token before FCM push and fallback to SMS on push fail, also decrypt names in campaigns log
This commit is contained in:
@@ -37,8 +37,18 @@ try {
|
||||
$stmt->execute();
|
||||
$logs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Decrypt names or just return them
|
||||
// (Names are not encrypted in this schema, only phones are, so we can return directly)
|
||||
// Decrypt names since they are encrypted in the passengers table
|
||||
foreach ($logs as &$log) {
|
||||
if (!empty($log['first_name'])) {
|
||||
$decName = $encryptionHelper->decryptData($log['first_name']);
|
||||
if ($decName) $log['first_name'] = $decName;
|
||||
}
|
||||
if (!empty($log['last_name'])) {
|
||||
$decName = $encryptionHelper->decryptData($log['last_name']);
|
||||
if ($decName) $log['last_name'] = $decName;
|
||||
}
|
||||
}
|
||||
unset($log);
|
||||
|
||||
// Aggregate statistics for Dashboard charts
|
||||
$sqlStats = "SELECT message_type, COUNT(*) as count
|
||||
|
||||
Reference in New Issue
Block a user