inc/extensions/ext-yacy.php svneol=native#text/plain
inc/extensions/ext-yoomedia.php svneol=native#text/plain
inc/filter-functions.php svneol=native#text/plain
+inc/filter/.htaccess svneol=native#text/plain
+inc/filter/_filter.php svneol=native#text/plain
+inc/filter/active_filter.php svneol=native#text/plain
+inc/filter/admins_filter.php svneol=native#text/plain
+inc/filter/bonus_filter.php svneol=native#text/plain
+inc/filter/booking_filter.php svneol=native#text/plain
+inc/filter/cache_filter.php svneol=native#text/plain
+inc/filter/mediadata_filter.php svneol=native#text/plain
+inc/filter/online_filter.php svneol=native#text/plain
+inc/filter/other_filter.php svneol=native#text/plain
+inc/filter/politician_stop_filter.php svneol=native#text/plain
+inc/filter/rallye_filter.php svneol=native#text/plain
+inc/filter/register_filter.php svneol=native#text/plain
+inc/filter/removeip_filter.php svneol=native#text/plain
+inc/filter/theme_filter.php svneol=native#text/plain
+inc/filter/timezone_filter.php svneol=native#text/plain
+inc/filter/uberwach_filter.php svneol=native#text/plain
inc/filters.php svneol=native#text/plain
inc/fix_filters.php svneol=native#text/plain
inc/fix_menu.php svneol=native#text/plain
));
}
+ // Load extension's filter library if present
+ loadExtensionFilters($ext_name);
+
// Extensions are not deprecated by default
setExtensionDeprecated('N');
case 'init': // Do stuff when extension is initialized
// Do stuff only when not in CSS mode
- // @TODO Move this code into rallye_functions.php
+ // @TODO Move this code into a hook
if (!isCssOutputMode()) {
// Get total member count
$total = getTotalConfirmedUser();
$GLOBALS['cache_array']['filter'] = $filterArray;
}
+// Loads filter for given extension if present. This function will silently
+// ignore absent filter files.
+function loadExtensionFilters ($ext_name) {
+ // Do we have cache entry?
+ if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
+ // Default is not found
+ $GLOBALS[__FUNCTION__][$ext_name] = false;
+
+ // Construct include file name
+ $incFileName = sprintf("inc/filter/%s_filter.php", $ext_name);
+
+ // Is the include file readable?
+ if (isIncludeReadable($incFileName)) {
+ // Load the include file
+ loadIncludeOnce($incFileName);
+
+ // Mark the file as loaded
+ $GLOBALS[__FUNCTION__][$ext_name] = true;
+ } elseif (isDebugModeEnabled()) {
+ // Log missing file
+ logDebugMessage(__FUNCTION__, __LINE__, 'Include file ' . $incFileName . ' for extension ' . $ext_name . ' is missing.');
+ }
+ } // END - if
+}
+
// [EOF]
?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for adding link to "active list"
+function FILTER_ADD_LINK_ACTIVE_LIST () {
+ // Is ext-active/online there?
+ if ((isExtensionActive('active')) && (isExtensionActive('online'))) {
+ // Init fake-content because there is no `what`='active' in database
+ $content = array(
+ 'menu' => '<a class="menu_blur" href="{%url=modules.php?module=index&what=active%}">{?menu_blur_spacer?}{--GUEST_ACTIVE_LINK--}</a>',
+ 'what' => 'active',
+ 'visible' => 'Y',
+ 'locked' => 'N'
+ );
+
+ // Add link to "we were active today" page
+ $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content);
+ } // END - if
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for adding extra data to the query
+function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
+ // Is the admins extension updated? (should be!)
+ if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl';
+ if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`';
+ if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
+ if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`';
+
+ // Return it
+ return $add;
+}
+
+// Reset the login failures
+function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
+ // Store it in session
+ setSession('mailer_admin_failures' , getAdminLoginFailures($data['id']));
+ setSession('mailer_admin_last_failure', getAdminLastFailure($data['id']));
+
+ // Prepare update data
+ $postData['login'][getCurrentAdminId()] = $data['login'];
+ $postData['login_failures'][getCurrentAdminId()] = '0';
+ $postData['last_failure'][getCurrentAdminId()] = null;
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData);
+
+ // Always make sure the cache is destroyed
+ rebuildCache('admin');
+
+ // Return the data for further processing
+ return $data;
+}
+
+// Count the login failure
+function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
+ // Prepare update data
+ $postData['login'][getCurrentAdminId()] = $data['login'];
+ $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1';
+ $postData['last_failure'][getCurrentAdminId()] = 'NOW()';
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData);
+
+ // Always make sure the cache is destroyed
+ rebuildCache('admin');
+
+ // Return the data for further processing
+ return $data;
+}
+
+// Rehashes the given plain admin password and stores it the database
+function FILTER_REHASH_ADMINS_PASSWORD ($data) {
+ // Generate new hash
+ $newHash = generateHash($data['plain_pass']);
+
+ // Prepare update data
+ $postData['login'][getCurrentAdminId()] = $data['login'];
+ $postData['password'][getCurrentAdminId()] = $newHash;
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData);
+
+ // Update cookie/session and data array
+ setAdminMd5(encodeHashForCookie($newHash));
+ $data['pass_hash'] = $newHash;
+
+ // Always make sure the cache is destroyed
+ rebuildCache('admin');
+
+ // Return the data for further processing
+ return $data;
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for adding login bonus to the user's account
+function FILTER_ADD_LOGIN_BONUS () {
+ // Is the user data valid?
+ if (!isMember()) {
+ // Do only run for logged in members
+ debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
+ } // END - if
+
+ // Bonus is not given by default ;-)
+ $bonus = false;
+ if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('bonus_login_yn') == 'Y')) {
+ // Update last login if far enougth away
+ // @TODO This query isn't right, it will only update if the user was for a longer time away!
+ SQL_QUERY_ESC('UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `last_login`=UNIX_TIMESTAMP()
+WHERE
+ `userid`=%s AND
+ `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
+LIMIT 1',
+ array(
+ getMemberId()
+ ), __FUNCTION__, __LINE__
+ );
+
+ // Updated entry?
+ $bonus = (!SQL_HASZEROAFFECTED());
+ } // END - if
+
+ if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
+ // Output message with added points
+ $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
+ } elseif (isExtensionActive('bonus')) {
+ // No login bonus added!
+ $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for adding booking record
+function FILTER_ADD_BOOKING_RECORD ($data) {
+ // Add a record
+ addBookingRecord($data['subject'], $data['userid'], $data['points'], $data['mode']);
+
+ // Return data
+ return $data;
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Destroy the cache on extension changes
+function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
+ // Return the data anyway if there is no cache extension
+ if (!isCacheInstanceValid()) return $data;
+
+ // Remove cache
+ foreach (array('config','extension','filter','modules') as $cache) {
+ if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
+ } // END - foreach
+
+ // Return it
+ return $data;
+}
+
+// Destroy the cache on changing admin
+function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) {
+ // Skip this step if the cache instance is not there
+ if (!isCacheInstanceValid()) return false;
+
+ // Remove cache
+ if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
+
+ // Return the data
+ return $data;
+}
+
+// Destroy all cache files
+function FILTER_CACHE_DESTROY_ALL () {
+ // Skip this step if the cache instance is not there
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ if (!isCacheInstanceValid()) return false;
+
+ // Remove cache files
+ foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
+ // Is the cache file readable?
+ // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
+ if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
+ // Remove the cache file
+ $GLOBALS['cache_instance']->removeCacheFile();
+ } // END - if
+ } // END - foreach
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+}
+
+// Filter for purging 'filter' cache
+function FILTER_CACHE_DESTROY_FILTER () {
+ // Skip this step if the cache instance is not there
+ if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
+
+ // Remove cache files
+ if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for updating media data
+function FILTER_UPDATE_MEDIADATA_ENTRY ($data) {
+ // Execute the filter function
+ $data['added'] = ($data['added'] && updateMediadataEntry(array('total_points'), $data['mode'], $data['points']));
+
+ // Return data
+ return $data;
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for updates/extends on the online list
+function FILTER_UPDATE_ONLINE_LIST () {
+ // Do not update online list when extension is deactivated
+ if (!isExtensionActive('online', true)) {
+ // Extension not active
+ return;
+ } // END - if
+
+ // Empty session?
+ if (session_id() == '') {
+ // This is invalid here!
+ debug_report_bug(__FUNCTION__, __LINE__, 'Invalid session.');
+ } // END - if
+
+ // Initialize variables
+ $userid = '0';
+ $isMember = 'N';
+ $isAdmin = 'N';
+ $action = getActionFromModuleWhat(getModule(), getWhat());
+
+ // Valid userid?
+ if (isMember()) {
+ // Is valid user
+ $userid = getMemberId();
+ $isMember = 'Y';
+ } // END - if
+
+ if (isAdmin()) {
+ // Is administrator
+ $isAdmin = 'Y';
+ } // END - if
+
+ // Now search for the user
+ $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1",
+ array(session_id()), __FUNCTION__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Then update it
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_online`
+SET
+ `module`='%s',
+ `action`='%s',
+ `what`='%s',
+ `userid`=%s,
+ `refid`=%s,
+ `is_member`='%s',
+ `is_admin`='%s',
+ `timestamp`=UNIX_TIMESTAMP(),
+ `ip`='%s'
+WHERE
+ `sid`='%s'
+LIMIT 1",
+ array(
+ getModule(),
+ $action,
+ getWhat(),
+ makeDatabaseUserId($userid),
+ makeDatabaseUserId(determineReferalId()),
+ $isMember,
+ $isAdmin,
+ detectRemoteAddr(),
+ session_id()
+ ), __FUNCTION__, __LINE__);
+ } else {
+ // No entry does exists so we simply add it!
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
+ array(
+ getModule(),
+ $action,
+ getWhat(),
+ makeDatabaseUserId($userid),
+ makeDatabaseUserId(determineReferalId()),
+ $isMember,
+ $isAdmin,
+ session_id(),
+ detectRemoteAddr()
+ ), __FUNCTION__, __LINE__);
+ }
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Purge old entries
+ SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for debugging SQLs
+function FILTER_DISPLAY_DEBUG_SQL () {
+ // Shall we display SQL queries?
+ if ((isAdmin()) && (isDisplayDebugSqlEnabled()) && (!isGetRequestParameterSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ displayDebugSqls();
+ } // END - if
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for displaying politician_stop snippet
+function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET () {
+ // Shall we include the politician_stop snippet?
+ if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('politician_stop')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ loadPoliticianStopSnippet();
+ } // END - if
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for extra-autpurge
+function FILTER_RALLYE_EXTRA_AUTOPURGE () {
+ // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!)
+ purgeExpiredReferalRallyes();
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Run a filter for must-fillout fields
+function FILTER_REGISTER_MUST_FILLOUT ($content) {
+ // Get all fields for output
+ $result = SQL_QUERY('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
+ __FUNCTION__, __LINE__);
+
+ // Walk through all entries
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Must the user fill out this element?
+ $value = '';
+ if ($row['field_required'] == 'Y') {
+ $value = '<span class="notice">(*)</span>';
+ } // END - if
+
+ // Add it
+ $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
+ } // END - while
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Return it
+ return $content;
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for adding anonymity notice to the output stream
+function FILTER_ADD_ANONYMITY_NOTICE ($data) {
+ // Init content
+ $content = $data;
+
+ // Extension removeip activated?
+ if ((isExtensionActive('removeip')) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == 'Y')) {
+ // Add anoymity/privacy infos
+ $content['content'] .= addAnonymityLevel() . "<br />\n";
+ } // END - if
+
+ // Return it
+ return $content;
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for generic handling of theme change
+function FILTER_HANDLE_THEME_CHANGE () {
+ // Check if new theme is selcted
+ if ((isPostRequestParameterSet('new_theme')) && (postRequestParameter('new_theme') != getCurrentTheme())) {
+ // Set new theme for guests
+ $newTheme = postRequestParameter('new_theme');
+
+ // Change to new theme
+ setTheme($newTheme);
+
+ // Remove current from array
+ removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
+
+ // Add new theme
+ addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
+
+ // Redirect to same URL
+ redirectToRequestUri();
+ } // END - if
+}
+
+// Filter for settings theme from user profile, must be executed only if FILTER_FETCH_USER_DATA() ran before
+function FILTER_SET_USERS_THEME () {
+ // Is the user data valid?
+ if (!isMember()) {
+ // Do only run for logged in members
+ debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
+ } // END - if
+
+ // Change to new theme
+ setTheme(getUserData('curr_theme'));
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for setting the timezone
+function FILTER_INIT_TIMEZONE () {
+ // Just set it if the required function is there
+ if (function_exists('date_default_timezone_set')) {
+ // CFG: TIME-ZONE
+ date_default_timezone_set(getConfig('timezone'));
+ } // END - if
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 06/02/2011 *
+ * =================== Last change: 06/02/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : _filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $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://www.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
+
+// Filter for displaying uberwach snippet
+function FILTER_DISPLAY_UBERWACH_SNIPPET () {
+ // Shall we include the uberwach snippet?
+ if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ loadUberwachSnippet();
+ } // END - if
+}
+
+// [EOF]
+?>
die();
} // END - if
-// Filter for adding link to "active list"
-function FILTER_ADD_LINK_ACTIVE_LIST () {
- // Is ext-active/online there?
- if ((isExtensionActive('active')) && (isExtensionActive('online'))) {
- // Init fake-content because there is no `what`='active' in database
- $content = array(
- 'menu' => '<a class="menu_blur" href="{%url=modules.php?module=index&what=active%}">{?menu_blur_spacer?}{--GUEST_ACTIVE_LINK--}</a>',
- 'what' => 'active',
- 'visible' => 'Y',
- 'locked' => 'N'
- );
-
- // Add link to "we were active today" page
- $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content);
- } // END - if
-}
-
// [EOF]
?>
return $data['last_failure'];
}
-//-----------------------------------------------------------------------------
-// Filter Functions
-//-----------------------------------------------------------------------------
-
-// Filter for adding extra data to the query
-function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
- // Is the admins extension updated? (should be!)
- if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl';
- if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`';
- if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
- if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`';
-
- // Return it
- return $add;
-}
-
-// Reset the login failures
-function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
- // Store it in session
- setSession('mailer_admin_failures' , getAdminLoginFailures($data['id']));
- setSession('mailer_admin_last_failure', getAdminLastFailure($data['id']));
-
- // Prepare update data
- $postData['login'][getCurrentAdminId()] = $data['login'];
- $postData['login_failures'][getCurrentAdminId()] = '0';
- $postData['last_failure'][getCurrentAdminId()] = null;
-
- // Change it in the admin
- adminsChangeAdminAccount($postData);
-
- // Always make sure the cache is destroyed
- rebuildCache('admin');
-
- // Return the data for further processing
- return $data;
-}
-
-// Count the login failure
-function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
- // Prepare update data
- $postData['login'][getCurrentAdminId()] = $data['login'];
- $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1';
- $postData['last_failure'][getCurrentAdminId()] = 'NOW()';
-
- // Change it in the admin
- adminsChangeAdminAccount($postData);
-
- // Always make sure the cache is destroyed
- rebuildCache('admin');
-
- // Return the data for further processing
- return $data;
-}
-
-// Rehashes the given plain admin password and stores it the database
-function FILTER_REHASH_ADMINS_PASSWORD ($data) {
- // Generate new hash
- $newHash = generateHash($data['plain_pass']);
-
- // Prepare update data
- $postData['login'][getCurrentAdminId()] = $data['login'];
- $postData['password'][getCurrentAdminId()] = $newHash;
-
- // Change it in the admin
- adminsChangeAdminAccount($postData);
-
- // Update cookie/session and data array
- setAdminMd5(encodeHashForCookie($newHash));
- $data['pass_hash'] = $newHash;
-
- // Always make sure the cache is destroyed
- rebuildCache('admin');
-
- // Return the data for further processing
- return $data;
-}
-
// ---------------------------------------------------------------------------
// Wrapper functions
// ---------------------------------------------------------------------------
} // END - if
}
-//-----------------------------------------------------------------------------
-// Filter Functions
-//-----------------------------------------------------------------------------
-
-// Filter for adding login bonus to the user's account
-function FILTER_ADD_LOGIN_BONUS () {
- // Is the user data valid?
- if (!isMember()) {
- // Do only run for logged in members
- debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
- } // END - if
-
- // Bonus is not given by default ;-)
- $bonus = false;
- if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('bonus_login_yn') == 'Y')) {
- // Update last login if far enougth away
- // @TODO This query isn't right, it will only update if the user was for a longer time away!
- SQL_QUERY_ESC('UPDATE
- `{?_MYSQL_PREFIX?}_user_data`
-SET
- `last_login`=UNIX_TIMESTAMP()
-WHERE
- `userid`=%s AND
- `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
-LIMIT 1',
- array(
- getMemberId()
- ), __FUNCTION__, __LINE__
- );
-
- // Updated entry?
- $bonus = (!SQL_HASZEROAFFECTED());
- } // END - if
-
- if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
- // Output message with added points
- $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
- } elseif (isExtensionActive('bonus')) {
- // No login bonus added!
- $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
- }
-}
-
//-----------------------------------------------------------------------------
// Wrapper Functions
//-----------------------------------------------------------------------------
array($userid, $subject, $mode, $points), __FUNCTION__, __LINE__);
}
-// Filter for adding booking record
-function FILTER_ADD_BOOKING_RECORD ($data) {
- // Add a record
- addBookingRecord($data['subject'], $data['userid'], $data['points'], $data['mode']);
-
- // Return data
- return $data;
-}
-
// [EOF]
?>
die();
} // END - if
-// Destroy the cache on extension changes
-function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
- // Return the data anyway if there is no cache extension
- if (!isCacheInstanceValid()) return $data;
-
- // Remove cache
- foreach (array('config','extension','filter','modules') as $cache) {
- if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
- } // END - foreach
-
- // Return it
- return $data;
-}
-
-// Destroy the cache on changing admin
-function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) {
- // Skip this step if the cache instance is not there
- if (!isCacheInstanceValid()) return false;
-
- // Remove cache
- if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
-
- // Return the data
- return $data;
-}
-
-// Destroy all cache files
-function FILTER_CACHE_DESTROY_ALL () {
- // Skip this step if the cache instance is not there
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
- if (!isCacheInstanceValid()) return false;
-
- // Remove cache files
- foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
- // Is the cache file readable?
- // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
- if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
- // Remove the cache file
- $GLOBALS['cache_instance']->removeCacheFile();
- } // END - if
- } // END - foreach
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
-}
-
-// Filter for purging 'filter' cache
-function FILTER_CACHE_DESTROY_FILTER () {
- // Skip this step if the cache instance is not there
- if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
-
- // Remove cache files
- if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
-}
-
// [EOF]
?>
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Update an entry
function updateMediadataEntry ($keys_array, $mode, $value) {
$value = '';
// Check for entry
- $result = SQL_QUERY_ESC("SELECT media_value FROM `{?_MYSQL_PREFIX?}_mediadata` WHERE media_key='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `media_value` FROM `{?_MYSQL_PREFIX?}_mediadata` WHERE `media_key`='%s' LIMIT 1",
array($key), __FUNCTION__, __LINE__);
+
+ // Do we have one?
if (SQL_NUMROWS($result) == 1) {
// Load data
list($value) = SQL_FETCHROW($result);
return $value;
}
-// Filter for updating media data
-function FILTER_UPDATE_MEDIADATA_ENTRY ($data) {
- // Execute the filter function
- $data['added'] = ($data['added'] && updateMediadataEntry(array('total_points'), $data['mode'], $data['points']));
-
- // Return data
- return $data;
-}
-
-//
+// [EOF]
?>
die();
} // END - if
-// Filter for updates/extends on the online list
-function FILTER_UPDATE_ONLINE_LIST () {
- // Do not update online list when extension is deactivated
- if (!isExtensionActive('online', true)) return;
-
- // Empty session?
- if (session_id() == '') {
- // This is invalid here!
- debug_report_bug(__FUNCTION__, __LINE__, 'Invalid session.');
- } // END - if
-
- // Initialize variables
- $userid = '0';
- $isMember = 'N';
- $isAdmin = 'N';
- $action = getActionFromModuleWhat(getModule(), getWhat());
-
- // Valid userid?
- if (isMember()) {
- // Is valid user
- $userid = getMemberId();
- $isMember = 'Y';
- } // END - if
-
- if (isAdmin()) {
- // Is administrator
- $isAdmin = 'Y';
- } // END - if
-
- // Now search for the user
- $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1",
- array(session_id()), __FUNCTION__, __LINE__);
-
- // Entry found?
- if (SQL_NUMROWS($result) == 1) {
- // Then update it
- SQL_QUERY_ESC("UPDATE
- `{?_MYSQL_PREFIX?}_online`
-SET
- `module`='%s',
- `action`='%s',
- `what`='%s',
- `userid`=%s,
- `refid`=%s,
- `is_member`='%s',
- `is_admin`='%s',
- `timestamp`=UNIX_TIMESTAMP(),
- `ip`='%s'
-WHERE
- `sid`='%s'
-LIMIT 1",
- array(
- getModule(),
- $action,
- getWhat(),
- makeDatabaseUserId($userid),
- makeDatabaseUserId(determineReferalId()),
- $isMember,
- $isAdmin,
- detectRemoteAddr(),
- session_id()
- ), __FUNCTION__, __LINE__);
- } else {
- // No entry does exists so we simply add it!
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
- array(
- getModule(),
- $action,
- getWhat(),
- makeDatabaseUserId($userid),
- makeDatabaseUserId(determineReferalId()),
- $isMember,
- $isAdmin,
- session_id(),
- detectRemoteAddr()
- ), __FUNCTION__, __LINE__);
- }
-
- // Free result
- SQL_FREERESULT($result);
-
- // Purge old entries
- SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
-}
-
// [EOF]
?>
$GLOBALS['page_footer'] .= loadTemplate('admin_other_sqls', true, $OUT);
}
-// Filter for debugging SQLs
-function FILTER_DISPLAY_DEBUG_SQL () {
- // Shall we display SQL queries?
- if ((isAdmin()) && (isDisplayDebugSqlEnabled()) && (!isGetRequestParameterSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- displayDebugSqls();
- } // END - if
-}
-
// [EOF]
?>
loadTemplate('politician_stop_snippet');
}
-// Filter for displaying politician_stop snippet
-function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET () {
- // Shall we include the politician_stop snippet?
- if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('politician_stop')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- loadPoliticianStopSnippet();
- } // END - if
-}
-
// [EOF]
?>
// Check status
// active = 1: account is still confirmed
// active = 0: account is deleted or locked
- $active = countSumTotalData($DATA['userid'][$idx], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
+ $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
$prices['active'][$key] = $active;
return $return;
}
-// Filter for extra-autpurge
-function FILTER_RALLYE_EXTRA_AUTOPURGE () {
- // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!)
- purgeExpiredReferalRallyes();
-}
-
// [EOF]
?>
}
}
-// Run a filter for must-fillout fields
-function FILTER_REGISTER_MUST_FILLOUT ($content) {
- // Get all fields for output
- $result = SQL_QUERY('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
- __FUNCTION__, __LINE__);
-
- // Walk through all entries
- while ($row = SQL_FETCHARRAY($result)) {
- // Must the user fill out this element?
- $value = '';
- if ($row['field_required'] == 'Y') {
- $value = '<span class="notice">(*)</span>';
- } // END - if
-
- // Add it
- $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
- } // END - while
-
- // Free memory
- SQL_FREERESULT($result);
-
- // Return it
- return $content;
-}
-
// Checks wether the registration data is complete
function isRegistrationDataComplete () {
// Init elements
return loadTemplate('removeip_level', true, $message);
}
-// Filter for adding anonymity notice to the output stream
-function FILTER_ADD_ANONYMITY_NOTICE ($data) {
- // Init content
- $content = $data;
-
- // Extension removeip activated?
- if ((isExtensionActive('removeip')) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == 'Y')) {
- // Add anoymity/privacy infos
- $content['content'] .= addAnonymityLevel() . "<br />\n";
- } // END - if
-
- // Return it
- return $content;
-}
-
// [EOF]
?>
return $id;
}
-//-----------------------------------------------------------------------------
-// Only filter functions
-//-----------------------------------------------------------------------------
-
-// Filter for generic handling of theme change
-function FILTER_HANDLE_THEME_CHANGE () {
- // Check if new theme is selcted
- if ((isPostRequestParameterSet('new_theme')) && (postRequestParameter('new_theme') != getCurrentTheme())) {
- // Set new theme for guests
- $newTheme = postRequestParameter('new_theme');
-
- // Change to new theme
- setTheme($newTheme);
-
- // Remove current from array
- removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme()));
-
- // Add new theme
- addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme));
-
- // Redirect to same URL
- redirectToRequestUri();
- } // END - if
-}
-
-// Filter for settings theme from user profile, must be executed only if FILTER_FETCH_USER_DATA() ran before
-function FILTER_SET_USERS_THEME () {
- // Is the user data valid?
- if (!isMember()) {
- // Do only run for logged in members
- debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
- } // END - if
-
- // Change to new theme
- setTheme(getUserData('curr_theme'));
-}
-
// [EOF]
?>
die();
} // END - if
-// Filter for setting the timezone
-function FILTER_INIT_TIMEZONE () {
- // Just set it if the required function is there
- if (function_exists('date_default_timezone_set')) {
- // CFG: TIME-ZONE
- date_default_timezone_set(getConfig('timezone'));
- } // END - if
-}
-
// [EOF]
?>
$GLOBALS['page_footer'] .= loadTemplate('uberwach_snippet', true);
}
-// Filter for displaying uberwach snippet
-function FILTER_DISPLAY_UBERWACH_SNIPPET () {
- // Shall we include the uberwach snippet?
- if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- loadUberwachSnippet();
- } // END - if
-}
-
// [EOF]
?>