]> git.mxchange.org Git - mailer.git/commitdiff
Fixes saving of settings, inconsistency fixed in config entries
authorRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 18:48:36 +0000 (18:48 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 18:48:36 +0000 (18:48 +0000)
inc/extensions/ext-order.php
inc/language/order_de.php
inc/language/other_de.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_order.php
inc/modules/member/what-order.php
install/tables.sql
templates/de/html/admin/admin_config_order.tpl
templates/de/html/admin/admin_config_order_form.tpl

index 99e87fd25c349310db6af5d229a99353784f128b..8e6b2b83216249826a2297e0c3ce7c98a9e821ad 100644 (file)
@@ -42,10 +42,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.1');
+setThisExtensionVersion('0.5.2');
 
 // Version history array (add more with , '0.1.0' and so on)
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1'));
+setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
@@ -319,6 +319,16 @@ INDEX (`pool_id`)
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Weiteren Men&uuml;-Query in Erweiterung verlagert.");
                                break;
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Weiteren Men&uuml;-Query in Erweiterung verlagert.");
                                break;
+
+                       case '0.5.2': // SQL queries for v0.5.2
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `test_text`");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `test_subj`");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `allow_url_in_text` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `allow_url_in_subject` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert.");
+                               break;
                }
                break;
 
                }
                break;
 
