From 65662f1e3a5d984fb918c8eff0ecc8b5f51790b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 26 Mar 2009 07:26:59 +0000 Subject: [PATCH] Moved and fixed typo in REDIRECT_ON_UNINSTALLED_EXTENSION() --- inc/extensions.php | 9 +++++++++ inc/functions.php | 10 ---------- mailid_top.php | 5 +---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/inc/extensions.php b/inc/extensions.php index 2f89c57450..8f1e65b4ab 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -1236,5 +1236,14 @@ function EXT_GET_REMOVAL_LIST () { return $GLOBALS['ext_update_remove']; } +// Redirects if the provided extension is not installed +function REDIRECT_ON_UNINSTALLED_EXTENSION ($ext_name) { + // So is the extension there? + if (!EXT_IS_ACTIVE($ext_name)) { + // Redirect to index + LOAD_URL('modules.php?module=index&msg=' . getCode('EXTENSION_PROBLEM') . '&ext=' . $ext_name); + } // END - if +} + // ?> diff --git a/inc/functions.php b/inc/functions.php index 8c8d7e15bd..d96e2dbf60 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2826,16 +2826,6 @@ function convertCodeToMessage ($code) { return $msg; } -// Checks wether the given extension is currently not installed -// and redirects if so. -function REDIRCT_ON_UNINSTALLED_EXTENSION ($ext_name) { - // Is the extension uninstalled/inactive? - if (!EXT_IS_ACTIVE($ext_name)) { - // Redirect to index - LOAD_URL('modules.php?module=index&msg=' . getCode('EXTENSION_PROBLEM') . '&ext=' . $ext_name); - } // END - if -} - // Generate a "link" for the given admin id (aid) function GENERATE_AID_LINK ($aid) { // No assigned admin is default diff --git a/mailid_top.php b/mailid_top.php index 04f65fbea7..7e4f9a2f40 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -52,10 +52,7 @@ require('inc/config.php'); if (isInstalled()) { // Is the extension active - if (!EXT_IS_ACTIVE('mailid', true)) { - // Is not activated/installed yet! - addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'mailid'); - } // END - if + REDIRECT_ON_UNINSTALLED_EXTENSION('mailid'); // Secure all data $url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = ''; -- 2.39.5