[pLog-svn] r6262 - in plog/trunk: class/dao/userdata class/security locale locale/admin plugins/badbehavior plugins/badbehavior/bad-behavior templates/LifeType
mark at devel.lifetype.net
mark at devel.lifetype.net
Sun Mar 23 10:17:37 EDT 2008
Author: mark
Date: 2008-03-23 10:17:36 -0400 (Sun, 23 Mar 2008)
New Revision: 6262
Modified:
plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php
plog/trunk/class/security/pipeline.class.php
plog/trunk/locale/admin/locale_de_DE.php
plog/trunk/locale/locale_de_DE.php
plog/trunk/plugins/badbehavior/bad-behavior/blacklist.inc.php
plog/trunk/plugins/badbehavior/bad-behavior/msie.inc.php
plog/trunk/plugins/badbehavior/bad-behavior/version.inc.php
plog/trunk/plugins/badbehavior/bad-behavior/whitelist.inc.php
plog/trunk/plugins/badbehavior/pluginbadbehavior.class.php
plog/trunk/templates/LifeType/footer.template
plog/trunk/templates/LifeType/footermain.template
plog/trunk/templates/LifeType/index_lt.html
Log:
Merge from LifeType 1.2 branch 6182:6247
Modified: plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -176,6 +176,23 @@
//------------
/**
+ * Returns all the information associated to the user given
+ *
+ * @param user Username of the user from who we'd like to get the information
+ * @param pass Password of the user we'd like to get the information
+ * @return Returns a UserInfo object with the requested information, or false otherwise.
+ */
+ function getUserInfo( $user, $pass )
+ {
+ $userInfo = $this->getUserInfoFromUsername( $user );
+ if ( $userInfo && ($userInfo->getPassword() == md5($pass)) ) {
+ return $userInfo;
+ } else {
+ return false;
+ }
+ }
+
+ /**
* Retrieves the user information but given only a username
*
* @param username The username of the user
@@ -183,9 +200,15 @@
*/
function getUserInfoFromUsername( $username )
{
- return( $this->get( "user", $username, DaoCacheConstants::CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" )));
+ $user = $this->get( "user", $username, CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" ));
+ if( $user ) {
+ if( $user->getUsername() != $username ) {
+ $user = false;
}
+ }
+ return( $user );
+ }
/**
* Retrieves the user infromation but given only a userid
@@ -202,8 +225,8 @@
* Returns an array with all the users available in the database
*
* @param status
- * @param includeExtraInfo
* @param searchTerms
+ * @param orderBy
* @param page
* @param itemsPerPage
* @return An array containing all the users.
@@ -227,7 +250,11 @@
if( $where != "" )
$where = "WHERE $where";
- $query = "SELECT * FROM ".$this->getPrefix()."users $where ORDER BY id ASC";
+ if( $orderBy == "" )
+ $orderBy = "id ASC";
+
+ $query = "SELECT * FROM ".$this->getPrefix()."users $where ORDER BY $orderBy";
+
$result = $this->Execute( $query, $page, $itemsPerPage );
$users = Array();
@@ -309,52 +336,6 @@
}
/**
- * Returns an array with all the users that belong to the given
- * blog.
- *
- * @param blogId The blog identifier.
- * @param includeOwner Wether to include the owner of the blog or not.
- * @param status
- * @param searchTerms
- * @return An array with the information about the users who belong in
- * one way or another to that blog.
- */
- function getBlogUsers( $blogId, $includeOwner = true, $status = USER_STATUS_ALL, $searchTerms = "" )
- {
- $users = Array();
- $prefix = $this->getPrefix();
-
- // get the information about the owner, if requested so
- if( $includeOwner ) {
- $query = "SELECT {$prefix}users.* FROM {$prefix}users, {$prefix}blogs
- WHERE {$prefix}users.id = {$prefix}blogs.owner_id AND {$prefix}blogs.id = '".LtDb::qstr($blogId)."';";
- $result = $this->Execute( $query );
-
- if( !$result )
- return false;
-
- $row = $result->FetchRow();
- $result->Close();
- array_push( $users, $this->mapRow( $row ));
- }
-
- // now get the other users who have permission for that blog.
- $query2 = "SELECT {$prefix}users.* FROM {$prefix}users, {$prefix}users_permissions
- WHERE {$prefix}users.id = {$prefix}users_permissions.user_id
- AND {$prefix}users_permissions.blog_id = '".LtDb::qstr($blogId)."';";
- $result2 = $this->Execute( $query2 );
- if( !$result2 ) // if error, return what we have so far...
- return $users;
-
- while( $row = $result2->FetchRow()) {
- array_push( $users, $this->mapRow($row));
- }
- $result2->Close();
-
- return $users;
- }
-
- /**
* Removes users from the database
*
* @param userId The identifier of the user we are trying to remove
@@ -362,14 +343,17 @@
function deleteUser( $userId )
{
// first, delete all of his/her permissions
- if( $this->delete( $userId )) {
+ $user = $this->getUserInfoFromId( $userId );
+ if( $this->delete( "id", $userId )) {
$perms = new UserPermissions();
$perms->revokeUserPermissions( $userId );
$this->_cache->removeData( $userId, DaoCacheConstants::CACHE_USERINFO );
+ $this->_cache->removeData( $user->getUsername(), CACHE_USERIDBYNAME );
+ return true;
}
- else
- return( false );
+
+ return false;
}
/**
@@ -381,10 +365,10 @@
{
$table = $this->getPrefix()."users";
+ $where = "";
if( $status != USER_STATUS_ALL )
$where = "status = '".LtDb::qstr($status)."'";
- $where = "";
if( $searchTerms != "" ) {
if( $where != "" )
$where .= " AND ";
@@ -411,7 +395,6 @@
$count = $result->RecordCount();
$result->Close();
-
return ($count >= 1);
}
Modified: plog/trunk/class/security/pipeline.class.php
===================================================================
--- plog/trunk/class/security/pipeline.class.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/class/security/pipeline.class.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -69,7 +69,6 @@
{
$this->_httpRequest = $httpRequest;
$this->_blogInfo = $blogInfo;
- $this->_registerPostDefaultFilters();
}
/**
@@ -116,7 +115,7 @@
global $_pLogPipelineRegisteredFilters;
- static $defaultsRegistered = false;
+ static $defaultFiltersRegistered = false;
// check if the pipeline is enabled
$config =& Config::getConfig();
Modified: plog/trunk/locale/admin/locale_de_DE.php
===================================================================
--- plog/trunk/locale/admin/locale_de_DE.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/locale/admin/locale_de_DE.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -388,8 +388,8 @@
$messages['enable_comments_help'] = 'Erlaubt oder verbietet das Kommentieren für alle Artikel dieses Blogs.';
$messages['show_future_posts'] = 'Zukünftige Artikel im Kalender anzeigen.';
$messages['show_future_posts_help'] = 'Wählen Sie, ob Artikel mit in der Zukunft liegendem Veröffentlichungsdatum im Kalender angezeigt und so für jeden Besucher sichtbar sein sollen.';
-$messages['articles_order'] = 'Articles order';
-$messages['articles_order_help'] = 'Order in which articles should be displayed.';
+$messages['articles_order'] = 'Artikel Reihenfolge';
+$messages['articles_order_help'] = 'Reihenfolge in der die Artikel angezeigt werden sollen.';
$messages['comments_order'] = 'Reihenfolge der Kommentare';
$messages['comments_order_help'] = 'Reihenfolge, in der die Kommentare auf der Übersichtsseite angezeigt werden.';
$messages['oldest_first'] = 'älteste zuerst';
Modified: plog/trunk/locale/locale_de_DE.php
===================================================================
--- plog/trunk/locale/locale_de_DE.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/locale/locale_de_DE.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -126,6 +126,8 @@
$messages['admin'] = 'Admin';
$messages['links'] = 'Links';
$messages['categories'] = 'Kategorien';
+$messages['articles'] = 'Artikel';
+
$messages['num_reads'] = 'gesehen';
$messages['contact_me'] = 'Kontaktieren Sie mich';
$messages['required'] = 'Notwendig';
Modified: plog/trunk/plugins/badbehavior/bad-behavior/blacklist.inc.php
===================================================================
--- plog/trunk/plugins/badbehavior/bad-behavior/blacklist.inc.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/plugins/badbehavior/bad-behavior/blacklist.inc.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -1,113 +1,113 @@
-<?php if (!defined('BB2_CORE')) die('I said no cheating!');
-
-function bb2_blacklist($package) {
-
- // Blacklisted user agents
- // These user agent strings occur at the beginning of the line.
- $bb2_spambots_0 = array(
- "<sc", // XSS exploit attempts
- "8484 Boston Project", // video poker/porn spam
- "adwords", // referrer spam
- "autoemailspider", // spam harvester
- "blogsearchbot-martin", // from honeypot
- "Digger", // spam harvester
- "ecollector", // spam harvester
- "EmailCollector", // spam harvester
- "Email Extractor", // spam harvester
- "Email Siphon", // spam harvester
- "EmailSiphon", // spam harvester
- "grub crawler", // misc comment/email spam
- "HttpProxy", // misc comment/email spam
- "Internet Explorer", // XMLRPC exploits seen
- "Jakarta Commons", // custommised spambots
- "Java 1.", // definitely a spammer
- "Java/1.", // definitely a spammer
- "libwww-perl", // spambot scripts
- "LWP", // spambot scripts
- "Microsoft URL", // spam harvester
- "Missigua", // spam harvester
- "MJ12bot", // crawls MUCH too fast
- "Movable Type", // customised spambots
- "Mozilla ", // malicious software
- "Mozilla/4.0(", // from honeypot
- "Mozilla/4.0+(", // suspicious harvester
- "MSIE", // malicious software
- "NutchCVS", // unidentified robots
- "Nutscrape/", // misc comment spam
- "OmniExplorer", // spam harvester
- "psycheclone", // spam harvester
- "PussyCat ", // misc comment spam
- "PycURL", // misc comment spam
- "Shockwave Flash", // spam harvester
- "TrackBack/", // trackback spam
- "user", // suspicious harvester
- "User Agent: ", // spam harvester
- "User-Agent: ", // spam harvester
- "Wordpress", // malicious software
- "\"", // malicious software
- );
-
- // These user agent strings occur anywhere within the line.
- $bb2_spambots = array(
- "\r", // A really dumb bot
- "; Widows ", // misc comment/email spam
- "a href=", // referrer spam
- "Bad Behavior Test", // Add this to your user-agent to test BB
- "compatible ; MSIE", // misc comment/email spam
- "compatible-", // misc comment/email spam
- "DTS Agent", // misc comment/email spam
- "Gecko/25", // revisit this in 500 years
- "grub-client", // search engine ignores robots.txt
- "hanzoweb", // very badly behaved crawler
- "Indy Library", // misc comment/email spam
- "larbin at unspecified", // stealth harvesters
- "Murzillo compatible", // comment spam bot
- ".NET CLR 1)", // free poker, etc.
- "POE-Component-Client", // free poker, etc.
- "Turing Machine", // www.anonymizer.com abuse
- "WebaltBot", // spam harvester
- "WISEbot", // spam harvester
- "WISEnutbot", // spam harvester
- "Windows NT 4.0;)", // wikispam bot
- "Windows NT 5.0;)", // wikispam bot
- "Windows NT 5.1;)", // wikispam bot
- "Windows XP 5", // spam harvester
- "\\\\)", // spam harvester
- );
-
- // These are regular expression matches.
- $bb2_spambots_regex = array(
- "/^[A-Z]{10}$/", // misc email spam
- "/^Mozilla...[05]$/i", // fake user agent/email spam
- "/[bcdfghjklmnpqrstvwxz ]{8,}/",
-// "/(;\){1,2}$/", // misc spammers/harvesters
-// "/MSIE.*Windows XP/", // misc comment spam
- );
-
- // Do not edit below this line.
-
- $ua = $package['headers_mixed']['User-Agent'];
-
- foreach ($bb2_spambots_0 as $spambot) {
- $pos = stripos($ua, $spambot);
- if ($pos !== FALSE && $pos == 0) {
- return "17f4e8c8";
- }
- }
-
- foreach ($bb2_spambots as $spambot) {
- if (stripos($ua, $spambot) !== FALSE) {
- return "17f4e8c8";
- }
- }
-
- foreach ($bb2_spambots_regex as $spambot) {
- if (preg_match($spambot, $ua)) {
- return "17f4e8c8";
- }
- }
-
- return FALSE;
-}
-
-?>
+<?php if (!defined('BB2_CORE')) die('I said no cheating!');
+
+function bb2_blacklist($package) {
+
+ // Blacklisted user agents
+ // These user agent strings occur at the beginning of the line.
+ $bb2_spambots_0 = array(
+ "<sc", // XSS exploit attempts
+ "8484 Boston Project", // video poker/porn spam
+ "adwords", // referrer spam
+ "autoemailspider", // spam harvester
+ "blogsearchbot-martin", // from honeypot
+ "Digger", // spam harvester
+ "ecollector", // spam harvester
+ "EmailCollector", // spam harvester
+ "Email Extractor", // spam harvester
+ "Email Siphon", // spam harvester
+ "EmailSiphon", // spam harvester
+ "grub crawler", // misc comment/email spam
+ "HttpProxy", // misc comment/email spam
+ "Internet Explorer", // XMLRPC exploits seen
+ "Jakarta Commons", // custommised spambots
+ "Java 1.", // definitely a spammer
+ "Java/1.", // definitely a spammer
+ "libwww-perl", // spambot scripts
+ "LWP", // spambot scripts
+ "Microsoft URL", // spam harvester
+ "Missigua", // spam harvester
+ "MJ12bot", // crawls MUCH too fast
+ "Movable Type", // customised spambots
+ "Mozilla ", // malicious software
+ "Mozilla/4.0(", // from honeypot
+ "Mozilla/4.0+(", // suspicious harvester
+ "MSIE", // malicious software
+ "NutchCVS", // unidentified robots
+ "Nutscrape/", // misc comment spam
+ "OmniExplorer", // spam harvester
+ "psycheclone", // spam harvester
+ "PussyCat ", // misc comment spam
+ "PycURL", // misc comment spam
+ "Shockwave Flash", // spam harvester
+ "TrackBack/", // trackback spam
+ "user", // suspicious harvester
+ "User Agent: ", // spam harvester
+ "User-Agent: ", // spam harvester
+ "Wordpress", // malicious software
+ "\"", // malicious software
+ );
+
+ // These user agent strings occur anywhere within the line.
+ $bb2_spambots = array(
+ "\r", // A really dumb bot
+ "; Widows ", // misc comment/email spam
+ "a href=", // referrer spam
+ "Bad Behavior Test", // Add this to your user-agent to test BB
+ "compatible ; MSIE", // misc comment/email spam
+ "compatible-", // misc comment/email spam
+ "DTS Agent", // misc comment/email spam
+ "Gecko/25", // revisit this in 500 years
+ "grub-client", // search engine ignores robots.txt
+ "hanzoweb", // very badly behaved crawler
+ "Indy Library", // misc comment/email spam
+ "larbin at unspecified", // stealth harvesters
+ "Murzillo compatible", // comment spam bot
+ ".NET CLR 1)", // free poker, etc.
+ "POE-Component-Client", // free poker, etc.
+ "Turing Machine", // www.anonymizer.com abuse
+ "WebaltBot", // spam harvester
+ "WISEbot", // spam harvester
+ "WISEnutbot", // spam harvester
+ "Windows NT 4.0;)", // wikispam bot
+ "Windows NT 5.0;)", // wikispam bot
+ "Windows NT 5.1;)", // wikispam bot
+ "Windows XP 5", // spam harvester
+ "\\\\)", // spam harvester
+ );
+
+ // These are regular expression matches.
+ $bb2_spambots_regex = array(
+ "/^[A-Z]{10}$/", // misc email spam
+ "/^Mozilla...[05]$/i", // fake user agent/email spam
+ "/[bcdfghjklmnpqrstvwxz ]{8,}/",
+// "/(;\){1,2}$/", // misc spammers/harvesters
+// "/MSIE.*Windows XP/", // misc comment spam
+ );
+
+ // Do not edit below this line.
+
+ $ua = $package['headers_mixed']['User-Agent'];
+
+ foreach ($bb2_spambots_0 as $spambot) {
+ $pos = strpos($ua, $spambot);
+ if ($pos !== FALSE && $pos == 0) {
+ return "17f4e8c8";
+ }
+ }
+
+ foreach ($bb2_spambots as $spambot) {
+ if (strpos($ua, $spambot) !== FALSE) {
+ return "17f4e8c8";
+ }
+ }
+
+ foreach ($bb2_spambots_regex as $spambot) {
+ if (preg_match($spambot, $ua)) {
+ return "17f4e8c8";
+ }
+ }
+
+ return FALSE;
+}
+
+?>
Modified: plog/trunk/plugins/badbehavior/bad-behavior/msie.inc.php
===================================================================
--- plog/trunk/plugins/badbehavior/bad-behavior/msie.inc.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/plugins/badbehavior/bad-behavior/msie.inc.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -1,24 +1,25 @@
-<?php if (!defined('BB2_CORE')) die('I said no cheating!');
-
-// Analyze user agents claiming to be MSIE
-
-function bb2_msie($package)
-{
- if (!array_key_exists('Accept', $package['headers_mixed'])) {
- return "17566707";
- }
-
- // MSIE does NOT send "Windows ME" or "Windows XP" in the user agent
- if (strpos($package['headers_mixed']['User-Agent'], "Windows ME") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows XP") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows 2000") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Win32") !== FALSE) {
- return "a1084bad";
- }
-
- // MSIE does NOT send Connection: TE
- if (preg_match('/\bTE\b/i', $package['headers_mixed']['Connection'])) {
- return "2b90f772";
- }
-
- return false;
-}
-
-?>
+<?php if (!defined('BB2_CORE')) die('I said no cheating!');
+
+// Analyze user agents claiming to be MSIE
+
+function bb2_msie($package)
+{
+ if (!array_key_exists('Accept', $package['headers_mixed'])) {
+ return "17566707";
+ }
+
+ // MSIE does NOT send "Windows ME" or "Windows XP" in the user agent
+ if (strpos($package['headers_mixed']['User-Agent'], "Windows ME") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows XP") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows 2000") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Win32") !== FALSE) {
+ return "a1084bad";
+ }
+
+ // MSIE does NOT send Connection: TE but Akamai does
+ // Bypass this test when Akamai detected
+ if (!array_key_exists('Akamai-Origin-Hop', $package['headers_mixed']) && preg_match('/\bTE\b/i', $package['headers_mixed']['Connection'])) {
+ return "2b90f772";
+ }
+
+ return false;
+}
+
+?>
Modified: plog/trunk/plugins/badbehavior/bad-behavior/version.inc.php
===================================================================
--- plog/trunk/plugins/badbehavior/bad-behavior/version.inc.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/plugins/badbehavior/bad-behavior/version.inc.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -1,3 +1,3 @@
-<?php if (!defined('BB2_CWD')) die("I said no cheating!");
-define('BB2_VERSION', "2.0.11");
-?>
+<?php if (!defined('BB2_CWD')) die("I said no cheating!");
+define('BB2_VERSION', "2.0.13");
+?>
Modified: plog/trunk/plugins/badbehavior/bad-behavior/whitelist.inc.php
===================================================================
--- plog/trunk/plugins/badbehavior/bad-behavior/whitelist.inc.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/plugins/badbehavior/bad-behavior/whitelist.inc.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -1,56 +1,58 @@
-<?php if (!defined('BB2_CORE')) die('I said no cheating!');
-
-function bb2_whitelist($package)
-{
- // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
-
- // Inappropriate whitelisting WILL expose you to spam, or cause Bad
- // Behavior to stop functioning entirely! DO NOT WHITELIST unless you
- // are 100% CERTAIN that you should.
-
- // IP address ranges use the CIDR format.
-
- // Includes four examples of whitelisting by IP address and netblock.
- $bb2_whitelist_ip_ranges = array(
- "10.0.0.0/8",
- "172.16.0.0/12",
- "192.168.0.0/16",
-// "127.0.0.1",
- );
-
- // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
-
- // Inappropriate whitelisting WILL expose you to spam, or cause Bad
- // Behavior to stop functioning entirely! DO NOT WHITELIST unless you
- // are 100% CERTAIN that you should.
-
- // You should not whitelist search engines by user agent. Use the IP
- // netblock for the search engine instead. See http://whois.arin.net/
- // to locate the netblocks for an IP.
-
- // User agents are matched by exact match only.
-
- // Includes one example of whitelisting by user agent.
- // All are commented out.
- $bb2_whitelist_user_agents = array(
- // "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) It's me, let me in",
- );
-
- // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
-
- // Do not edit below this line
-
- if (!empty($bb2_whitelist_ip_ranges)) {
- foreach ($bb2_whitelist_ip_ranges as $range) {
- if (match_cidr($package['ip'], $range)) return true;
- }
- }
- if (!empty($bb2_whitelist_user_agents)) {
- foreach ($bb2_whitelist_user_agents as $user_agent) {
- if (!strcmp($package['headers_mixed']['User-Agent'], $user_agent)) return true;
- }
- }
- return false;
-}
-
-?>
+<?php if (!defined('BB2_CORE')) die('I said no cheating!');
+
+function bb2_whitelist($package)
+{
+ // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
+
+ // Inappropriate whitelisting WILL expose you to spam, or cause Bad
+ // Behavior to stop functioning entirely! DO NOT WHITELIST unless you
+ // are 100% CERTAIN that you should.
+
+ // IP address ranges use the CIDR format.
+
+ // Includes four examples of whitelisting by IP address and netblock.
+ $bb2_whitelist_ip_ranges = array(
+ "64.191.203.34/32", // Digg whitelisted as of 2.0.12
+ "208.67.217.130/32", // Digg whitelisted as of 2.0.12
+ "10.0.0.0/8",
+ "172.16.0.0/12",
+ "192.168.0.0/16",
+// "127.0.0.1",
+ );
+
+ // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
+
+ // Inappropriate whitelisting WILL expose you to spam, or cause Bad
+ // Behavior to stop functioning entirely! DO NOT WHITELIST unless you
+ // are 100% CERTAIN that you should.
+
+ // You should not whitelist search engines by user agent. Use the IP
+ // netblock for the search engine instead. See http://whois.arin.net/
+ // to locate the netblocks for an IP.
+
+ // User agents are matched by exact match only.
+
+ // Includes one example of whitelisting by user agent.
+ // All are commented out.
+ $bb2_whitelist_user_agents = array(
+ // "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) It's me, let me in",
+ );
+
+ // DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!
+
+ // Do not edit below this line
+
+ if (!empty($bb2_whitelist_ip_ranges)) {
+ foreach ($bb2_whitelist_ip_ranges as $range) {
+ if (match_cidr($package['ip'], $range)) return true;
+ }
+ }
+ if (!empty($bb2_whitelist_user_agents)) {
+ foreach ($bb2_whitelist_user_agents as $user_agent) {
+ if (!strcmp($package['headers_mixed']['User-Agent'], $user_agent)) return true;
+ }
+ }
+ return false;
+}
+
+?>
Modified: plog/trunk/plugins/badbehavior/pluginbadbehavior.class.php
===================================================================
--- plog/trunk/plugins/badbehavior/pluginbadbehavior.class.php 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/plugins/badbehavior/pluginbadbehavior.class.php 2008-03-23 14:17:36 UTC (rev 6262)
@@ -20,7 +20,7 @@
$this->desc = "Bad Behavior for LifeType";
$this->author = "The Lifetype Project";
$this->db =& Db::getDb();
- $this->version = "20071205";
+ $this->version = "20080228";
$config =& Config::getConfig();
$prefix = Db::getPrefix();
Modified: plog/trunk/templates/LifeType/footer.template
===================================================================
--- plog/trunk/templates/LifeType/footer.template 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/templates/LifeType/footer.template 2008-03-23 14:17:36 UTC (rev 6262)
@@ -15,7 +15,7 @@
<td> </td>
</tr>
<tr>
-<td style="width:238px;text-align:left">© 2005 <a href="http://www.lifetype.net" class="black">LifeType</a>. All rights reserved.
+<td style="width:238px;text-align:left">© 2008 <a href="http://www.lifetype.net" class="black">LifeType</a>. All rights reserved.
</td>
<td style="width:272;text-align:center">
<a href="http://www.lifetype.net/" class="black">International</a> |
Modified: plog/trunk/templates/LifeType/footermain.template
===================================================================
--- plog/trunk/templates/LifeType/footermain.template 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/templates/LifeType/footermain.template 2008-03-23 14:17:36 UTC (rev 6262)
@@ -17,7 +17,7 @@
<tr>
-<td width="238" align="left">© 2005 <a href="http://www.lifetype.net">LifeType</a>.
+<td width="238" align="left">© 2008 <a href="http://www.lifetype.net">LifeType</a>.
All rights reserved.
</td>
<td width="272" align="center">
Modified: plog/trunk/templates/LifeType/index_lt.html
===================================================================
--- plog/trunk/templates/LifeType/index_lt.html 2008-03-21 20:05:43 UTC (rev 6261)
+++ plog/trunk/templates/LifeType/index_lt.html 2008-03-23 14:17:36 UTC (rev 6262)
@@ -153,7 +153,7 @@
<td width="100%"></td>
</tr>
<tr>
- <td width="238" height="50" align="left">© 2005 <a href="http://www.lifetype.de" class="black">LifeType</a>.
+ <td width="238" height="50" align="left">© 2008 <a href="http://www.lifetype.de" class="black">LifeType</a>.
All rights reserved.
</td>
<td width="272" align="center">
@@ -181,4 +181,4 @@
<area shape="rect" coords="245,251,470,311" href="http://www.lifetype.de/blog/index.php?blogId=34" alt="State-of-the-art Blogging Solutions">
</map>
</body>
-</html>
\ No newline at end of file
+</html>
More information about the pLog-svn
mailing list