From 2569cf45c7cc091ca48236cd887182263ed39004 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Mon, 14 Aug 2023 15:27:17 -0400 Subject: [PATCH] and the password goes too... --- plugin_controls.php | 67 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/plugin_controls.php b/plugin_controls.php index c7d53af..80bc181 100644 --- a/plugin_controls.php +++ b/plugin_controls.php @@ -1,10 +1,63 @@ = 60 * 60 * 12 )) + { + // File is older than threshold, delete + unlink($allow_plugin_file); + } + } + + // + + if (file_exists($allow_plugin_file)) + { + define( 'DISALLOW_FILE_EDIT', false ); // allow + define( 'DISALLOW_FILE_MODS', false); + } + else + { + define( 'DISALLOW_FILE_EDIT', true ); // disable + define( 'DISALLOW_FILE_MODS', true); + } +} + +add_action( 'admin_menu', 'plugin_controls_remove_menus' ); +add_action( 'admin_menu', 'plugin_page_control' ); + -//TODO make plugins only accessible with token