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