index d353725732c42d1cabac5c352c7951ea9806cb83..6de812949573eaa84fa2e1ab10eced6c18a55bbf 100644 (file)
@@ -49,13 +49,18 @@ addMessages(array(
        'ADMIN_ORDER_MIN_RECEIVER_PER_ORDER' => "Minimale Anzahl Empf&auml;nger pro Mailbuchung",
        'ADMIN_ORDER_MAX' => "So viele wie m&ouml;glich.",
        'ADMIN_ORDER_ORDER' => "So viele wie auf Empfang eingestellt.",
        'ADMIN_ORDER_MIN_RECEIVER_PER_ORDER' => "Minimale Anzahl Empf&auml;nger pro Mailbuchung",
        'ADMIN_ORDER_MAX' => "So viele wie m&ouml;glich.",
        'ADMIN_ORDER_ORDER' => "So viele wie auf Empfang eingestellt.",
-       'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie k&ouml;nnen heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
-       'MEMBER_ORDER_ALLOWED_MAX' => "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.",
-       'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt! cfg=<span class=\"data\">{?order_max_full?}</span> Bitte den Administrator benachrichtigen.",
        'ADMIN_ORDER_SELECTION_COLUMN' => "Tabellenspalte, nach der umsortiert werden soll",
        'ADMIN_ORDER_SELECTION_MODE' => "Sortierreihenfolge",
        'ADMIN_ORDER_SELECTION_SETTINGS' => "Auswahlverfahren der Empf&auml;nger",
        'ADMIN_ORDER_SELECTION_COLUMN' => "Tabellenspalte, nach der umsortiert werden soll",
        'ADMIN_ORDER_SELECTION_MODE' => "Sortierreihenfolge",
        'ADMIN_ORDER_SELECTION_SETTINGS' => "Auswahlverfahren der Empf&auml;nger",
+       'ADMIN_OPTION_MAX_TEXT_LENGTH' => "Maximale L&auml;nge des Werbetextes",
+       'ADMIN_OPTION_MAX_UNCONFIRMED_MAILS' => "Maximale Anzahl unbest. Mails (Mailbuchung)",
+       'ADMIN_OPTION_CHECK_EMAIL_TEXT' => "Sind URLs im Werbetext erlaubt?",
+       'ADMIN_OPTION_CHECK_EMAIL_SUBJ' => "Sind URLs in der Betreffzeile erlaubt?",
+       'ADMIN_OPTION_URL_BLACKLIST' => "Black-Liste f&uuml;r gebuchte URLs aktivieren?",
 
 
+       'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie k&ouml;nnen heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
+       'MEMBER_ORDER_ALLOWED_MAX' => "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.",
+       'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt! cfg=<span class=\"data\">{?order_max_full?}</span> Bitte den Administrator benachrichtigen.",
        'MEMBER_ORDER_MAX_ALLOWED' => "Maximale Mailbuchungen",
        'MEMBER_ORDER_ALLOWED_EXHAUSTED' => "Sie k&ouml;nnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang h&ouml;her ein.",
        'MEMBER_ENTER_INVALID_URL' => "Ung&uuml;tige URL eingegeben.",
        'MEMBER_ORDER_MAX_ALLOWED' => "Maximale Mailbuchungen",
        'MEMBER_ORDER_ALLOWED_EXHAUSTED' => "Sie k&ouml;nnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang h&ouml;her ein.",
        'MEMBER_ENTER_INVALID_URL' => "Ung&uuml;tige URL eingegeben.",
index 779ae5c98c8105e5877d02ea0c8e2dda5e430c0a..744f9823ab4f3ef3007470dd9341dfe3fb6954ed 100644 (file)
@@ -46,12 +46,7 @@ addMessages(array(
        'ADMIN_OTHER_SETTINGS' => "Sonstige Einstellungen",
        'ADMIN_OPTION_URL_TIME_LOCK' => "Selbe beworbene URL nicht mehr bewerbar (0 = URL sofort erneut buchbar)",
        'ADMIN_OPTION_POOL_MAX_SEND' => "Anzahl zu sendender Mails aus dem Pool",
        'ADMIN_OTHER_SETTINGS' => "Sonstige Einstellungen",
        'ADMIN_OPTION_URL_TIME_LOCK' => "Selbe beworbene URL nicht mehr bewerbar (0 = URL sofort erneut buchbar)",
        'ADMIN_OPTION_POOL_MAX_SEND' => "Anzahl zu sendender Mails aus dem Pool",
-       'ADMIN_OPTION_MAX_UNCONFIRMED_MAILS' => "Maximale Anzahl unbest. Mails (Mailbuchung)",
        'ADMIN_OPTION_LOCK_PROFILE_TIME' => "Sperrzeit des Mitgliedprofiles nach &Auml;nderung (0 = Keine Sperrzeit)",
        'ADMIN_OPTION_LOCK_PROFILE_TIME' => "Sperrzeit des Mitgliedprofiles nach &Auml;nderung (0 = Keine Sperrzeit)",
-       'ADMIN_OPTION_MAX_TEXT_LENGTH' => "Maximale L&auml;nge des Werbetextes",
-       'ADMIN_OPTION_CHECK_EMAIL_TEXT' => "Sind URLs im Werbetext erlaubt?",
-       'ADMIN_OPTION_CHECK_EMAIL_SUBJ' => "Sind URLs in der Betreffzeile erlaubt?",
-       'ADMIN_OPTION_URL_BLACKLIST' => "Black-Liste f&uuml;r gebuchte URLs aktivieren?",
        'ADMIN_OPTION_AUTOSEND_ACTIVE' => "Ist der Auto-Versand aktiv?",
        'ADMIN_OPTION_NOTIFY_ADMIN' => "Benachrichtigung bei Profil&auml;nderung?",
        'ADMIN_OPTION_MAX_ONLINETIME' => "Timeout f&uuml;r Who-is-Online",
        'ADMIN_OPTION_AUTOSEND_ACTIVE' => "Ist der Auto-Versand aktiv?",
        'ADMIN_OPTION_NOTIFY_ADMIN' => "Benachrichtigung bei Profil&auml;nderung?",
        'ADMIN_OPTION_MAX_ONLINETIME' => "Timeout f&uuml;r Who-is-Online",
index ac2747eb35c7a9d47637160bae69601b9677b32d..0f8382245ef2321f0168b94c15c92d956985d20a 100644 (file)
@@ -573,7 +573,7 @@ function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement
 // Save settings to the database
 function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
        // Prepare all arrays, variables
 // Save settings to the database
 function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
        // Prepare all arrays, variables
-       $DATA = array();
+       $tableData = array();
        $skip = false;
 
        // Now, walk through all entries and prepare them for saving
        $skip = false;
 
        // Now, walk through all entries and prepare them for saving
@@ -581,7 +581,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                // Process only formular field but not submit buttons ;)
                if ($id != 'ok') {
                        // Do not save the ok value
                // Process only formular field but not submit buttons ;)
                if ($id != 'ok') {
                        // Do not save the ok value
-                       convertSelectionsToTimestamp($postData, $DATA, $id, $skip);
+                       convertSelectionsToTimestamp($postData, $tableData, $id, $skip);
 
                        // Shall we process this id? It muss not be empty, of course
                        if (($skip === false) && (!empty($id)) && (!isset($GLOBALS['skip_config'][$id]))) {
 
                        // Shall we process this id? It muss not be empty, of course
                        if (($skip === false) && (!empty($id)) && (!isset($GLOBALS['skip_config'][$id]))) {
@@ -595,10 +595,10 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                                $test = (float)$val;
                                if ('' . $val . '' == '' . $test . '') {
                                        // Add numbers
                                $test = (float)$val;
                                if ('' . $val . '' == '' . $test . '') {
                                        // Add numbers
-                                       $DATA[] = sprintf("`%s`=%s", $id, $test);
+                                       $tableData[] = sprintf("`%s`=%s", $id, $test);
                                } else {
                                        // Add strings
                                } else {
                                        // Add strings
-                                       $DATA[] = sprintf("`%s`='%s'", $id, trim($val));
+                                       $tableData[] = sprintf("`%s`='%s'", $id, trim($val));
                                }
 
                                // Do not add a config entry twice
                                }
 
                                // Do not add a config entry twice
@@ -622,31 +622,32 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
 
        if (SQL_NUMROWS($result) == 1) {
                // "Implode" all data to single string
 
        if (SQL_NUMROWS($result) == 1) {
                // "Implode" all data to single string
-               $DATA_UPDATE = implode(', ', $DATA);
+               $updatedData = implode(', ', $tableData);
 
                // Generate SQL string
                $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1",
                        $tableName,
 
                // Generate SQL string
                $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1",
                        $tableName,
-                       $DATA_UPDATE,
+                       $updatedData,
                        $whereStatement
                );
        } else {
                // Add Line (does only work with auto_increment!
                        $whereStatement
                );
        } else {
                // Add Line (does only work with auto_increment!
-               $KEYs = array(); $values = array();
-               foreach ($DATA as $entry) {
+               $keys = array(); $values = array();
+               foreach ($tableData as $entry) {
                        // Split up
                        $line = explode('=', $entry);
                        // Split up
                        $line = explode('=', $entry);
-                       $KEYs[] = $line[0]; $values[] = $line[1];
+                       $keys[] = $line[0];
+                       $values[] = $line[1];
                } // END - foreach
 
                // Add both in one line
                } // END - foreach
 
                // Add both in one line
-               $KEYs = implode('`, `', $KEYs);
+               $keys = implode('`, `', $keys);
                $values = implode(', ', $values);
 
                // Generate SQL string
                $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)",
                        $tableName,
                $values = implode(', ', $values);
 
                // Generate SQL string
                $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)",
                        $tableName,
-                       $KEYs,
+                       $keys,
                        $values
                );
        }
                        $values
                );
        }
index ca821658bc2b3e24df1c38697fcb9a6ebfa423da..2b349bb58ea82a7c234f0679b609c9d84789ab93 100644 (file)
@@ -49,12 +49,12 @@ if (isFormSent()) {
        adminSaveSettingsFromPostData();
 } else {
        // Init all selection entries
        adminSaveSettingsFromPostData();
 } else {
        // Init all selection entries
-       foreach (array('order_max_full_order', 'order_max_full_max', 'order_mode_asc', 'order_mode_desc', 'test_text_y', 'test_text_n', 'test_subj_y', 'test_subj_n', 'url_blacklist_y', 'url_blacklist_n', 'repay_deleted_mails_repay', 'repay_deleted_mails_jackpot', 'repay_deleted_mails_shred') as $entry) {
+       foreach (array('order_max_full_order', 'order_max_full_max', 'order_mode_asc', 'order_mode_desc', 'allow_url_in_text_y', 'allow_url_in_text_n', 'allow_url_in_subject_y', 'allow_url_in_subject_n', 'url_blacklist_y', 'url_blacklist_n', 'repay_deleted_mails_repay', 'repay_deleted_mails_jackpot', 'repay_deleted_mails_shred') as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
        // Set all default checks
                $content[$entry] = '';
        } // END - foreach
 
        // Set all default checks
-       foreach (array('order_max_full', 'order_mode', 'test_text', 'test_subj', 'url_blacklist') as $entry) {
+       foreach (array('order_max_full', 'order_mode', 'allow_url_in_text', 'allow_url_in_subject', 'url_blacklist') as $entry) {
                $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
        } // END - foreach
 
                $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
        } // END - foreach
 
index 31b3327451e880c587e932ce29e6174772e2e583..e4cd4069471ff876dfd18625091b44a96c4b98b4 100644 (file)
@@ -127,9 +127,9 @@ LIMIT 1",
                // No entry found, so we need to check out the stats table as well... :)
                // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
                $URL = '';
                // No entry found, so we need to check out the stats table as well... :)
                // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
                $URL = '';
-               if (getConfig('test_text') == 'Y') {
+               if (getConfig('allow_url_in_text') == 'Y') {
                        // Test submitted text against some filters (length, URLs in text etc.)
                        // Test submitted text against some filters (length, URLs in text etc.)
-                       if ((strpos(strtolower(postRequestElement('text')), "https://") > -1) || (strpos(strtolower(postRequestElement('text')), 'http://') > -1) || (strpos(strtolower(postRequestElement('text')), "www") > -1)) {
+                       if ((strpos(strtolower(postRequestElement('text')), 'https://') > -1) || (strpos(strtolower(postRequestElement('text')), 'http://') > -1) || (strpos(strtolower(postRequestElement('text')), "www") > -1)) {
                                // URL found!
                                $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('URL_FOUND');
                        } // END - if
                                // URL found!
                                $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('URL_FOUND');
                        } // END - if
@@ -145,7 +145,7 @@ LIMIT 1",
                } // END - if
 
                // Shall I test the subject line against URLs?
                } // END - if
 
                // Shall I test the subject line against URLs?
-               if (getConfig('test_subj') == 'Y') {
+               if (getConfig('allow_url_in_subject') == 'Y') {
                        // Check the subject line for issues
                        setRequestPostElement('subject', str_replace("\\", '[nl]', substr(postRequestElement('subject'), 0, 200)));
                        if ((strpos(strtolower(postRequestElement('subject')), 'http://') > -1) || (strpos(strtolower(postRequestElement('subject')), "www") > -1)) {
                        // Check the subject line for issues
                        setRequestPostElement('subject', str_replace("\\", '[nl]', substr(postRequestElement('subject'), 0, 200)));
                        if ((strpos(strtolower(postRequestElement('subject')), 'http://') > -1) || (strpos(strtolower(postRequestElement('subject')), "www") > -1)) {
index 3e62332519bfa26962becac845b8cb4812565570..f7be8e2ab10acc7b0a0fe414b2a5f7da921e8f6d 100644 (file)
@@ -39,9 +39,7 @@ CREATE TABLE `{?_MYSQL_PREFIX?}_config` (
   `check_double_pass` ENUM('Y','N') NOT NULL DEFAULT 'N',
   `admin_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `url_tlock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400',
   `check_double_pass` ENUM('Y','N') NOT NULL DEFAULT 'N',
   `admin_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `url_tlock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400',
-  `test_text` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `max_tlength` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1000',
   `max_tlength` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1000',
-  `test_subj` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `autosend_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
   `max_send` TINYINT(3) UNSIGNED NOT NULL DEFAULT '100',
   `url_blacklist` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `autosend_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
   `max_send` TINYINT(3) UNSIGNED NOT NULL DEFAULT '100',
   `url_blacklist` ENUM('Y','N') NOT NULL DEFAULT 'Y',
index 02e114688c4590d92f8ac707fb498266af6e280e..10a85a00de47d99c0a1e93b4cf2829386b2d7a1a 100644 (file)
@@ -40,8 +40,8 @@
                <td align="right">{--ADMIN_OPTION_CHECK_EMAIL_TEXT--}:</td>
                <td>
                        <span class="nobr">
                <td align="right">{--ADMIN_OPTION_CHECK_EMAIL_TEXT--}:</td>
                <td>
                        <span class="nobr">
-                               {--YES--}:&nbsp;<input type="radio" name="test_text" value="N"$content[test_text_y] />&nbsp;
-                               {--NO--}:&nbsp;<input type="radio" name="test_text" value="Y"$content[test_text_n] />
+                               {--YES--}:&nbsp;<input type="radio" name="allow_url_in_text" value="Y"$content[allow_url_in_text_y] />&nbsp;
+                               {--NO--}:&nbsp;<input type="radio" name="allow_url_in_text" value="N"$content[allow_url_in_text_n] />
                        </span>
                </td>
        </tr>
                        </span>
                </td>
        </tr>
@@ -50,8 +50,8 @@
                <td align="right">{--ADMIN_OPTION_CHECK_EMAIL_SUBJ--}:</td>
                <td>
                        <span class="nobr">
                <td align="right">{--ADMIN_OPTION_CHECK_EMAIL_SUBJ--}:</td>
                <td>
                        <span class="nobr">
-                               {--YES--}:&nbsp;<input type="radio" name="test_subj" value="Y"$content[test_subj_y] />&nbsp;
-                               {--NO--}:&nbsp;<input type="radio" name="test_subj" value="N"$content[test_subj_n] />
+                               {--YES--}:&nbsp;<input type="radio" name="allow_url_in_subject" value="Y"$content[allow_url_in_subject_y] />&nbsp;
+                               {--NO--}:&nbsp;<input type="radio" name="allow_url_in_subject" value="N"$content[allow_url_in_subject_n] />
                        </span>
                </td>
        </tr>
                        </span>
                </td>
        </tr>
index 870072a26c908f27aecfd96fa0a6b2e1afc4e1eb..0941769441100feab1c502540fecaa41351d6d20 100644 (file)
@@ -1,3 +1,4 @@
+<div align="center">
 <form accept-charset="utf-8" action="{%url=modules.php?module=admin&amp;what=config_order%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
        <tr>
 <form accept-charset="utf-8" action="{%url=modules.php?module=admin&amp;what=config_order%}" method="post">
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
        <tr>
@@ -68,3 +69,4 @@
        </tr>
 </table>
 </form>
        </tr>
 </table>
 </form>
+</div>