Zeile 44 | Zeile 44 |
---|
$page->output_nav_tabs($sub_tabs, 'browse_plugins');
// Process search requests
|
$page->output_nav_tabs($sub_tabs, 'browse_plugins');
// Process search requests
|
require_once MYBB_ROOT."inc/class_xml.php";
| |
$keywords = "";
|
$keywords = "";
|
if($mybb->input['keywords'])
| if($mybb->get_input('keywords'))
|
{ $keywords = "&keywords=".urlencode($mybb->input['keywords']); }
|
{ $keywords = "&keywords=".urlencode($mybb->input['keywords']); }
|
if($mybb->input['page'])
| if($mybb->get_input('page'))
|
{
|
{
|
$url_page = "&page=".$mybb->get_input('page', 1);
| $url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT);
|
} else {
| } else {
|
Zeile 67 | Zeile 65 |
---|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
$contents = fetch_remote_file("http://community.mybb.com/xmlbrowse.php?type=plugins&version={$search_version}{$keywords}{$url_page}", $post_data);
| $contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?api=2&type=plugins&version={$search_version}{$keywords}{$url_page}");
|
if(!$contents)
|
if(!$contents)
|
{ $page->output_inline_error($lang->error_communication_problem); $page->output_footer();
| { $page->output_inline_error($lang->error_communication_problem); $page->output_footer();
|
exit; }
| exit; }
|
Zeile 81 | Zeile 79 |
---|
$table->construct_header($lang->latest_version, array("class" => "align_center", 'width' => 125)); $table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
|
$table->construct_header($lang->latest_version, array("class" => "align_center", 'width' => 125)); $table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
|
$parser = new XMLParser($contents);
| $parser = create_xml_parser($contents);
|
$tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['results']))
| $tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['results']))
|
Zeile 107 | Zeile 105 |
---|
{ $result['name']['value'] = htmlspecialchars_uni($result['name']['value']); $result['description']['value'] = htmlspecialchars_uni($result['description']['value']);
|
{ $result['name']['value'] = htmlspecialchars_uni($result['name']['value']); $result['description']['value'] = htmlspecialchars_uni($result['description']['value']);
|
$result['author']['value'] = $post_parser->parse_message($result['author']['value'], array( 'allow_html' => true ) );
| $result['author']['url']['value'] = htmlspecialchars_uni($result['author']['url']['value']); $result['author']['name']['value'] = htmlspecialchars_uni($result['author']['name']['value']);
|
$result['version']['value'] = htmlspecialchars_uni($result['version']['value']); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
$result['version']['value'] = htmlspecialchars_uni($result['version']['value']); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");
| $table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} <a href=\"{$result['author']['url']['value']}\" target=\"_blank\" rel=\"noopener\">{$result['author']['name']['value']}</a></small></i>");
|
$table->construct_cell($result['version']['value'], array("class" => "align_center"));
|
$table->construct_cell($result['version']['value'], array("class" => "align_center"));
|
$table->construct_cell("<strong><a href=\"http://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row(); } }
| $table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row(); } }
|
|
|
| $no_results = false;
|
if($table->num_rows() == 0) { $table->construct_cell($lang->error_no_results_found, array("colspan" => 3)); $table->construct_row();
|
if($table->num_rows() == 0) { $table->construct_cell($lang->error_no_results_found, array("colspan" => 3)); $table->construct_row();
|
| $no_results = true;
|
}
$search = new Form("index.php?module=config-plugins&action=browse", 'post', 'search_form'); echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">";
|
}
$search = new Form("index.php?module=config-plugins&action=browse", 'post', 'search_form'); echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">";
|
if($mybb->input['keywords'])
| if($mybb->get_input('keywords'))
|
{ $default_class = ''; $value = htmlspecialchars_uni($mybb->input['keywords']);
|
{ $default_class = ''; $value = htmlspecialchars_uni($mybb->input['keywords']);
|
}
| }
|
else { $default_class = "search_default";
| else { $default_class = "search_default";
|
Zeile 143 | Zeile 141 |
---|
echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; echo "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; echo "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
form.submit(function()
| form.on('submit', function()
|
{ var search = $(\"#search_keywords\"); if(search.val() == '' || search.val() == '{$lang->search_for_plugins}') {
|
{ var search = $(\"#search_keywords\"); if(search.val() == '' || search.val() == '{$lang->search_for_plugins}') {
|
search.focus();
| search.trigger('focus');
|
return false;
|
return false;
|
}
| }
|
});
var search = $(\"#search_keywords\");
|
});
var search = $(\"#search_keywords\");
|
search.focus(function()
| search.on('focus', function()
|
{ var searched_focus = $(this); if(searched_focus.val() == '{$lang->search_for_plugins}')
| { var searched_focus = $(this); if(searched_focus.val() == '{$lang->search_for_plugins}')
|
Zeile 162 | Zeile 160 |
---|
searched_focus.removeClass(\"search_default\"); searched_focus.val(\"\"); }
|
searched_focus.removeClass(\"search_default\"); searched_focus.val(\"\"); }
|
});
search.blur(function()
| }).on('blur', function()
|
{ var searched_blur = $(this); if(searched_blur.val() == \"\")
| { var searched_blur = $(this); if(searched_blur.val() == \"\")
|
Zeile 185 | Zeile 181 |
---|
// Recommended plugins = Default; Otherwise search results & pagination if($mybb->request_method == "post")
|
// Recommended plugins = Default; Otherwise search results & pagination if($mybb->request_method == "post")
|
{ $table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=plugins\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version)); } else { $table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=plugins\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->recommended_plugins_for_mybb, $mybb->version)); }
| { $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=plugins\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version)); } else { $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=plugins\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->recommended_plugins_for_mybb, $mybb->version)); }
|
|
|
echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=config-plugins&action=browse{$keywords}&page={page}");
| if(!$no_results) { echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=config-plugins&action=browse{$keywords}&page={page}"); }
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 207 | Zeile 206 |
---|
$info = array();
if($plugins_list)
|
$info = array();
if($plugins_list)
|
{
| {
|
$active_hooks = $plugins->hooks; foreach($plugins_list as $plugin_file) {
| $active_hooks = $plugins->hooks; foreach($plugins_list as $plugin_file) {
|
Zeile 215 | Zeile 214 |
---|
$codename = str_replace(".php", "", $plugin_file); $infofunc = $codename."_info"; if(!function_exists($infofunc))
|
$codename = str_replace(".php", "", $plugin_file); $infofunc = $codename."_info"; if(!function_exists($infofunc))
|
{
| {
|
continue; } $plugininfo = $infofunc();
|
continue; } $plugininfo = $infofunc();
|
$plugininfo['guid'] = trim($plugininfo['guid']); $plugininfo['codename'] = trim($plugininfo['codename']);
| $plugininfo['guid'] = isset($plugininfo['guid']) ? trim($plugininfo['guid']) : null; $plugininfo['codename'] = isset($plugininfo['codename']) ? trim($plugininfo['codename']) : null;
|
if($plugininfo['codename'] != "") {
| if($plugininfo['codename'] != "") {
|
Zeile 239 | Zeile 238 |
---|
if(empty($info)) { flash_message($lang->error_vcheck_no_supported_plugins, 'error');
|
if(empty($info)) { flash_message($lang->error_vcheck_no_supported_plugins, 'error');
|
admin_redirect("index.php?module=config-plugins"); }
$url = "http://community.mybb.com/version_check.php?";
| admin_redirect("index.php?module=config-plugins"); }
$url = "https://community.mybb.com/version_check.php?";
|
$url .= http_build_query(array("info" => $info))."&";
|
$url .= http_build_query(array("info" => $info))."&";
|
require_once MYBB_ROOT."inc/class_xml.php";
| |
$contents = fetch_remote_file($url);
if(!$contents)
| $contents = fetch_remote_file($url);
if(!$contents)
|
Zeile 253 | Zeile 251 |
---|
admin_redirect("index.php?module=config-plugins"); }
|
admin_redirect("index.php?module=config-plugins"); }
|
$parser = new XMLParser($contents);
| $contents = trim($contents);
$parser = create_xml_parser($contents);
|
$tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['plugins'])) { flash_message($lang->error_communication_problem, 'error');
|
$tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['plugins'])) { flash_message($lang->error_communication_problem, 'error');
|
admin_redirect("index.php?module=config-plugins"); }
| admin_redirect("index.php?module=config-plugins"); }
|
if(array_key_exists('error', $tree['plugins'])) {
| if(array_key_exists('error', $tree['plugins'])) {
|
Zeile 268 | Zeile 268 |
---|
{ case "1": $error_msg = $lang->error_no_input;
|
{ case "1": $error_msg = $lang->error_no_input;
|
break;
| break;
|
case "2": $error_msg = $lang->error_no_pids; break;
| case "2": $error_msg = $lang->error_no_pids; break;
|
Zeile 276 | Zeile 276 |
---|
$error_msg = ""; } flash_message($lang->error_communication_problem.$error_msg, 'error');
|
$error_msg = ""; } flash_message($lang->error_communication_problem.$error_msg, 'error');
|
admin_redirect("index.php?module=config-plugins");
| admin_redirect("index.php?module=config-plugins");
|
}
$table = new Table;
| }
$table = new Table;
|
Zeile 284 | Zeile 284 |
---|
$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->controls, array("class" => "align_center", 'width' => 125));
|
$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->controls, array("class" => "align_center", 'width' => 125));
|
|
|
if(!is_array($tree['plugins']['plugin'])) { flash_message($lang->success_plugins_up_to_date, 'success');
| if(!is_array($tree['plugins']['plugin'])) { flash_message($lang->success_plugins_up_to_date, 'success');
|
Zeile 292 | Zeile 292 |
---|
}
if(array_key_exists("tag", $tree['plugins']['plugin']))
|
}
if(array_key_exists("tag", $tree['plugins']['plugin']))
|
{
| {
|
$only_plugin = $tree['plugins']['plugin']; unset($tree['plugins']['plugin']); $tree['plugins']['plugin'][0] = $only_plugin;
| $only_plugin = $tree['plugins']['plugin']; unset($tree['plugins']['plugin']); $tree['plugins']['plugin'][0] = $only_plugin;
|
Zeile 306 | Zeile 306 |
---|
if(version_compare($names[$plugin['attributes'][$compare_by]]['version'], $plugin['version']['value'], "<")) { $plugin['download_url']['value'] = htmlspecialchars_uni($plugin['download_url']['value']);
|
if(version_compare($names[$plugin['attributes'][$compare_by]]['version'], $plugin['version']['value'], "<")) { $plugin['download_url']['value'] = htmlspecialchars_uni($plugin['download_url']['value']);
|
$plugin['vulnerable']['value'] = htmlspecialchars_uni($plugin['vulnerable']['value']);
| |
$plugin['version']['value'] = htmlspecialchars_uni($plugin['version']['value']);
|
$plugin['version']['value'] = htmlspecialchars_uni($plugin['version']['value']);
|
if($is_vulnerable)
| if(isset($plugin['vulnerable']['value'])) { $plugin['vulnerable']['value'] = htmlspecialchars_uni($plugin['vulnerable']['value']); }
if($is_vulnerable)
|
{ $table->construct_cell("<div class=\"error\" id=\"flash_message\"> {$lang->error_vcheck_vulnerable} {$names[$plugin['attributes'][$compare_by]]['name']}
| { $table->construct_cell("<div class=\"error\" id=\"flash_message\"> {$lang->error_vcheck_vulnerable} {$names[$plugin['attributes'][$compare_by]]['name']}
|
Zeile 317 | Zeile 321 |
---|
<p> <b>{$lang->error_vcheck_vulnerable_notes}</b> <br /><br /> {$plugin['vulnerable']['value']}</p>"); } else
|
<p> <b>{$lang->error_vcheck_vulnerable_notes}</b> <br /><br /> {$plugin['vulnerable']['value']}</p>"); } else
|
{
| {
|
$table->construct_cell("<strong>{$names[$plugin['attributes'][$compare_by]]['name']}</strong>"); } $table->construct_cell("{$names[$plugin['attributes'][$compare_by]]['version']}", array("class" => "align_center"));
| $table->construct_cell("<strong>{$names[$plugin['attributes'][$compare_by]]['name']}</strong>"); } $table->construct_cell("{$names[$plugin['attributes'][$compare_by]]['version']}", array("class" => "align_center"));
|
Zeile 325 | Zeile 329 |
---|
if($is_vulnerable) { $table->construct_cell("<a href=\"index.php?module=config-plugins\"><b>{$lang->deactivate}</b></a>", array("class" => "align_center", "width" => 150));
|
if($is_vulnerable) { $table->construct_cell("<a href=\"index.php?module=config-plugins\"><b>{$lang->deactivate}</b></a>", array("class" => "align_center", "width" => 150));
|
}
| }
|
else {
|
else {
|
$table->construct_cell("<strong><a href=\"http://community.mybb.com/{$plugin['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
| $table->construct_cell("<strong><a href=\"https://community.mybb.com/{$plugin['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center"));
|
} $table->construct_row(); }
| } $table->construct_row(); }
|
Zeile 371 | Zeile 375 |
---|
// Activates or deactivates a specific plugin if($mybb->input['action'] == "activate" || $mybb->input['action'] == "deactivate") {
|
// Activates or deactivates a specific plugin if($mybb->input['action'] == "activate" || $mybb->input['action'] == "deactivate") {
|
if(!verify_post_check($mybb->input['my_post_key']))
| if(!verify_post_check($mybb->get_input('my_post_key')))
|
{ flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=config-plugins");
| { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=config-plugins");
|
Zeile 398 | Zeile 402 |
---|
}
$plugins_cache = $cache->read("plugins");
|
}
$plugins_cache = $cache->read("plugins");
|
$active_plugins = $plugins_cache['active'];
| $active_plugins = isset($plugins_cache['active']) ? $plugins_cache['active'] : array();
|
require_once MYBB_ROOT."inc/plugins/$file";
| require_once MYBB_ROOT."inc/plugins/$file";
|
Zeile 447 | Zeile 451 |
---|
call_user_func("{$codename}_deactivate"); }
|
call_user_func("{$codename}_deactivate"); }
|
if($mybb->input['uninstall'] == 1 && function_exists("{$codename}_uninstall"))
| if($mybb->get_input('uninstall') == 1 && function_exists("{$codename}_uninstall"))
|
{ call_user_func("{$codename}_uninstall"); $message = $lang->success_plugin_uninstalled;
| { call_user_func("{$codename}_uninstall"); $message = $lang->success_plugin_uninstalled;
|
Zeile 503 | Zeile 507 |
---|
// Let's make things easier for our user - show them active // and inactive plugins in different lists $plugins_cache = $cache->read("plugins");
|
// Let's make things easier for our user - show them active // and inactive plugins in different lists $plugins_cache = $cache->read("plugins");
|
$active_plugins = $plugins_cache['active'];
| $active_plugins = array(); if(!empty($plugins_cache['active'])) { $active_plugins = $plugins_cache['active']; }
|
$plugins_list = get_plugins_list();
|
$plugins_list = get_plugins_list();
|
$plugins->run_hooks("admin_config_plugins_plugin_list");
| $plugins->run_hooks("admin_config_plugins_plugin_list");
|
if(!empty($plugins_list)) { $a_plugins = $i_plugins = array();
| if(!empty($plugins_list)) { $a_plugins = $i_plugins = array();
|
Zeile 522 | Zeile 530 |
---|
if(!function_exists($infofunc)) { continue;
|
if(!function_exists($infofunc)) { continue;
|
}
| }
|
$plugininfo = $infofunc(); $plugininfo['codename'] = $codename;
|
$plugininfo = $infofunc(); $plugininfo['codename'] = $codename;
|
if($active_plugins[$codename])
| if(isset($active_plugins[$codename]))
|
{ // This is an active plugin $plugininfo['is_active'] = 1;
|
{ // This is an active plugin $plugininfo['is_active'] = 1;
|
|
|
$a_plugins[] = $plugininfo;
|
$a_plugins[] = $plugininfo;
|
continue;
| |
}
|
}
|
// Either installed and not active or completely inactive $i_plugins[] = $plugininfo; }
$table = new Table; $table->construct_header($lang->plugin);
| else { // Either installed and not active or completely inactive $plugininfo['is_active'] = 0; $i_plugins[] = $plugininfo; } }
$table = new Table; $table->construct_header($lang->plugin);
|
$table->construct_header($lang->controls, array("colspan" => 2, "class" => "align_center", "width" => 300));
if(empty($a_plugins)) { $table->construct_cell($lang->no_active_plugins, array('colspan' => 3));
|
$table->construct_header($lang->controls, array("colspan" => 2, "class" => "align_center", "width" => 300));
if(empty($a_plugins)) { $table->construct_cell($lang->no_active_plugins, array('colspan' => 3));
|
$table->construct_row(); } else
| $table->construct_row(); } else
|
{ build_plugin_list($a_plugins);
|
{ build_plugin_list($a_plugins);
|
}
$table->output($lang->active_plugin);
$table = new Table; $table->construct_header($lang->plugin);
| }
$table->output($lang->active_plugin);
$table = new Table; $table->construct_header($lang->plugin);
|
$table->construct_header($lang->controls, array("colspan" => 2, "class" => "align_center", "width" => 300));
if(empty($i_plugins))
| $table->construct_header($lang->controls, array("colspan" => 2, "class" => "align_center", "width" => 300));
if(empty($i_plugins))
|
Zeile 581 | Zeile 591 |
---|
$table->construct_cell($lang->no_plugins, array('colspan' => 3)); $table->construct_row();
|
$table->construct_cell($lang->no_plugins, array('colspan' => 3)); $table->construct_row();
|
|
|
$table->output($lang->plugins); }
|
$table->output($lang->plugins); }
|
|
|
$page->output_footer(); }
|
$page->output_footer(); }
|
| /** * @return array */
|
function get_plugins_list() {
|
function get_plugins_list() {
|
| $plugins_list = array();
|
// Get a list of the plugin files which exist in the plugins directory $dir = @opendir(MYBB_ROOT."inc/plugins/"); if($dir)
| // Get a list of the plugin files which exist in the plugins directory $dir = @opendir(MYBB_ROOT."inc/plugins/"); if($dir)
|
Zeile 609 | Zeile 624 |
---|
return $plugins_list; }
|
return $plugins_list; }
|
| /** * @param array $plugin_list */
|
function build_plugin_list($plugin_list) { global $lang, $mybb, $plugins, $table;
foreach($plugin_list as $plugininfo) {
|
function build_plugin_list($plugin_list) { global $lang, $mybb, $plugins, $table;
foreach($plugin_list as $plugininfo) {
|
if($plugininfo['website'])
| if(!empty($plugininfo['website']))
|
{ $plugininfo['name'] = "<a href=\"".$plugininfo['website']."\">".$plugininfo['name']."</a>"; }
|
{ $plugininfo['name'] = "<a href=\"".$plugininfo['website']."\">".$plugininfo['name']."</a>"; }
|
if($plugininfo['authorsite'])
| if(!empty($plugininfo['authorsite']))
|
{ $plugininfo['author'] = "<a href=\"".$plugininfo['authorsite']."\">".$plugininfo['author']."</a>"; }
| { $plugininfo['author'] = "<a href=\"".$plugininfo['authorsite']."\">".$plugininfo['author']."</a>"; }
|