|
1 <?php |
|
2 |
|
3 // ----------------------------------------------------------------------------- |
|
4 // the ExecPhp_Const function defines plugin wide constants |
|
5 // ----------------------------------------------------------------------------- |
|
6 |
|
7 if (!class_exists('ExecPhp_Const')) : |
|
8 |
|
9 define('ExecPhp_VERSION', '4.9'); |
|
10 define('ExecPhp_PLUGIN_ID', 'exec-php'); |
|
11 |
|
12 // relative path of stored plugins to ABSPATH; only required for WP < 2.6 |
|
13 global $wp_version; |
|
14 if (version_compare($wp_version, '2.6.dev') >= 0) |
|
15 { |
|
16 // relative path of plugin to PLUGINDIR |
|
17 $execphp_path = str_replace('\\', '/', dirname(dirname(__FILE__))); |
|
18 $execphp_plugin_path = str_replace('\\', '/', WP_PLUGIN_DIR); |
|
19 define('ExecPhp_HOMEDIR', trim(str_replace($execphp_plugin_path, '', $execphp_path), '/')); |
|
20 } |
|
21 else |
|
22 { |
|
23 // ExecPhp_PLUGINDIR only available for WP < 2.6 |
|
24 if (defined('PLUGINDIR')) |
|
25 define('ExecPhp_PLUGINDIR', PLUGINDIR); |
|
26 else |
|
27 define('ExecPhp_PLUGINDIR', 'wp-content/plugins'); |
|
28 |
|
29 // relative path of plugin to PLUGINDIR |
|
30 $execphp_path = str_replace('\\', '/', dirname(dirname(__FILE__))); |
|
31 $execphp_offset = 0; |
|
32 while (($execphp_n = strpos($execphp_path, ExecPhp_PLUGINDIR, $execphp_offset)) !== false) |
|
33 $execphp_offset = $execphp_n + 1; |
|
34 define('ExecPhp_HOMEDIR', substr($execphp_path, $execphp_offset + strlen(ExecPhp_PLUGINDIR))); |
|
35 } |
|
36 |
|
37 if (defined('WP_PLUGIN_DIR')) |
|
38 define('ExecPhp_HOME_DIR', WP_PLUGIN_DIR. '/'. ExecPhp_HOMEDIR); |
|
39 else |
|
40 define('ExecPhp_HOME_DIR', ABSPATH. ExecPhp_PLUGINDIR. '/'. ExecPhp_HOMEDIR); |
|
41 |
|
42 if (defined('WP_PLUGIN_URL')) |
|
43 define('ExecPhp_HOME_URL', WP_PLUGIN_URL. '/'. ExecPhp_HOMEDIR); |
|
44 else |
|
45 define('ExecPhp_HOME_URL', get_option('siteurl'). '/'. ExecPhp_PLUGINDIR. '/'. ExecPhp_HOMEDIR); |
|
46 |
|
47 define('ExecPhp_CAPABILITY_EXECUTE_WIDGETS', 'switch_themes'); |
|
48 define('ExecPhp_CAPABILITY_EXECUTE_ARTICLES', 'exec_php'); |
|
49 define('ExecPhp_CAPABILITY_WRITE_PHP', 'unfiltered_html'); |
|
50 define('ExecPhp_CAPABILITY_EDIT_PLUGINS', 'edit_plugins'); |
|
51 define('ExecPhp_CAPABILITY_EDIT_USERS', 'edit_users'); |
|
52 define('ExecPhp_CAPABILITY_EDIT_OTHERS_POSTS', 'edit_others_posts'); |
|
53 define('ExecPhp_CAPABILITY_EDIT_OTHERS_PAGES', 'edit_others_pages'); |
|
54 define('ExecPhp_CAPABILITY_EDIT_OTHERS_PHP', 'edit_others_php'); |
|
55 |
|
56 define('ExecPhp_STATUS_OKAY', 0); |
|
57 define('ExecPhp_STATUS_UNINITIALIZED', 1); |
|
58 define('ExecPhp_STATUS_PLUGIN_VERSION_MISMATCH', 2); |
|
59 |
|
60 define('ExecPhp_ACTION_REQUEST_USERS', 'execphp_request_users'); |
|
61 define('ExecPhp_REQUEST_FEATURE_SECURITY_HOLE', 'security_hole'); |
|
62 define('ExecPhp_REQUEST_FEATURE_WIDGETS', 'widgets'); |
|
63 define('ExecPhp_REQUEST_FEATURE_EXECUTE_ARTICLES', 'execute_articles'); |
|
64 |
|
65 define('ExecPhp_POST_WIDGET_SUPPORT', 'execphp_widget_support'); |
|
66 define('ExecPhp_POST_WYSIWYG_WARNING', 'execphp_wysiwyg_warning'); |
|
67 |
|
68 define('ExecPhp_ID_CONFIG_FORM', 'execphp-configuration'); |
|
69 define('ExecPhp_ID_INFO_FORM', 'execphp-information'); |
|
70 |
|
71 define('ExecPhp_ID_INFO_SECURITY_HOLE', 'execphp-security-hole'); |
|
72 define('ExecPhp_ID_INFO_WIDGETS', 'execphp-widgets'); |
|
73 define('ExecPhp_ID_INFO_EXECUTE_ARTICLES', 'execphp-execute-articles'); |
|
74 define('ExecPhp_ID_MESSAGE', 'execphp-message'); |
|
75 |
|
76 define('ExecPhp_ID_SCRIPT_COMMON', 'execphp_common'); |
|
77 define('ExecPhp_ID_SCRIPT_ADMIN', 'execphp_admin'); |
|
78 define('ExecPhp_ID_L10N_COMMON', 'execphpCommonL10n'); |
|
79 define('ExecPhp_ID_L10N_ADMIN', 'execphpAdminL10n'); |
|
80 define('ExecPhp_ID_STYLE_ADMIN', 'execphp_admin'); |
|
81 |
|
82 class ExecPhp_Const |
|
83 { |
|
84 } |
|
85 endif; |
|
86 |
|
87 ?> |