torrentpier/ajax.php
Roman Kelesidis cbf42251b7 Added optional parament in $valid_actions [AJAX]
Добавляет опциональный параметр IN_ADMIN_CP. Этот параметр указывается для тех ajax скриптов, которые должны выполнятся (работать) при выключенном форуме (через админку или крон). Если этот параметр не указан. то скрипты без него работать не будут в принципе нигде.

По умолчанию параметр IN_ADMIN_CP имеют два скрипты которые выполняются через админку (manage_admin и sitemap).
2023-03-07 00:15:57 +07:00

44 lines
1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2023 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
define('BB_SCRIPT', 'ajax');
define('IN_AJAX', true);
require __DIR__ . '/common.php';
$ajax = new TorrentPier\Legacy\Ajax();
$ajax->init();
// Init userdata
$user->session_start();
// Load actions required modules
switch ($ajax->action) {
case 'view_post':
case 'posts':
case 'post_mod_comment':
require INC_DIR . '/bbcode.php';
break;
case 'view_torrent':
case 'mod_action':
case 'change_tor_status':
case 'change_torrent':
case 'gen_passkey':
require ATTACH_DIR . '/attachment_mod.php';
break;
}
$ajax->exec();
/**
* @deprecated ajax_common
* Dirty class removed from here since 2.2.0
* To add new actions see at src/Legacy/Ajax.php
*/