mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-06 18:56:23 +01:00
Add super fancy No Refresh saving with a toast
This commit is contained in:
28
admin/tools/settings_save.php
Normal file
28
admin/tools/settings_save.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
const MYAAC_ADMIN = true;
|
||||
|
||||
require '../../common.php';
|
||||
require SYSTEM . 'functions.php';
|
||||
require SYSTEM . 'init.php';
|
||||
require SYSTEM . 'login.php';
|
||||
|
||||
if(!admin()) {
|
||||
http_response_code(500);
|
||||
die('Access denied.');
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['plugin'])) {
|
||||
http_response_code(500);
|
||||
die('Please enter plugin name.');
|
||||
}
|
||||
|
||||
if (!isset($_POST['settings'])) {
|
||||
http_response_code(500);
|
||||
die('Please enter settings.');
|
||||
}
|
||||
|
||||
$settings = Settings::getInstance();
|
||||
|
||||
$settings->save($_REQUEST['plugin'], $_POST['settings']);
|
||||
|
||||
echo 'Saved at ' . date('H:i');
|
||||
Reference in New Issue
Block a user