mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Search Bot Userclass working again.
This commit is contained in:
@@ -257,6 +257,32 @@ class e_user_model extends e_admin_model
|
|||||||
return (($this->get('user_join') > strtotime($new_user_period." days ago")) ? true : false);
|
return (($this->get('user_join') > strtotime($new_user_period." days ago")) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function isBot()
|
||||||
|
{
|
||||||
|
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||||
|
|
||||||
|
if(empty($userAgent))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$botlist = array( "googlebot", "Bingbot", 'slurp', 'baidu', 'ichiro','nutch','yacy', "Teoma",
|
||||||
|
"alexa", "froogle", "Gigabot", "inktomi",
|
||||||
|
"looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory",
|
||||||
|
"Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot",
|
||||||
|
"crawler", "www.galaxy.com", "Scooter", "msnbot", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz",
|
||||||
|
"Baiduspider", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot",
|
||||||
|
"Mediapartners-Google", "Sogou web spider", "WebAlta Crawler","TweetmemeBot",
|
||||||
|
"Butterfly","Twitturls","Me.dium","Twiceler");
|
||||||
|
|
||||||
|
foreach($botlist as $bot)
|
||||||
|
{
|
||||||
|
if(stripos($userAgent, $bot) !== false){ return true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
final public function isMainAdmin()
|
final public function isMainAdmin()
|
||||||
{
|
{
|
||||||
return $this->checkAdminPerms('0');
|
return $this->checkAdminPerms('0');
|
||||||
@@ -318,6 +344,12 @@ class e_user_model extends e_admin_model
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_class_list[] = e_UC_GUEST;
|
$this->_class_list[] = e_UC_GUEST;
|
||||||
|
|
||||||
|
if($this->isBot())
|
||||||
|
{
|
||||||
|
$this->_class_list[] = e_UC_BOTS;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_class_list[] = e_UC_READONLY;
|
$this->_class_list[] = e_UC_READONLY;
|
||||||
|
Reference in New Issue
Block a user