@@ -73,43 +73,4 @@ public function deactivate($plugin = null)
7373 Url::redirect ($ this ->feather ->urlFor ('adminPlugins ' ), array ('warning ' , 'Plugin deactivated! ' ));
7474 }
7575
76- public function display ()
77- {
78- // The plugin to load should be supplied via GET
79- $ plugin = $ this ->request ->get ('plugin ' ) ? $ this ->request ->get ('plugin ' ) : '' ;
80- if (!preg_match ('%^AM?P_(\w*?)\.php$%i ' , $ plugin )) {
81- throw new Error (__ ('Bad request ' ), 400 );
82- }
83-
84- // AP_ == Admins only, AMP_ == admins and moderators
85- $ prefix = substr ($ plugin , 0 , strpos ($ plugin , '_ ' ));
86- if ($ this ->user ->g_moderator == '1 ' && $ prefix == 'AP ' ) {
87- throw new Error (__ ('No permission ' ), 403 );
88- }
89-
90- // Make sure the file actually exists
91- if (!file_exists ($ this ->feather ->forum_env ['FEATHER_ROOT ' ].'plugins/ ' .$ plugin )) {
92- throw new Error (sprintf (__ ('No plugin message ' ), Utils::escape ($ plugin )), 400 );
93- }
94-
95- // Construct REQUEST_URI if it isn't set TODO?
96- if (!isset ($ _SERVER ['REQUEST_URI ' ])) {
97- $ _SERVER ['REQUEST_URI ' ] = (isset ($ _SERVER ['PHP_SELF ' ]) ? $ _SERVER ['PHP_SELF ' ] : '' ).'? ' .(isset ($ _SERVER ['QUERY_STRING ' ]) ? $ _SERVER ['QUERY_STRING ' ] : '' );
98- }
99-
100- // Attempt to load the plugin. We don't use @ here to suppress error messages,
101- // because if we did and a parse error occurred in the plugin, we would only
102- // get the "blank page of death"
103- include $ this ->feather ->forum_env ['FEATHER_ROOT ' ].'plugins/ ' .$ plugin ;
104- if (!defined ('FEATHER_PLUGIN_LOADED ' )) {
105- throw new Error (sprintf (__ ('Plugin failed message ' ), Utils::escape ($ plugin )));
106- }
107-
108- $ this ->feather ->template ->setPageInfo (array (
109- 'title ' => array (Utils::escape ($ this ->config ['o_board_title ' ]), __ ('Admin ' ), str_replace ('_ ' , ' ' , substr ($ plugin , strpos ($ plugin , '_ ' ) + 1 , -4 ))),
110- 'active_page ' => 'admin ' ,
111- 'admin_console ' => true ,
112- )
113- )->addTemplate ('admin/loader.php ' )->display ();
114- }
11576}
0 commit comments