X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=6710c1c6f633069abf5d35c46e9c1a0361bc3cc5;hp=637424ef9dcd6b05d1ae0d09ca2f1b4fbd6fb10f;hb=ae80e170b5d25a4782af90a7c3d81fbb176fa293;hpb=4a829fe07793d2d3379d875efc8d045596ab8bc8
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index 637424ef9d..6710c1c6f6 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -101,7 +101,7 @@ function CHECK_MODULE($mod) {
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
// Check if cache is latest version
- $locked = 'Y'; $hidden = 'N'; $admin = 'N'; $mem = 'N'; $found = false;
+ $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (is_array($cacheArray['modules']['module']))) {
// Is the module cached?
if (isset($cacheArray['modules']['locked'][$mod_chk])) {
@@ -132,24 +132,24 @@ function CHECK_MODULE($mod) {
// Check returned values against current access permissions
//
// Admin access ----- Guest access ----- --- Guest or member? ---
- if ((IS_ADMIN()) || (($locked == 'N') && ($admin == 'N') && (($mem == 'N') || (IS_LOGGED_IN())))) {
+ if ((IS_ADMIN()) || (($locked == "N") && ($admin == "N") && (($mem == "N") || (IS_MEMBER())))) {
// If you are admin you are welcome for everything!
$ret = "done";
- } elseif ($locked == 'Y') {
+ } elseif ($locked == "Y") {
// Module is locked
$ret = "locked";
- } elseif (($mem == 'Y') && (!IS_LOGGED_IN())) {
+ } elseif (($mem == "Y") && (!IS_MEMBER())) {
// You have to login first!
$ret = "mem_only";
- } elseif (($admin == 'Y') && (!IS_ADMIN())) {
+ } elseif (($admin == "Y") && (!IS_ADMIN())) {
// Only the Admin is allowed to enter this module!
$ret = "admin_only";
}
// Still no luck or not found?
if (($ret == "major") || ($ret == "cache_miss") || (!$found)) {
- // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
- if ((file_exists(PATH."inc/modules/".$mod.".php")) || (file_exists(PATH.$mod.".php")) || (file_exists(PATH.$extension."/".$mod.".php"))) {
+ // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
+ if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", PATH, $extension, $mod)))) {
// Data is missing so we add it
if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
// Since 0.3.6 we have a has_menu column, this took me a half hour
@@ -168,13 +168,13 @@ function CHECK_MODULE($mod) {
if (SQL_AFFECTEDROWS() == 0) {
// Something bad happend!
return "major";
- }
+ } // END - if
// Destroy cache here
if (GET_EXT_VERSION("cache") >= "0.1.2") {
if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
unset($cacheArray['modules']);
- }
+ } // END - if
// And reload data
$ret = CHECK_MODULE($mod_chk);
@@ -182,7 +182,7 @@ function CHECK_MODULE($mod) {
// Module not found we don't add it to the database
$ret = "404";
}
- }
+ } // END - if
// Return the value
return $ret;
@@ -209,7 +209,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
$MOD_CHECK = $GLOBALS['module'];
break;
}
- $AND = " AND what=''";
+ $AND = " AND (what='' OR what IS NULL)";
} elseif (ereg("what-", $file)) {
// This is an admin what file!
$type = "what";
@@ -267,7 +267,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
if ($return) {
// Return title
return $ret;
- } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == 'Y')) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) {
+ } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) {
// Output HTML code
$OUT = $prefix."".$ret."\n";
//* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*
\n";
@@ -306,7 +306,7 @@ function ADD_MENU($MODE, $act, $wht) {
}
// Load SQL data and add the menu to the output stream...
- $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='' ".$AND." ORDER BY sort",
+ $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort",
array($MODE), __FILE__, __LINE__);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*
\n";
if (SQL_NUMROWS($result_main) > 0) {
@@ -330,7 +330,7 @@ function ADD_MENU($MODE, $act, $wht) {
// Full file name for checking menu
//* DEBUG: */ echo __LINE__.":!!!!".$sub_what."!!!
\n";
$test_inc = sprintf("%sinc/modules/%s/what-%s.php", PATH, $MODE, $sub_what);
- $test = (file_exists($test_inc) && is_readable($test_inc));
+ $test = (FILE_READABLE($test_inc));
if ($test) {
if ((!empty($wht)) && (($wht == $sub_what))) {
$content = "";
@@ -364,8 +364,8 @@ function ADD_MENU($MODE, $act, $wht) {
} else {
// This is a menu block... ;-)
$BLOCK_MODE = true;
- $INC_BLOCK = sprintf(PATH."inc/modules/%s/action-%s.php", $MODE, $main_action);
- if ((file_exists($INC_BLOCK)) && (is_readable($INC_BLOCK))) {
+ $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
+ if (FILE_READABLE($INC_BLOCK)) {
// Load include file
if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("