} // END - if
// Version number
-setThisExtensionVersion('0.5.1');
+setThisExtensionVersion('0.5.2');
// 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)
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Weiteren Menü-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;
'ADMIN_ORDER_MIN_RECEIVER_PER_ORDER' => "Minimale Anzahl Empfänger pro Mailbuchung",
'ADMIN_ORDER_MAX' => "So viele wie möglich.",
'ADMIN_ORDER_ORDER' => "So viele wie auf Empfang eingestellt.",
- 'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie können heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
- 'MEMBER_ORDER_ALLOWED_MAX' => "Sie kö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änger",
+ 'ADMIN_OPTION_MAX_TEXT_LENGTH' => "Maximale Lä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ür gebuchte URLs aktivieren?",
+ 'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie können heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
+ 'MEMBER_ORDER_ALLOWED_MAX' => "Sie kö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önnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang höher ein.",
'MEMBER_ENTER_INVALID_URL' => "Ungütige URL eingegeben.",
'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 Änderung (0 = Keine Sperrzeit)",
- 'ADMIN_OPTION_MAX_TEXT_LENGTH' => "Maximale Lä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ür gebuchte URLs aktivieren?",
'ADMIN_OPTION_AUTOSEND_ACTIVE' => "Ist der Auto-Versand aktiv?",
'ADMIN_OPTION_NOTIFY_ADMIN' => "Benachrichtigung bei Profiländerung?",
'ADMIN_OPTION_MAX_ONLINETIME' => "Timeout für Who-is-Online",
// 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
// 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]))) {
$test = (float)$val;
if ('' . $val . '' == '' . $test . '') {
// Add numbers
- $DATA[] = sprintf("`%s`=%s", $id, $test);
+ $tableData[] = sprintf("`%s`=%s", $id, $test);
} else {
// Add strings
- $DATA[] = sprintf("`%s`='%s'", $id, trim($val));
+ $tableData[] = sprintf("`%s`='%s'", $id, trim($val));
}
// Do not add a config entry twice
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,
- $DATA_UPDATE,
+ $updatedData,
$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);
- $KEYs[] = $line[0]; $values[] = $line[1];
+ $keys[] = $line[0];
+ $values[] = $line[1];
} // 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,
- $KEYs,
+ $keys,
$values
);
}
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
- 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
// 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.)
- 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&what=order&code=' . getCode('URL_FOUND');
} // END - if
} // 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_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',
- `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',
<td align="right">{--ADMIN_OPTION_CHECK_EMAIL_TEXT--}:</td>
<td>
<span class="nobr">
- {--YES--}: <input type="radio" name="test_text" value="N"$content[test_text_y] />
- {--NO--}: <input type="radio" name="test_text" value="Y"$content[test_text_n] />
+ {--YES--}: <input type="radio" name="allow_url_in_text" value="Y"$content[allow_url_in_text_y] />
+ {--NO--}: <input type="radio" name="allow_url_in_text" value="N"$content[allow_url_in_text_n] />
</span>
</td>
</tr>
<td align="right">{--ADMIN_OPTION_CHECK_EMAIL_SUBJ--}:</td>
<td>
<span class="nobr">
- {--YES--}: <input type="radio" name="test_subj" value="Y"$content[test_subj_y] />
- {--NO--}: <input type="radio" name="test_subj" value="N"$content[test_subj_n] />
+ {--YES--}: <input type="radio" name="allow_url_in_subject" value="Y"$content[allow_url_in_subject_y] />
+ {--NO--}: <input type="radio" name="allow_url_in_subject" value="N"$content[allow_url_in_subject_n] />
</span>
</td>
</tr>
+<div align="center">
<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=config_order%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
</tr>
</table>
</form>
+</div>