m_cache = $cache; $this->toggle_filter($status); add_filter('admin_head', array(&$this, 'filter_admin_head')); } function toggle_filter($status) { if ($status == ExecPhp_STATUS_OKAY) add_filter('admin_menu', array(&$this, 'filter_admin_menu_option')); else remove_filter('admin_menu', array(&$this, 'filter_admin_menu_option')); if ($status == ExecPhp_STATUS_PLUGIN_VERSION_MISMATCH) add_filter('admin_footer', array(&$this, 'filter_admin_footer_plugin_version')); else remove_filter('admin_footer', array(&$this, 'filter_admin_footer_plugin_version')); if ($status != ExecPhp_STATUS_OKAY && $status != ExecPhp_STATUS_PLUGIN_VERSION_MISMATCH) add_filter('admin_footer', array(&$this, 'filter_admin_footer_unknown')); else remove_filter('admin_footer', array(&$this, 'filter_admin_footer_unknown')); } function filter_admin_menu_option() { // delay initialization until the WP framework is loaded add_submenu_page('options-general.php', ExecPhp_PLUGIN_NAME, ExecPhp_PLUGIN_NAME, 'edit_others_posts', __FILE__, array(&$this, 'submenu_page_option_general')); } function filter_admin_head() { ?> m_cache->get_option(); $heading = sprintf(__('%s plugin is not active.', ExecPhp_PLUGIN_ID) , ExecPhp_PLUGIN_NAME); $text = sprintf(__('For security reasons the %1$s plugin functionality was turned off because no necessary upgrade of the plugin could be performed. All code may be viewable to your blog readers. This is plugin version %2$s but previously there was version %3$s installed. Downgrading from a newer version to an older version of the plugin is not supported.', ExecPhp_PLUGIN_ID) , ExecPhp_PLUGIN_NAME, ExecPhp_VERSION, $option->get_version()); $this->print_admin_message($heading, $text); } function filter_admin_footer_unknown() { $option =& $this->m_cache->get_option(); $heading = sprintf(__('%s plugin is not active.', ExecPhp_PLUGIN_ID) , ExecPhp_PLUGIN_NAME); $text = sprintf(__('For security reasons the %1$s plugin functionality was turned off because an unknown error (%2$s) occured. All code may be viewable to your blog readers. This should never happen if you use the plugin with a compatible WordPress version and installed it as described in the documentation.', ExecPhp_PLUGIN_ID) , ExecPhp_PLUGIN_NAME, $option->get_cooperation_status()); $this->print_admin_message($heading, $text); } // ---------------------------------------------------------------------------- // tools // ---------------------------------------------------------------------------- function print_admin_message($heading, $text) { ?> m_cache->get_option(); if (isset($_POST[ExecPhp_ACTION_UPDATE_OPTIONS])) { check_admin_referer(ExecPhp_ACTION_UPDATE_OPTIONS); $option->set_from_POST(); $option->save(); echo '

'. __('Options saved.', ExecPhp_PLUGIN_ID) . "

\n"; } $this->toggle_filter($option->get_status()); ?>

<?php ?> code in your posts, pages and text widgets. Execution of PHP code can be restricted by assigning the "exec_php" capability to individual users or roles by using a role manager plugin. A local copy of the documentation comes with this plugin. New versions and further documentation may be found on the official plugin page.", ExecPhp_PLUGIN_ID), get_option('siteurl'). '/'. ExecPhp_DIR. '/docs/readme.html'); ?>