mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-02 20:29:20 +02:00
Menus: better csrf + add success message on reset colors
This commit is contained in:
parent
13e6eb5666
commit
4e26f07ab6
@ -20,14 +20,14 @@ if (!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['template'])) {
|
if (isset($_POST['template'])) {
|
||||||
$template = $_REQUEST['template'];
|
$template = $_POST['template'];
|
||||||
|
|
||||||
if (isset($_REQUEST['menu'])) {
|
if (isset($_POST['menu'])) {
|
||||||
$post_menu = $_REQUEST['menu'];
|
$post_menu = $_POST['menu'];
|
||||||
$post_menu_link = $_REQUEST['menu_link'];
|
$post_menu_link = $_POST['menu_link'];
|
||||||
$post_menu_blank = $_REQUEST['menu_blank'];
|
$post_menu_blank = $_POST['menu_blank'];
|
||||||
$post_menu_color = $_REQUEST['menu_color'];
|
$post_menu_color = $_POST['menu_color'];
|
||||||
if (count($post_menu) != count($post_menu_link)) {
|
if (count($post_menu) != count($post_menu_link)) {
|
||||||
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
||||||
return;
|
return;
|
||||||
@ -71,9 +71,10 @@ if (isset($_REQUEST['template'])) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['reset_colors'])) {
|
if (isset($_GET['reset_colors'])) {
|
||||||
if (isset($config['menu_default_color'])) {
|
if (isset($config['menu_default_color'])) {
|
||||||
Menu::where('template', $template)->update(['color' => str_replace('#', '', $config['menu_default_color'])]);
|
Menu::where('template', $template)->update(['color' => str_replace('#', '', $config['menu_default_color'])]);
|
||||||
|
success('Colors has been reset.');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
warning('There is no default color defined, cannot reset colors.');
|
warning('There is no default color defined, cannot reset colors.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user