From: Roland Häder Date: Mon, 3 Nov 2008 22:25:45 +0000 (+0000) Subject: Fixed different results in admin overview page and inactivity list X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=59949615f7fc6926f07fe65f9dac9436d124b40e Fixed different results in admin overview page and inactivity list --- diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index b1d5bc92f8..eb72904f37 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -47,12 +47,17 @@ if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { if ($_CONFIG['autopurge_inactive'] == "Y") { // Ok, let's have a look... $since = bigintval($_CONFIG['ap_inactive_since']); - $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']; + + // Init exclusion list + $EXCLUDE_LIST = ""; + if ($_CONFIG['def_refid'] > 0) { + $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']; + } // END - if // Check for more extensions - if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != c.beg_uid"; - if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid"; - if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid"; + if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; + if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; + if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; // Check for new holiday extension if (GET_EXT_VERSION("holiday") >= "0.1.3") { diff --git a/inc/databases.php b/inc/databases.php index e7a61f00a7..8ac9e4a1c6 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "523"); +define('CURR_SVN_REVISION', "524"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index c5d0db38d4..e83bb3d1b9 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -183,8 +183,8 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) { if (!empty($POST['pass1'][$id])) $ADD = sprintf(", password='%s'", SQL_ESCAPE($hash)); // Get admin's ID - $salt = substr(GET_ADMIN_HASH(get_session('admin_login')), 0, -40); $aid = GET_ADMIN_ID(get_session('admin_login')); + $salt = substr(GET_ADMIN_HASH($aid), 0, -40); // Rewrite cookie when it's own account if ($aid == $id) { diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 2b34fa214c..4cdc14b83f 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -273,7 +273,10 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) if (EXT_IS_ACTIVE("autopurge")) { // Start finding them... $since = $_CONFIG['ap_inactive_since']; - $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'].""; + $EXCLUDE_LIST = ""; + if ($_CONFIG['def_refid'] > 0) { + $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'].""; + } // END - if // Check for more extensions if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; @@ -284,7 +287,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) // Check for all accounts $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online FROM "._MYSQL_PREFIX."_user_data AS d -WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < ".$since." AND d.ap_notified < ".$since." +WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND d.ap_notified < (UNIX_TIMESTAMP() - ".$since.") ".$EXCLUDE_LIST." ORDER BY d.userid"; $WHATs[] = "list_autopurge"; diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index 569b20fb2f..3194b4c973 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -47,9 +47,10 @@ if ($_CONFIG['def_refid'] > 0) { } // END - if // Check for more extensions -if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != c.beg_uid"; -if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid"; -if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid"; +if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; +if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; +if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; +if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'"; // Check for all accounts $result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php index 44f34e52ad..d6c7c10813 100644 --- a/inc/modules/admin/what-overview.php +++ b/inc/modules/admin/what-overview.php @@ -47,8 +47,7 @@ $JOBS_DONE = true; $taskExt = false; // Default is that "task" is not installed // When the admin is logging in check several things first (new jobs to complete and so on) -if ($GLOBALS['action'] == "login") -{ +if ($GLOBALS['action'] == "login") { if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) { // When task extension is registered output advanced overview page $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task' @@ -57,7 +56,7 @@ if ($GLOBALS['action'] == "login") // Output standart overview (provided by overview-inc.php) $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks); } -} +} // END - if // Are there jobs to be done? if ($JOBS_DONE) {