Extension ext-cprping introduced (dummy), 'install' directory excluded from GNU GPL:
authorRoland Häder <roland@mxchange.org>
Thu, 15 Sep 2011 12:23:00 +0000 (12:23 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 15 Sep 2011 12:23:00 +0000 (12:23 +0000)
- New extension ext-cprping introduced (I had that idea of reactivating the code
  at http://cpr-stats.mxchange.org
- Some functions moved above note for auto-recreated functions
- Directory 'install' excluded from GNU GPL
- TODOs.txt updated

.gitattributes
DOCS/README
DOCS/TODOs.txt
inc/extensions/ext-cprping.php [new file with mode: 0644]
inc/functions.php
inc/http-functions.php
inc/wrapper-functions.php
templates/de/html/ext/ext_cprping.tpl [new file with mode: 0644]

index f3fc871ce3470760585d9063067931e55b11780b..48c1617b67d15a0e90e1938482ab89cec6b72636 100644 (file)
@@ -142,6 +142,7 @@ inc/extensions/ext-cache.php svneol=native#text/plain
 inc/extensions/ext-clickbanner.php svneol=native#text/plain
 inc/extensions/ext-country.php svneol=native#text/plain
 inc/extensions/ext-coupon.php svneol=native#text/plain
+inc/extensions/ext-cprping.php svneol=native#text/plain
 inc/extensions/ext-debug.php svneol=native#text/plain
 inc/extensions/ext-demo.php svneol=native#text/plain
 inc/extensions/ext-doubler.php svneol=native#text/plain
@@ -1566,6 +1567,7 @@ templates/de/html/ext/ext_cache.tpl svneol=native#text/plain
 templates/de/html/ext/ext_clickbanner.tpl svneol=native#text/plain
 templates/de/html/ext/ext_country.tpl svneol=native#text/plain
 templates/de/html/ext/ext_coupon.tpl svneol=native#text/plain
+templates/de/html/ext/ext_cprping.tpl svneol=native#text/plain
 templates/de/html/ext/ext_debug.tpl svneol=native#text/plain
 templates/de/html/ext/ext_demo.tpl svneol=native#text/plain
 templates/de/html/ext/ext_doubler.tpl svneol=native#text/plain
index d6ad3c55041708c1525d5d99ae83a0ca9d65a7cd..abf3234c8c99dbc0dc399de0f2881f16b5a636f3 100644 (file)
@@ -20,5 +20,5 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-This applies to all files from root directory except DOCS, img and templates
-directories.
+This applies to all files from root directory except DOCS, img, install and
+templates directories.
index 86955b69d60d2e25953afac017fed113156d841f..7afe6b0b09448c6e6ebde93a5eff13b15c13e4c7 100644 (file)
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1080:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1091:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1181:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1214:             // @TODO Add a little more infos here
-./inc/template-functions.php:1543:// @TODO Lame description for this function
-./inc/template-functions.php:1565:                     // @TODO Move this in a filter
+./inc/template-functions.php:1083:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1094:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1184:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1217:             // @TODO Add a little more infos here
+./inc/template-functions.php:1546:// @TODO Lame description for this function
+./inc/template-functions.php:1568:                     // @TODO Move this in a filter
 ./inc/template-functions.php:193:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:281:      // @TODO Remove these sanity checks if all is fine
-./inc/template-functions.php:608:// @TODO $simple/$constants are deprecated
-./inc/wrapper-functions.php:512:// @TODO Do some more sanity check here
+./inc/template-functions.php:611:// @TODO $simple/$constants are deprecated
+./inc/wrapper-functions.php:485:// @TODO Do some more sanity check here
 ./inc/xml-functions.php:189:   // @TODO Handle characters
 ./mailid.php:139:                                      // @TODO Rewrite this to a filter
 ./mailid.php:96:               // @TODO Rewrite this to a filter
diff --git a/inc/extensions/ext-cprping.php b/inc/extensions/ext-cprping.php
new file mode 100644 (file)
index 0000000..965a1ed
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 09/25/2004 *
+ * ===================                          Last change: 09/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-                                             *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Version number
+setThisExtensionVersion('0.0.0');
+
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0'));
+
+// This extension is in development (non-productive)
+enableExtensionProductive(false);
+
+switch (getExtensionMode()) {
+       case 'register': // Do stuff when installation is running
+               // SQL commands to run
+
+               // Register module
+               //addModuleSql('foo','Y','Y','N','N');
+               break;
+
+       case 'remove': // Do stuff when removing extension
+               // SQL commands to run
+               break;
+
+       case 'activate': // Do stuff when admin activates this extension
+               // SQL commands to run
+               //addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `admin_only`='N', `mem_only`='N' WHERE `module`='foo' LIMIT 1");
+               break;
+
+       case 'deactivate': // Do stuff when admin deactivates this extension
+               // SQL commands to run
+               //addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='Y' WHERE `module`='foo' LIMIT 1");
+               break;
+
+       case 'update': // Update an extension
+               switch (getCurrentExtensionVersion()) {
+                       case '0.0.1': // SQL queries for v0.0.1
+                               addExtensionSql('');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes('');
+                               break;
+               } // END - switch
+               break;
+
+       case 'modify': // When the extension got modified
+               break;
+
+       case 'test': // For testing purposes
+               break;
+
+       case 'init': // Do stuff when extension is initialized
+               break;
+
+       default: // Unknown extension mode
+               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+               break;
+} // END - switch
+
+// [EOF]
+?>
index b142253bab09273f20b646214cc9cd5db5a13edf..eb353b44819bc5e9806ceb095cf9169359917b98 100644 (file)
@@ -202,11 +202,11 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
                $mail->Subject    = $subject;
                if ((isExtensionActive('html_mail')) && (secureString($message) != $message)) {
                        $mail->Body       = $message;
-                       $mail->AltBody    = 'Your mail program required HTML support to read this mail!';
+                       $mail->AltBody    = decodeEntities($message);
                        $mail->WordWrap   = 70;
                        $mail->IsHTML(true);
                } else {
-                       $mail->Body       = decodeEntities($message);
+                       $mail->Body       = decodeEntities(strip_tags($message));
                }
 
                $mail->AddAddress($toEmail, '');
index 6877963cc377011b98077db157be3956b1f5cd6c..9398678b10d3ec170bf7e798b1508ddf25a3e39e 100644 (file)
@@ -584,6 +584,71 @@ function isBrokenHttpServerImplentation () {
        return $isBroken;
 }
 
+// Extract host from script name
+function extractHostnameFromUrl (&$script) {
+       // Use default SERVER_URL by default... ;) So?
+       $url = getServerUrl();
+
+       // Is this URL valid?
+       if (substr($script, 0, 7) == 'http://') {
+               // Use the hostname from script URL as new hostname
+               $url = substr($script, 7);
+               $extract = explode('/', $url);
+               $url = $extract[0];
+               // Done extracting the URL :)
+       } // END - if
+
+       // Extract host name
+       $host = str_replace('http://', '', $url);
+       if (isInString('/', $host)) {
+               $host = substr($host, 0, strpos($host, '/'));
+       } // END - if
+
+       // Generate relative URL
+       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
+       if (substr(strtolower($script), 0, 7) == 'http://') {
+               // But only if http:// is in front!
+               $script = substr($script, (strlen($url) + 7));
+       } elseif (substr(strtolower($script), 0, 8) == 'https://') {
+               // Does this work?!
+               $script = substr($script, (strlen($url) + 8));
+       }
+
+       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
+       if (substr($script, 0, 1) == '/') {
+               $script = substr($script, 1);
+       } // END - if
+
+       // Return host name
+       return $host;
+}
+
+// Adds a HTTP header to array
+function addHttpHeader ($header) {
+       // Send the header
+       //* DEBUG: */ logDebugMessage(__FUNCTION__ . ': header=' . $header);
+       $GLOBALS['http_header'][] = trim($header);
+}
+
+// Flushes all HTTP headers
+function flushHttpHeaders () {
+       // Is the header already sent?
+       if (headers_sent()) {
+               // Then abort here
+               debug_report_bug(__FUNCTION__, __LINE__, 'Headers already sent!');
+       } // END - if
+
+       // Flush all headers if found
+       if ((isset($GLOBALS['http_header'])) && (is_array($GLOBALS['http_header']))) {
+               foreach ($GLOBALS['http_header'] as $header) {
+                       header($header);
+               } // END - foreach
+       } // END - if
+
+       // Mark them as flushed
+       $GLOBALS['http_header'] = array();
+}
+
 //-----------------------------------------------------------------------------
 // Automatically re-created functions, all taken from user comments on www.php.net
 //-----------------------------------------------------------------------------
@@ -734,70 +799,5 @@ next[100]=<pre>'.replaceReturnNewLine(htmlentities(call_user_func_array($mbPrefi
        }
 } // END - if
 
