mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 06:55:25 +02:00
Merge PR #1042 branch 'develop-olympus' into develop
* develop-olympus: [ticket/10897] Combine bot updates and bot delete. [ticket/10897] Use same code/query for deleting. [ticket/10897] Make sure the user we're fetching is a bot. [ticket/10897] Do not handle IP address. There is no need. [ticket/10897] Update by user_id instead of bot_name. [ticket/10897] Move bot delete data to the relevant foreach loop. [ticket/10897] Add comment about what's going on. [ticket/10897] Remove unnecessary string casting. [ticket/10897] Add space after foreach. [ticket/10897] Update bots during phpBB update [ticket/10897] Bot list updated
This commit is contained in:
commit
646d5ef3af
@ -2260,6 +2260,61 @@ function change_database_data(&$no_updates, $version)
|
|||||||
AND module_basename = \'profile\'
|
AND module_basename = \'profile\'
|
||||||
AND module_mode = \'signature\'';
|
AND module_mode = \'signature\'';
|
||||||
_sql($sql, $errored, $error_ary);
|
_sql($sql, $errored, $error_ary);
|
||||||
|
|
||||||
|
// Update bots
|
||||||
|
if (!function_exists('user_delete'))
|
||||||
|
{
|
||||||
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
}
|
||||||
|
|
||||||
|
$bots_updates = array(
|
||||||
|
// Bot Deletions
|
||||||
|
'NG-Search [Bot]' => false,
|
||||||
|
'Nutch/CVS [Bot]' => false,
|
||||||
|
'OmniExplorer [Bot]' => false,
|
||||||
|
'Seekport [Bot]' => false,
|
||||||
|
'Synoo [Bot]' => false,
|
||||||
|
'WiseNut [Bot]' => false,
|
||||||
|
|
||||||
|
// Bot Updates
|
||||||
|
// Bot name to bot user agent map
|
||||||
|
'Baidu [Spider]' => 'Baiduspider',
|
||||||
|
'Exabot [Bot]' => 'Exabot',
|
||||||
|
'Voyager [Bot]' => 'voyager/',
|
||||||
|
'W3C [Validator]' => 'W3C_Validator',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($bots_updates as $bot_name => $bot_agent)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT user_id
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_type = ' . USER_IGNORE . "
|
||||||
|
AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$bot_user_id = (int) $db->sql_fetchfield('user_id');
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($bot_user_id)
|
||||||
|
{
|
||||||
|
if ($bot_agent === false)
|
||||||
|
{
|
||||||
|
$sql = 'DELETE FROM ' . BOTS_TABLE . "
|
||||||
|
WHERE user_id = $bot_user_id";
|
||||||
|
_sql($sql, $errored, $error_ary);
|
||||||
|
|
||||||
|
user_delete('remove', $bot_user_id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = 'UPDATE ' . BOTS_TABLE . "
|
||||||
|
SET bot_agent = '" . $db->sql_escape($bot_agent) . "'
|
||||||
|
WHERE user_id = $bot_user_id";
|
||||||
|
_sql($sql, $errored, $error_ary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$no_updates = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Changes from 3.1.0-dev to 3.1.0-A1
|
// Changes from 3.1.0-dev to 3.1.0-A1
|
||||||
|
@ -2034,9 +2034,9 @@ class install_install extends module
|
|||||||
'Alexa [Bot]' => array('ia_archiver', ''),
|
'Alexa [Bot]' => array('ia_archiver', ''),
|
||||||
'Alta Vista [Bot]' => array('Scooter/', ''),
|
'Alta Vista [Bot]' => array('Scooter/', ''),
|
||||||
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
|
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
|
||||||
'Baidu [Spider]' => array('Baiduspider+(', ''),
|
'Baidu [Spider]' => array('Baiduspider', ''),
|
||||||
'Bing [Bot]' => array('bingbot/', ''),
|
'Bing [Bot]' => array('bingbot/', ''),
|
||||||
'Exabot [Bot]' => array('Exabot/', ''),
|
'Exabot [Bot]' => array('Exabot', ''),
|
||||||
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
|
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
|
||||||
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
|
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
|
||||||
'Francis [Bot]' => array('http://www.neomo.de/', ''),
|
'Francis [Bot]' => array('http://www.neomo.de/', ''),
|
||||||
@ -2055,27 +2055,21 @@ class install_install extends module
|
|||||||
'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
|
'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
|
||||||
'MSN [Bot]' => array('msnbot/', ''),
|
'MSN [Bot]' => array('msnbot/', ''),
|
||||||
'MSNbot Media' => array('msnbot-media/', ''),
|
'MSNbot Media' => array('msnbot-media/', ''),
|
||||||
'NG-Search [Bot]' => array('NG-Search/', ''),
|
|
||||||
'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
|
'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
|
||||||
'Nutch/CVS [Bot]' => array('NutchCVS/', ''),
|
|
||||||
'OmniExplorer [Bot]' => array('OmniExplorer_Bot/', ''),
|
|
||||||
'Online link [Validator]' => array('online link validator', ''),
|
'Online link [Validator]' => array('online link validator', ''),
|
||||||
'psbot [Picsearch]' => array('psbot/0', ''),
|
'psbot [Picsearch]' => array('psbot/0', ''),
|
||||||
'Seekport [Bot]' => array('Seekbot/', ''),
|
|
||||||
'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
|
'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
|
||||||
'SEO Crawler' => array('SEO search Crawler/', ''),
|
'SEO Crawler' => array('SEO search Crawler/', ''),
|
||||||
'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
|
'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
|
||||||
'SEOSearch [Crawler]' => array('SEOsearch/', ''),
|
'SEOSearch [Crawler]' => array('SEOsearch/', ''),
|
||||||
'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
|
'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
|
||||||
'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
|
'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
|
||||||
'Synoo [Bot]' => array('SynooBot/', ''),
|
|
||||||
'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
|
'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
|
||||||
'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
|
'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
|
||||||
'Voyager [Bot]' => array('voyager/1.0', ''),
|
'Voyager [Bot]' => array('voyager/', ''),
|
||||||
'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
|
'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
|
||||||
'W3C [Linkcheck]' => array('W3C-checklink/', ''),
|
'W3C [Linkcheck]' => array('W3C-checklink/', ''),
|
||||||
'W3C [Validator]' => array('W3C_*Validator', ''),
|
'W3C [Validator]' => array('W3C_Validator', ''),
|
||||||
'WiseNut [Bot]' => array('http://www.WISEnutbot.com', ''),
|
|
||||||
'YaCy [Bot]' => array('yacybot', ''),
|
'YaCy [Bot]' => array('yacybot', ''),
|
||||||
'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
|
'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
|
||||||
'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
|
'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user