From 968aefff7fdc8598d568c6dcce099f095dbc9162 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Mar 2009 18:12:09 +0000 Subject: [PATCH] Fix for 'no admin assigned' bug. Resolves #108 --- inc/config.php | 22 +++++++++++----------- inc/functions.php | 2 +- inc/libs/admins_functions.php | 10 ++++------ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/inc/config.php b/inc/config.php index 5f54475e2f..1e15553ff1 100644 --- a/inc/config.php +++ b/inc/config.php @@ -79,10 +79,10 @@ define('WRITE_FOOTER', true); define('OUTPUT_MODE', "render"); // CFG: MAIN_TITLE -define('MAIN_TITLE', "Your mail-exchanger title"); +define('MAIN_TITLE', "Firebox-Tauscher"); // CFG: SLOGAN -define('SLOGAN', "Your cool slogan here"); +define('SLOGAN', "Development-Mailer zum Testen"); // Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!) $URL = "http://".getenv('SERVER_NAME') . str_replace("\\", "/", dirname($_SERVER['PHP_SELF'])); @@ -96,19 +96,19 @@ define('URL', $URL); define('PATH', $PATH); // CFG: WEBMASTER -define('WEBMASTER', "you@some-hoster.tld.invalid"); +define('WEBMASTER', "quix0r@firebox.lan"); // CFG: INSTALLED -define('mxchange_installed', false); +define('mxchange_installed', true); // CFG: ADMIN-SETUP -define('admin_registered', false); +define('admin_registered', true); // CFG: FRAMESET define('frameset_active', false); // CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!) -define('DEBUG_MODE', false); +define('DEBUG_MODE', true); // CFG: DEBUG-MAIL (turn this on if you need to debug mails, only affects if DEBUG_MODE is true) //define('DEBUG_MAIL', true); @@ -130,18 +130,18 @@ $MySQL = array( // CFG: MYSQL-HOST 'host' => "localhost", // CFG: MYSQL-DBASE - 'dbase' => "db", + 'dbase' => "mxchange", // CFG: MYSQL-LOGIN - 'login' => "user", + 'login' => "root", // CFG: MYSQL-PASSWORD - 'password' => "pass", + 'password' => "ab57dk90", ); // CFG: MYSQL-PREIFX define('_MYSQL_PREFIX', "mxchange"); // CFG: TABLE-TYPE -define('_TABLE_TYPE', "MyISAM"); +define('_TABLE_TYPE', "InnoDB"); // CFG: DATABASE-TYPE define('_DB_TYPE', "mysql3"); @@ -154,7 +154,7 @@ define('LEAD_EXPIRY_TIME' , (30*24*60*60)); // == 30 days // CFG: SMTP-HOSTNAME define('SMTP_HOSTNAME', ""); // CFG: SMTP-USER -define('SMTP_USER' , ""); +define('SMTP_USER', ""); // CFG: SMTP-PASSWORD define('SMTP_PASSWORD', ""); diff --git a/inc/functions.php b/inc/functions.php index 98eddd5d9b..7d3046be59 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2695,7 +2695,7 @@ function GENERATE_AID_LINK ($aid) { $admin = "{--ADMIN_NO_ADMIN_ASSIGNED--}"; // Zero? = Not assigned - if ($aid == "0") { + if ($aid > 0) { // Load admin's login $login = GET_ADMIN_LOGIN($aid); if ($login != "***") { diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 291df01923..09338f4072 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -130,16 +130,14 @@ function ADMINS_CHECK_ACL($act, $wht) { // Create email link to admins's account function ADMINS_CREATE_EMAIL_LINK ($email, $mod="admin") { - $locked = " AND `status`='CONFIRMED'"; - if (IS_ADMIN()) $locked = ""; if (strpos("@", $email) > 0) { // Create email link $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` -WHERE email='%s'".$locked." LIMIT 1", - array($email), __FUNCTION__, __LINE__); +WHERE email='%s' LIMIT 1", + array($email), __FUNCTION__, __LINE__); - // Is there an entry? + // Is there an entry? if (SQL_NUMROWS($result) == 1) { // Load userid list($uid) = SQL_FETCHROW($result); @@ -150,7 +148,7 @@ WHERE email='%s'".$locked." LIMIT 1", // Free memory SQL_FREERESULT($result); - } elseif (bigintval($email) > 0) { + } elseif ((is_int($email)) && ($email > 0)) { // Direct ID given $email = "{!URL!}/modules.php?module=".$mod."&what=admins_contct&admin=".bigintval($email); } -- 2.39.5