Bearsampp 2026.3.26
API documentation
Loading...
Searching...
No Matches
ajax.php File Reference

Go to the source code of this file.

Variables

 $csrfProtectedEndpoints
 $proc = Util::cleanPostVar('proc', 'text')
 $procMap
if(in_array( $proc, $csrfProtectedEndpoints, true)) if(isset($procMap[$proc]) &&file_exists($procMap[$proc])) else

Variable Documentation

◆ $csrfProtectedEndpoints

$csrfProtectedEndpoints
Initial value:
= [
'quickpick',
'toggleenhancedquickpick',
'applymoduleconfig'
]

Define which endpoints require CSRF protection. Read-only endpoints (GET-like operations) don't need CSRF protection. Write operations (POST that changes state) require CSRF protection.

Definition at line 48 of file ajax.php.

◆ $proc

◆ $procMap

$procMap
Initial value:
= [
'summary' => __DIR__ . '/ajax/ajax.summary.php',
'latestversion' => __DIR__ . '/ajax/ajax.latestversion.php',
'apache' => __DIR__ . '/ajax/ajax.apache.php',
'mailpit' => __DIR__ . '/ajax/ajax.mailpit.php',
'memcached' => __DIR__ . '/ajax/ajax.memcached.php',
'mariadb' => __DIR__ . '/ajax/ajax.mariadb.php',
'mysql' => __DIR__ . '/ajax/ajax.mysql.php',
'nodejs' => __DIR__ . '/ajax/ajax.nodejs.php',
'php' => __DIR__ . '/ajax/ajax.php.php',
'postgresql' => __DIR__ . '/ajax/ajax.postgresql.php',
'xlight' => __DIR__ . '/ajax/ajax.xlight.php',
'quickpick' => __DIR__ . '/ajax/ajax.quickpick.php',
'toggleenhancedquickpick' => __DIR__ . '/ajax/ajax.toggle.enhancedquickpick.php',
'applymoduleconfig' => __DIR__ . '/ajax/ajax.apply.moduleconfig.php'
]

Definition at line 26 of file ajax.php.

◆ else

if (!empty( $proc)) else
Initial value:
{
$errorMessage = 'Invalid proc parameter'

Validate CSRF token for protected endpoints Check if the cleaned 'proc' parameter exists in our secure mapping. If valid, include the corresponding AJAX handler file using the pre-defined path. If not valid, return a JSON error message.

Definition at line 88 of file ajax.php.