X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmysql-manager.php;h=9503fff2fa96259510081d2eaa9c8c41743f6447;hb=967519f98dcf3593e979c31f3abd786e46cb43fc;hp=e6ca6a716590466ea16047e4e1bcef7d4be46894;hpb=e1d33257604fcaf38844ed2b1b1dbf79d7a6159e;p=mailer.git diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index e6ca6a7165..9503fff2fa 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1,7 +1,7 @@ {--MYDATA_MAIL_SENT--}"; - break; - - default: // Unsupported module! - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod)); - $content = "{--UNKNOWN_MODULE--}"; - break; - } // END - switch - } else { - // Could not load profile data - $content = "{--MEMBER_CANNOT_LOAD_PROFILE--}"; - } - } else { - // Passwords mismatch - $content = "{--MEMBER_PASSWORD_ERROR--}"; - } - } else { - // Could not load profile - $content = "{--MEMBER_CANNOT_LOAD_PROFILE--}"; - } - - // Send email to user if required - if ((!empty($sub_mem)) && (!empty($message))) { - // Send member mail - sendEmail($content['email'], $sub_mem, $message); - } // END - if - - // Send only if no other error has occured - if (empty($content)) { - if ((!empty($sub_adm)) && (!empty($message_admin))) { - // Send admin mail - sendAdminNotification($sub_adm, $message_admin, $content, getMemberId()); - } elseif (getConfig('admin_notify') == 'Y') { - // Cannot send mails to admin! - $content = getMessage('CANNOT_SEND_ADMIN_MAILS'); - } else { - // No mail to admin - $content = "{--MYDATA_MAIL_SENT--}"; - } - } // END - if - - // Load template - loadTemplate('admin_settings_saved', false, $content); -} - // Get action value from mode (admin/guest/member) and what-value function getModeAction ($mode, $what) { // Init status @@ -1024,9 +905,14 @@ function getModeAction ($mode, $what) { //* DEBUG: */ print(__LINE__.'='.$mode.'/'.$what.'/'.getAction()."=
"); if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) { // sql_patches is missing so choose depending on mode - if ($mode == 'admin') { + if (isWhatSet()) { + // Use setted what + $what = getWhat(); + } elseif ($mode == 'admin') { + // Admin area $what = 'overview'; } else { + // Everywhere else $what = 'welcome'; } } elseif ((empty($what)) && ($mode != 'admin')) { @@ -1070,7 +956,7 @@ function getModeAction ($mode, $what) { // Free memory SQL_FREERESULT($result); - } elseif ((!isExtensionInstalled('sql_patches')) && ($mode != 'admin')) { + } elseif ((!isExtensionInstalled('sql_patches')) && (($mode != 'admin') && ($mode != 'unknown'))) { // No sql_patches installed, but maybe we need to register an admin? if (isAdminRegistered()) { // Redirect to admin area @@ -1666,13 +1552,11 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher } else { // Data from database $SPEC = ', `' . $id . '`'; - if (!empty($special)) $SPEC = ', ' . $special; - $ORDER = $name . $SPEC; - if ($table == 'country') $ORDER = $special; + if (!empty($special)) $SPEC = ', `' . $special . '`'; // Query the database - $result = SQL_QUERY_ESC("SELECT `%s`, `%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY %s", - array($id, $ORDER, $table, $name), __FUNCTION__, __LINE__); + $result = SQL_QUERY_ESC("SELECT `%s`, `%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY `%s` ASC", + array($id, $name, $table, $name), __FUNCTION__, __LINE__); // Do we have rows? if (SQL_NUMROWS($result) > 0) {