];
}
+ public function beforeAction($action)
+ {
+ if ($action->id == 'pending') {
+ $this->enableCsrfValidation = false;
+ }
+
+ return parent::beforeAction($action);
+ }
+
public function actionDelete($id) {
$notification = Notification::findOne($id);
if ($notification && (Yii::$app->user->id == $notification->created_by || Yii::$app->user->can('notification/deleteAll'))) {
$level .= '```' . $message->getCommandLine() . '```';
} else {
$level .= '[' . $message->getUrl() . '](' . $message->getUrl() . ')';
- if (str_contains($message->getUrl(), "erp-flowers.ru/notification/pending")) {
- return;
- }
}
// Текст сообщения
-const param1 = $('meta[name=csrf-param]').attr("content");
-const token1 = $('meta[name=csrf-token]').attr("content");
let pendingAllowed = true;
setTimeout(initPendingNotifications, 3000);
$.ajax({
method: 'POST',
url: window.location.origin + '/notification/pending',
- data: { action: 'pendingNotifications', [param1]: token1},
+ data: { action: 'pendingNotifications'},
dataType: "json",
success: function (data) {
updateKolokolchik(data);
$.ajax({
method: 'POST',
url: window.location.origin + '/notification/pending',
- data: {action: 'notificationIsShown', notification_id, [param1]: token1},
+ data: {action: 'notificationIsShown', notification_id},
dataType: "json",
success: function (data) { }
});