-// Extract host from script name
-function extractHostnameFromUrl (&$script) {
-       // Use default SERVER_URL by default... ;) So?
-       $url = getServerUrl();
-
-       // Is this URL valid?
-       if (substr($script, 0, 7) == 'http://') {
-               // Use the hostname from script URL as new hostname
-               $url = substr($script, 7);
-               $extract = explode('/', $url);
-               $url = $extract[0];
-               // Done extracting the URL :)
-       } // END - if
-
-       // Extract host name
-       $host = str_replace('http://', '', $url);
-       if (isInString('/', $host)) {
-               $host = substr($host, 0, strpos($host, '/'));
-       } // END - if
-
-       // Generate relative URL
-       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
-       if (substr(strtolower($script), 0, 7) == 'http://') {
-               // But only if http:// is in front!
-               $script = substr($script, (strlen($url) + 7));
-       } elseif (substr(strtolower($script), 0, 8) == 'https://') {
-               // Does this work?!
-               $script = substr($script, (strlen($url) + 8));
-       }
-
-       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
-       if (substr($script, 0, 1) == '/') {
-               $script = substr($script, 1);
-       } // END - if
-
-       // Return host name
-       return $host;
-}
-
-// Adds a HTTP header to array
-function addHttpHeader ($header) {
-       // Send the header
-       //* DEBUG: */ logDebugMessage(__FUNCTION__ . ': header=' . $header);
-       $GLOBALS['http_header'][] = trim($header);
-}
-
-// Flushes all HTTP headers
-function flushHttpHeaders () {
-       // Is the header already sent?
-       if (headers_sent()) {
-               // Then abort here
-               debug_report_bug(__FUNCTION__, __LINE__, 'Headers already sent!');
-       } // END - if
-
-       // Flush all headers if found
-       if ((isset($GLOBALS['http_header'])) && (is_array($GLOBALS['http_header']))) {
-               foreach ($GLOBALS['http_header'] as $header) {
-                       header($header);
-               } // END - foreach
-       } // END - if
-
-       // Mark them as flushed
-       $GLOBALS['http_header'] = array();
-}
-
 // [EOF]
 ?>
