[Rspamd] Fix map permissions for www
[Web] Allow to manage global maps in UI (WIP)
This commit is contained in:
25
data/web/inc/ajax/regex_validation.php
Normal file
25
data/web/inc/ajax/regex_validation.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
||||
header('Content-Type: application/json');
|
||||
if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||
exit();
|
||||
}
|
||||
if (isset($_GET['regex'])) {
|
||||
$regex_lines = preg_split("/(\r\n|\n|\r)/", $_GET['regex']);
|
||||
foreach ($regex_lines as $line => $regex) {
|
||||
if (empty($regex) || substr($regex, 0, 1) == "#") {
|
||||
continue;
|
||||
}
|
||||
if (empty($regex) || substr($regex, 0, 1) != "/") {
|
||||
echo json_encode(array('type' => 'danger', 'msg' => 'Line ' . ($line + 1) . ': Invalid regex'));
|
||||
exit();
|
||||
}
|
||||
if (@preg_match($regex, 'Lorem Ipsum') === false) {
|
||||
echo json_encode(array('type' => 'danger', 'msg' => 'Line ' . ($line + 1) . ': Invalid regex "' . $regex . '"'));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
echo json_encode(array('type' => 'success', 'msg' => $lang['add']['validation_success']));
|
||||
}
|
||||
?>
|
3
data/web/inc/ajax/show_rspamd_global_filters.php
Normal file
3
data/web/inc/ajax/show_rspamd_global_filters.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
session_start();
|
||||
$_SESSION['show_rspamd_global_filters'] = true;
|
Reference in New Issue
Block a user