case '0.0.2': // SQL queries for v0.0.2
// Load the fix include
- addIncludeToPool('extension', 'inc/fix_menu.php');
+ addIncludeToPool('extension', 'inc/fixes/fix_menu.php');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Doppelte Menüpunkte bereinigt.");
addMemberMenuSql('main', 'reflist', 'Ref-Übersicht', 5);
// Execute this special file on registration
- addIncludeToPool('extension', 'inc/fix_refsystem.php');
+ addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php');
break;
case 'remove': // Do stuff when removing extension
} // END - if
// Version number
-setThisExtensionVersion('0.6.2');
+setThisExtensionVersion('0.6.3');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.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', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2'));
+setExtensionVersionHistory(array('0.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', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
setExtensionUpdateNotes("Filter-Tabelle bereinigt um doppelte Einträge und Unique-Key auf <span class=\"bad\">filter_name</span> und <span class=\"bad\">filter_function</span> zusammen gesetzt.");
// Add special fix include to fix filters
- addIncludeToPool('extension', 'inc/fix_filters.php');
+ addIncludeToPool('extension', 'inc/fixes/fix_filters.php');
break;
case '0.6.4': // SQL queries for v0.6.4
case '0.4.1': // SQL queries for v0.4.1
// Add special fix include to fix filters
- addIncludeToPool('extension', 'inc/fix_user_points.php');
+ addIncludeToPool('extension', 'inc/fixes/fix_user_points.php');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Das Mitgliederguthaben musste repariert werden, da für Referral-Ebene 0, noch NULL geschrieben wurde.");
'User referrals');
// Load ext-refback's special include to regenerate the referral table
- addIncludeToPool('extension', 'inc/fix_refsystem.php');
+ addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback.");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für das Handling der Loginanfragen hinzugeügt.");
break;
+
+ case '0.6.3': // SQL queries for v0.6.3
+ addExtensionAddTableColumnSql('user_data', 'confirmed_timestamp', 'TIMESTAMP NULL DEFAULT NULL');
+ addExtensionAddTableColumnSql('user_data', 'confirmed_ip_address', 'VARCHAR(255) NULL DEFAULT NULL');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Spalten für Bestätigungszeitpunkt und IP-Adresse hinzugefügt.");
+ break;
} // END - switch
// [EOF]
+++ /dev/null
-<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 10/06/2009 *
- * =================== Last change: 10/06/2009 *
- * *
- * -------------------------------------------------------------------- *
- * File : fix_filters.php *
- * -------------------------------------------------------------------- *
- * Short description : Fixes dublicate entries in filters table *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Repariert doppelte Eintraege in filters-Tabelle *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2016 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
-
-// Get all filters
-$result = sqlQuery('SELECT
- `filter_name`,
- `filter_function`
-FROM
- `{?_MYSQL_PREFIX?}_filters`
-ORDER BY
- `filter_name` ASC,
- `filter_function` ASC', __FILE__, __LINE__);
-
-// Are there entries? (there should be!)
-if (!ifSqlHasZeroNumRows($result)) {
- // Load row by row
- while ($filter = sqlFetchArray($result)) {
- // Now search again for this filter and get it's total count
- $count = countSumTotalData($filter['filter_name'], 'filters', 'filter_id', 'filter_name', TRUE, sprintf(" AND `filter_function`='%s'", sqlEscapeString($filter['filter_function'])));
-
- // Is there more than one entry?
- if ($count > 1) {
- // Then clean them up, except one
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s",
- array($filter['filter_name'], $filter['filter_function'], ($count - 1)));
- } // END - while
- } // END - while
-
- // Rebuild the cache
- rebuildCache('filter', 'filter');
-} // END - if
-
-// Free result
-sqlFreeResult($result);
-
-// Now insert our unqiue key
-addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`');
-addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)');
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 10/22/2009 *
- * =================== Last change: 10/22/2009 *
- * *
- * -------------------------------------------------------------------- *
- * File : fix_menu.php *
- * -------------------------------------------------------------------- *
- * Short description : Fixes dublicate entries in filters table *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Repariert doppelte Eintraege in filters-Tabelle *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2016 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
-
-// Get all menus
-foreach (array('guest','member','admin') as $menu) {
- // Query it
- $result = sqlQueryEscaped("SELECT `action`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` ORDER BY `action` ASC,`what` ASC",
- array($menu), __FILE__, __LINE__);
-
- // Init array
- $menus = array();
-
- // Load all entries
- while ($entry = sqlFetchArray($result)) {
- // Is the menu entry set?
- if (!isset($menus['menu'][$entry['action']][$entry['what']])) {
- // Not found
- $menus['menu'][$entry['action']][$entry['what']] = 1;
- } else {
- // Double entry, so get count
- if (is_null($entry['what'])) {
- // Main menu
- $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, ' AND `what` IS NULL');
- } else {
- // Sub menu
- $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, sprintf(" AND `what`='%s'", $entry['what']));
- }
- //* DEBUG: */ debugOutput('menu='.$menu.',action='.$entry['action'].',what='.$entry['what'].',entries='.$entries);
-
- // Only remove if we have at least 2 entries from same menu
- if ($entries > 1) {
- // Remove all except one
- if (is_null($entry['what'])) {
- // Main menu is double
- sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s",
- array(
- $menu,
- $entry['action'],
- ($entries - 1)
- ), __FILE__, __LINE__);
- } else {
- // Sub menu is double
- sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s",
- array(
- $menu,
- $entry['action'],
- $entry['what'],
- ($entries - 1)
- ), __FILE__, __LINE__);
- }
- } // END - if
- }
- } // END - while
-
- // Free result
- sqlFreeResult($result);
-
- // Init sqls
- initSqls();
-
- // Now insert our unqiue key for action-what combination
- addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `action_what`', $menu));
- addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action`, `what`)', $menu));
-
- // Now insert our unqiue key for what
- addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `what`', $menu));
- addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)', $menu));
-
- // And run all
- runFilterChain('run_sqls');
-} // END - foreach
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 07/13/2011 *
- * =================== Last change: 07/13/2011 *
- * *
- * -------------------------------------------------------------------- *
- * File : fix_refsystem.php *
- * -------------------------------------------------------------------- *
- * Short description : Generate refback table including all refs *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Refback-Tabelle mit allen Refs generieren *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2016 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
-
-// Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
-$result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__);
-if (!ifSqlHasZeroNumRows($result)) {
- // Remove index temporaly
- sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__);
-
- // Upgrade refsystem
- sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__);
-
- // Add it again
- sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`, `level`)', __FILE__, __LINE__);
-
- // Rebuild cache
- rebuildCache('refsystem', 'refsystem');
-} // END - if
-
-// Free result
-sqlFreeResult($result);
-
-// Reset the table
-sqlQuery('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__);
-
-// Begin with all users in level one
-$result_direct = sqlQuery('SELECT
- `userid`
-FROM
- `{?_MYSQL_PREFIX?}_user_data`
-WHERE
- `refid`=0 OR
- `refid` IS NULL
-ORDER BY
- `userid` ASC', __FILE__, __LINE__);
-
-// Are there entries?
-if (!ifSqlHasZeroNumRows($result_direct)) {
- // When 'walk' through all users
- while ($content = sqlFetchArray($result_direct)) {
- // Update refback table
- /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - BEFORE!');
- updateReferralTable($content['userid']);
- /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - AFTER!');
- } // END - while
-} // END - if
-
-// Free result
-sqlFreeResult($result_direct);
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 07/04/2011 *
- * =================== Last change: 07/04/2011 *
- * *
- * -------------------------------------------------------------------- *
- * File : fix_user_points.php *
- * -------------------------------------------------------------------- *
- * Short description : Fixes dublicate entries in user_points table *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Repariert doppelte Eintraege in user_points *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2016 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
-
-// Get all user points
-$result = sqlQuery('SELECT
- `userid`,
- `points`,
- `locked_points`,
- `order_points`,
- `locked_order_points`
-FROM
- `{?_MYSQL_PREFIX?}_user_points`
-WHERE
- `ref_depth`=0
-ORDER BY
- `userid` ASC', __FILE__, __LINE__);
-
-// Are there entries? (there should be!)
-if (!ifSqlHasZeroNumRows($result)) {
- // Load row by row
- while ($row = sqlFetchArray($result)) {
- // Update the database again
- foreach (array_keys($row) as $column) {
- // Not userid itself
- if ($column != 'userid') {
- // Update amount
- sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth` IS NULL",
- array(
- $column,
- $column,
- $row[$column],
- $row['userid']
- ), __FILE__, __LINE__);
-
- // Nothing has been updated?
- if (ifSqlHasZeroAffectedRows()) {
- // Then insert it
- sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,NULL,%s)",
- array(
- $column,
- $row['userid'],
- $row[$column]
- ), __FILE__, __LINE__);
- } // END - if
- } // END - if
- } // END - foreach
- } // END - while
-} // END - if
-
-// Free result
-sqlFreeResult($result);
-
-// Remove all entries
-sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `ref_depth`=0', __FILE__, __LINE__);
-
-// [EOF]
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 03/28/2016 *
+ * =================== Last change: 03/28/2016 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_ *
+ * -------------------------------------------------------------------- *
+ * Short description : Fixes *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Repariert *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2016 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
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/06/2009 *
+ * =================== Last change: 10/06/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_filters.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Fixes dublicate entries in filters table *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Repariert doppelte Eintraege in filters-Tabelle *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2016 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
+
+// Get all filters
+$result = sqlQuery('SELECT
+ `filter_name`,
+ `filter_function`
+FROM
+ `{?_MYSQL_PREFIX?}_filters`
+ORDER BY
+ `filter_name` ASC,
+ `filter_function` ASC', __FILE__, __LINE__);
+
+// Are there entries? (there should be!)
+if (!ifSqlHasZeroNumRows($result)) {
+ // Load row by row
+ while ($filter = sqlFetchArray($result)) {
+ // Now search again for this filter and get it's total count
+ $count = countSumTotalData($filter['filter_name'], 'filters', 'filter_id', 'filter_name', TRUE, sprintf(" AND `filter_function`='%s'", sqlEscapeString($filter['filter_function'])));
+
+ // Is there more than one entry?
+ if ($count > 1) {
+ // Then clean them up, except one
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s",
+ array($filter['filter_name'], $filter['filter_function'], ($count - 1)));
+ } // END - while
+ } // END - while
+
+ // Rebuild the cache
+ rebuildCache('filter', 'filter');
+} // END - if
+
+// Free result
+sqlFreeResult($result);
+
+// Now insert our unqiue key
+addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`');
+addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)');
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/22/2009 *
+ * =================== Last change: 10/22/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_menu.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Fixes dublicate entries in filters table *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Repariert doppelte Eintraege in filters-Tabelle *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2016 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
+
+// Get all menus
+foreach (array('guest','member','admin') as $menu) {
+ // Query it
+ $result = sqlQueryEscaped("SELECT `action`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` ORDER BY `action` ASC,`what` ASC",
+ array($menu), __FILE__, __LINE__);
+
+ // Init array
+ $menus = array();
+
+ // Load all entries
+ while ($entry = sqlFetchArray($result)) {
+ // Is the menu entry set?
+ if (!isset($menus['menu'][$entry['action']][$entry['what']])) {
+ // Not found
+ $menus['menu'][$entry['action']][$entry['what']] = 1;
+ } else {
+ // Double entry, so get count
+ if (is_null($entry['what'])) {
+ // Main menu
+ $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, ' AND `what` IS NULL');
+ } else {
+ // Sub menu
+ $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, sprintf(" AND `what`='%s'", $entry['what']));
+ }
+ //* DEBUG: */ debugOutput('menu='.$menu.',action='.$entry['action'].',what='.$entry['what'].',entries='.$entries);
+
+ // Only remove if we have at least 2 entries from same menu
+ if ($entries > 1) {
+ // Remove all except one
+ if (is_null($entry['what'])) {
+ // Main menu is double
+ sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s",
+ array(
+ $menu,
+ $entry['action'],
+ ($entries - 1)
+ ), __FILE__, __LINE__);
+ } else {
+ // Sub menu is double
+ sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s",
+ array(
+ $menu,
+ $entry['action'],
+ $entry['what'],
+ ($entries - 1)
+ ), __FILE__, __LINE__);
+ }
+ } // END - if
+ }
+ } // END - while
+
+ // Free result
+ sqlFreeResult($result);
+
+ // Init sqls
+ initSqls();
+
+ // Now insert our unqiue key for action-what combination
+ addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `action_what`', $menu));
+ addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action`, `what`)', $menu));
+
+ // Now insert our unqiue key for what
+ addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `what`', $menu));
+ addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)', $menu));
+
+ // And run all
+ runFilterChain('run_sqls');
+} // END - foreach
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/13/2011 *
+ * =================== Last change: 07/13/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_refsystem.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Generate refback table including all refs *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Refback-Tabelle mit allen Refs generieren *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2016 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
+
+// Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
+$result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__);
+if (!ifSqlHasZeroNumRows($result)) {
+ // Remove index temporaly
+ sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__);
+
+ // Upgrade refsystem
+ sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__);
+
+ // Add it again
+ sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`, `level`)', __FILE__, __LINE__);
+
+ // Rebuild cache
+ rebuildCache('refsystem', 'refsystem');
+} // END - if
+
+// Free result
+sqlFreeResult($result);
+
+// Reset the table
+sqlQuery('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__);
+
+// Begin with all users in level one
+$result_direct = sqlQuery('SELECT
+ `userid`
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+WHERE
+ `refid`=0 OR
+ `refid` IS NULL
+ORDER BY
+ `userid` ASC', __FILE__, __LINE__);
+
+// Are there entries?
+if (!ifSqlHasZeroNumRows($result_direct)) {
+ // When 'walk' through all users
+ while ($content = sqlFetchArray($result_direct)) {
+ // Update refback table
+ /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - BEFORE!');
+ updateReferralTable($content['userid']);
+ /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - AFTER!');
+ } // END - while
+} // END - if
+
+// Free result
+sqlFreeResult($result_direct);
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/04/2011 *
+ * =================== Last change: 07/04/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_user_points.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Fixes dublicate entries in user_points table *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Repariert doppelte Eintraege in user_points *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2016 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
+
+// Get all user points
+$result = sqlQuery('SELECT
+ `userid`,
+ `points`,
+ `locked_points`,
+ `order_points`,
+ `locked_order_points`
+FROM
+ `{?_MYSQL_PREFIX?}_user_points`
+WHERE
+ `ref_depth`=0
+ORDER BY
+ `userid` ASC', __FILE__, __LINE__);
+
+// Are there entries? (there should be!)
+if (!ifSqlHasZeroNumRows($result)) {
+ // Load row by row
+ while ($row = sqlFetchArray($result)) {
+ // Update the database again
+ foreach (array_keys($row) as $column) {
+ // Not userid itself
+ if ($column != 'userid') {
+ // Update amount
+ sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth` IS NULL",
+ array(
+ $column,
+ $column,
+ $row[$column],
+ $row['userid']
+ ), __FILE__, __LINE__);
+
+ // Nothing has been updated?
+ if (ifSqlHasZeroAffectedRows()) {
+ // Then insert it
+ sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,NULL,%s)",
+ array(
+ $column,
+ $row['userid'],
+ $row[$column]
+ ), __FILE__, __LINE__);
+ } // END - if
+ } // END - if
+ } // END - foreach
+ } // END - while
+} // END - if
+
+// Free result
+sqlFreeResult($result);
+
+// Remove all entries
+sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `ref_depth`=0', __FILE__, __LINE__);
+
+// [EOF]
+?>
} // END - if
// Load all data and add points
- $content = getUserDataArray();
+ $content = merge_array($content, getUserDataArray());
- // Unlock his account (but only when it is on UNCONFIRMED!)
- sqlQueryEscaped("UPDATE
+ // Is 'user' updated?
+ if (isExtensionInstalledAndNewer('user', '0.6.3')) {
+ // Unlock his account (but only when it is on UNCONFIRMED!)
+ sqlQueryEscaped("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `status`='CONFIRMED',
+ `user_hash`=NULL,
+ `confirmed_timestamp`=NOW(),
+ `confirmed_ip_address`='%s'
+WHERE
+ `user_hash`='%s' AND
+ `status`='UNCONFIRMED'
+LIMIT 1",
+ array(
+ determineRealRemoteAddress(),
+ $hash
+ ), __FILE__, __LINE__
+ );
+ } else {
+ // Unlock his account (but only when it is on UNCONFIRMED!)
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_user_data`
SET
`status`='CONFIRMED',
`user_hash`='%s' AND
`status`='UNCONFIRMED'
LIMIT 1",
- array($hash), __FILE__, __LINE__);
+ array(
+ $hash
+ ), __FILE__, __LINE__
+ );
+ }
// Was it updated?
if (ifSqlHasZeroAffectedRows()) {
} // END - if
// Just include fix_refsystem.php again
-loadIncludeOnce('inc/fix_refsystem.php');
+loadIncludeOnce('inc/fixes/fix_refsystem.php');
// Output message
displayMessage('{--ADMIN_REPAIR_REFERRAL_SYSTEM_DONE--}');