index ce74b918bd4c1a10208dee248b5106f238204ede..308f7439a6b589421729f0fabed41f4b50deb8f0 100644 (file)
@@ -2642,10 +2642,17 @@ function convertCommaToDotInPostDataArray ($postEntries) {
  * @link       http://de.php.net/manual/en/function.floatval.php#92563
  */
 function parseFloat ($floatString){
-    $LocaleInfo = localeconv();
-    $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '', $floatString);
-    $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString);
-    return floatval($floatString);
+       // Load locale info
+       $LocaleInfo = localeconv();
+
+       // Remove thousand separators
+       $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '' , $floatString);
+
+       // Convert decimal point
+       $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString);
+
+       // Return float value of converted string
+       return floatval($floatString);
 }
 
 // Generates a YES/NO option list from given default
diff --git a/templates/de/html/ext/ext_cprping.tpl b/templates/de/html/ext/ext_cprping.tpl
new file mode 100644 (file)
index 0000000..c81453e
--- /dev/null
@@ -0,0 +1,32 @@
+<div class="para">
+       Diese Erweiterung schickt per &quot;Ping&quot; (HTTP-POST) an ein Script
+       von meinem <a href="http://blog.mxchange.org/" rel="external"
+        title="Mein vom Netz gegangener Blog">ehemaligen Blog</a> die anfragende
+       IP-Nummer, die Browserbezeichnung und ein verdecktes Feld in der Anmeldung,
+       das per Filter hinzugef&uuml;gt wurde, wenn das verdeckte Feld
+       ausgef&uuml;llt sein sollte.
+</div>
+
+<div class="para">
+       Das verdeckte Feld hat im Gegensatz zum CPR-Plugin (<u>C/<u>omments
+       <u>P</u>ost <u>R</u>ewriter) einen Zufallsanteil, um dem Spambot das
+       Erkennen des Feldes durch Mustererkennung zu erschweren. Da f&uuml;r das
+       sich anmeldende Mitglied das verdeckte Feld nicht sichtbar ist (dies ist
+       durch per Zufall ausgew&auml;hlte M&ouml;glichkeit realisiert und somit dem
+       Spambot dies weiter erschwert), kann mit hoher Wahrscheinlichkeit erkannt
+       werden, dass die IP-Nummer einem Spammer geh&ouml;rt.
+</div>
+
+<div class="para">
+       Sollten die spam-erkannten Zugriffe durch die IP-Nummer einen einstellbaren
+       Schwellwert &uuml;berschritten haben, wird diese IP-Nummer ganz blockiert.
+</div>
+
+<div class="para">
+       Das &quot;Ping-Script&quot; selbst liefert nur eine neutrale Antwort und
+       Zusatzkopfzeilen HTTP-konform zur&uuml;ck bzw. diverse Fehlercodes. Mehr
+       dazu und alle vom Ping-Script zur&uuml;ckgegebenen Fehlercodes entnehmen Sie
+       bitte der beigef&uuml;gten README.txt Datei unter
+       <strong>DOCS/de/cprping/README.txt</strong> (diese ist noch nicht vorhanden,
+       ich weis).
+</div>