Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: plugins.php 3870 2008-05-31 22:20:03Z Tikitiki $
| * $Id: plugins.php 4559 2009-11-29 08:48:42Z RyanGordon $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 29 | Zeile 29 |
---|
if($plugins_list) {
|
if($plugins_list) {
|
| $active_hooks = $plugins->hooks;
|
foreach($plugins_list as $plugin_file) { require_once MYBB_ROOT."inc/plugins/".$plugin_file;
| foreach($plugins_list as $plugin_file) { require_once MYBB_ROOT."inc/plugins/".$plugin_file;
|
Zeile 39 | Zeile 40 |
---|
continue; } $plugininfo = $infofunc();
|
continue; } $plugininfo = $infofunc();
|
| $plugininfo['guid'] = trim($plugininfo['guid']);
|
|
|
if(trim($plugininfo['guid']) != "")
| if($plugininfo['guid'] != "")
|
{ $info[] = $plugininfo['guid']; $names[$plugininfo['guid']] = array('name' => $plugininfo['name'], 'version' => $plugininfo['version']); } }
|
{ $info[] = $plugininfo['guid']; $names[$plugininfo['guid']] = array('name' => $plugininfo['name'], 'version' => $plugininfo['version']); } }
|
| $plugins->hooks = $active_hooks;
|
} if(empty($info))
| } if(empty($info))
|
Zeile 54 | Zeile 57 |
---|
admin_redirect("index.php?module=config/plugins"); }
|
admin_redirect("index.php?module=config/plugins"); }
|
require_once MYBB_ROOT."inc/class_xml.php"; $contents = fetch_remote_file("http://mods.mybboard.net/version_check.php?info=".serialize($info));
| $url = "http://mods.mybboard.net/version_check.php?"; foreach($info as $guid) { $url .= "info[]=".urlencode($guid)."&"; } $url = substr($url, 0, -1); require_once MYBB_ROOT."inc/class_xml.php"; $contents = fetch_remote_file($url);
|
if(!$contents) { flash_message($lang->error_vcheck_communications_problem, 'error');
|
if(!$contents) { flash_message($lang->error_vcheck_communications_problem, 'error');
|
admin_redirect("index.php?module=config/plugins"); }
| admin_redirect("index.php?module=config/plugins"); }
|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
| $parser = new XMLParser($contents); $tree = $parser->get_tree();
|
Zeile 81 | Zeile 91 |
---|
} flash_message($lang->error_communication_problem.$error_msg, 'error');
|
} flash_message($lang->error_communication_problem.$error_msg, 'error');
|
admin_redirect("index.php?module=config/plugins"); } $table = new Table;
| admin_redirect("index.php?module=config/plugins"); } $table = new Table;
|
$table->construct_header($lang->plugin); $table->construct_header($lang->your_version, array("class" => "align_center", 'width' => 125)); $table->construct_header($lang->latest_version, array("class" => "align_center", 'width' => 125));
| $table->construct_header($lang->plugin); $table->construct_header($lang->your_version, array("class" => "align_center", 'width' => 125)); $table->construct_header($lang->latest_version, array("class" => "align_center", 'width' => 125));
|
Zeile 112 | Zeile 122 |
---|
$table->construct_cell("<strong><span style=\"color: #C00\">{$plugin['version']['value']}</span></strong>", array("class" => "align_center")); $table->construct_cell("<strong><a href=\"http://mods.mybboard.net/view/{$plugin['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row();
|
$table->construct_cell("<strong><span style=\"color: #C00\">{$plugin['version']['value']}</span></strong>", array("class" => "align_center")); $table->construct_cell("<strong><a href=\"http://mods.mybboard.net/view/{$plugin['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row();
|
} }
| } }
|
if($table->num_rows() == 0) { flash_message($lang->success_plugins_up_to_date, 'success');
|
if($table->num_rows() == 0) { flash_message($lang->success_plugins_up_to_date, 'success');
|
admin_redirect("index.php?module=config/plugins"); } $page->add_breadcrumb_item($lang->plugin_updates);
| admin_redirect("index.php?module=config/plugins"); } $page->add_breadcrumb_item($lang->plugin_updates);
|
$page->output_header($lang->plugin_updates); $sub_tabs['update_plugins'] = array( 'title' => $lang->plugin_updates,
|
$page->output_header($lang->plugin_updates); $sub_tabs['update_plugins'] = array( 'title' => $lang->plugin_updates,
|
'link' => "index.php?module=config/plugin&action=check",
| 'link' => "index.php?module=config/plugins&action=check",
|
'description' => $lang->plugin_updates_desc );
|
'description' => $lang->plugin_updates_desc );
|
|
|
$page->output_nav_tabs($sub_tabs, 'update_plugins'); $table->output($lang->plugin_updates);
|
$page->output_nav_tabs($sub_tabs, 'update_plugins'); $table->output($lang->plugin_updates);
|
|
|
$page->output_footer(); }
// Activates or deactivates a specific plugin if($mybb->input['action'] == "activate" || $mybb->input['action'] == "deactivate") {
|
$page->output_footer(); }
// Activates or deactivates a specific plugin if($mybb->input['action'] == "activate" || $mybb->input['action'] == "deactivate") {
|
| if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=config/plugins"); }
|
if($mybb->input['action'] == "activate") { $plugins->run_hooks("admin_config_plugins_activate");
|
if($mybb->input['action'] == "activate") { $plugins->run_hooks("admin_config_plugins_activate");
|
} else
| } else
|
{ $plugins->run_hooks("admin_config_plugins_deactivate");
|
{ $plugins->run_hooks("admin_config_plugins_deactivate");
|
}
| }
|
$codename = $mybb->input['plugin']; $codename = str_replace(array(".", "/", "\\"), "", $codename); $file = basename($codename.".php");
|
$codename = $mybb->input['plugin']; $codename = str_replace(array(".", "/", "\\"), "", $codename); $file = basename($codename.".php");
|
|
|
// Check if the file exists and throw an error if it doesn't if(!file_exists(MYBB_ROOT."inc/plugins/$file")) { flash_message($lang->error_invalid_plugin, 'error'); admin_redirect("index.php?module=config/plugins");
|
// Check if the file exists and throw an error if it doesn't if(!file_exists(MYBB_ROOT."inc/plugins/$file")) { flash_message($lang->error_invalid_plugin, 'error'); admin_redirect("index.php?module=config/plugins");
|
}
| }
|
$plugins_cache = $cache->read("plugins"); $active_plugins = $plugins_cache['active'];
| $plugins_cache = $cache->read("plugins"); $active_plugins = $plugins_cache['active'];
|
Zeile 174 | Zeile 190 |
---|
} $install_uninstall = false;
|
} $install_uninstall = false;
|
if($mybb->input['action'] == "activate")
| if($mybb->input['action'] == "activate")
|
{ $message = $lang->success_plugin_activated;
| { $message = $lang->success_plugin_activated;
|
Zeile 205 | Zeile 221 |
---|
else if($mybb->input['action'] == "deactivate") { $message = $lang->success_plugin_deactivated;
|
else if($mybb->input['action'] == "deactivate") { $message = $lang->success_plugin_deactivated;
|
|
|
if(function_exists("{$codename}_deactivate")) { call_user_func("{$codename}_deactivate");
| if(function_exists("{$codename}_deactivate")) { call_user_func("{$codename}_deactivate");
|
Zeile 295 | Zeile 311 |
---|
if($plugins->is_compatible($codename) == false) { $compatibility_warning = "<span style=\"color: red;\">".$lang->sprintf($lang->plugin_incompatible, $mybb->version)."</span>";
|
if($plugins->is_compatible($codename) == false) { $compatibility_warning = "<span style=\"color: red;\">".$lang->sprintf($lang->plugin_incompatible, $mybb->version)."</span>";
|
| } else { $compatibility_warning = "";
|
}
$installed_func = "{$codename}_is_installed";
| }
$installed_func = "{$codename}_is_installed";
|
Zeile 331 | Zeile 351 |
---|
} else {
|
} else {
|
$table->construct_cell("<a href=\"index.php?module=config/plugins&action=activate&plugin={$codename}\">{$lang->install_and_activate}</a>", array("class" => "align_center", "colspan" => 2));
| $table->construct_cell("<a href=\"index.php?module=config/plugins&action=activate&plugin={$codename}&my_post_key={$mybb->post_code}\">{$lang->install_and_activate}</a>", array("class" => "align_center", "colspan" => 2));
|
} } // Plugin is activated and installed else if($active_plugins[$codename]) {
|
} } // Plugin is activated and installed else if($active_plugins[$codename]) {
|
$table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&plugin={$codename}\">{$lang->deactivate}</a>", array("class" => "align_center", "width" => 150));
| $table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&plugin={$codename}&my_post_key={$mybb->post_code}\">{$lang->deactivate}</a>", array("class" => "align_center", "width" => 150));
|
if($uninstall_button) {
|
if($uninstall_button) {
|
$table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&uninstall=1&plugin={$codename}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
| $table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&uninstall=1&plugin={$codename}&my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
|
} else {
| } else {
|
Zeile 350 | Zeile 370 |
---|
// Plugin is installed but not active else if($installed == true) {
|
// Plugin is installed but not active else if($installed == true) {
|
$table->construct_cell("<a href=\"index.php?module=config/plugins&action=activate&plugin={$codename}\">{$lang->activate}</a>", array("class" => "align_center", "width" => 150));
| $table->construct_cell("<a href=\"index.php?module=config/plugins&action=activate&plugin={$codename}&my_post_key={$mybb->post_code}\">{$lang->activate}</a>", array("class" => "align_center", "width" => 150));
|
if($uninstall_button) {
|
if($uninstall_button) {
|
$table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&uninstall=1&plugin={$codename}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
| $table->construct_cell("<a href=\"index.php?module=config/plugins&action=deactivate&uninstall=1&plugin={$codename}&my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
|
} else {
| } else {
|
Zeile 366 | Zeile 386 |
---|
if($table->num_rows() == 0) {
|
if($table->num_rows() == 0) {
|
$table->contruct_cell($lang->no_plugins, array('colspan' => 2));
| $table->construct_cell($lang->no_plugins, array('colspan' => 3));
|
$table->construct_row(); } $table->output($lang->plugins);
| $table->construct_row(); } $table->output($lang->plugins);
|