Extension ext-earning introduced (unfinished), renamings:
[mailer.git] / inc / mysql-manager.php
index 51fb3de99dcbfb4adc2dd805352f6d3091c57088..1a8ebe194ab92d561001406e4dd181168fe3f145 100644 (file)
@@ -46,7 +46,7 @@ function getTitleFromMenu ($mode, $what, $column = 'what', $ADD='') {
        // Fix empty 'what'
        if (empty($what)) {
                $what = getIndexHome();
-       } elseif ((isGetRequestParameterSet('action')) && ($column == 'what')) {
+       } elseif ((isGetRequestElementSet('action')) && ($column == 'what')) {
                // Get it from action
                return getTitleFromMenu($mode, getAction(), 'action', $ADD);
        } elseif ($what == 'overview') {
@@ -451,7 +451,10 @@ function fetchUserData ($value, $column = 'userid') {
        if (!isExtensionActive('user')) {
                // Absent ext-user is really not good
                return false;
-       } // END - if
+       } elseif (is_null($value)) {
+               // This shall never happen, so please report it
+               debug_report_bug(__FUNCTION__, __LINE__, 'value=NULL,column=' . $column . ' - value can never be NULL');
+       }
 
        // If we should look for userid secure&set it here
        if (substr($column, -2, 2) == 'id') {
@@ -630,7 +633,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        $OUT .= '      <option value="' . $content['value'] . '"';
-                       if (postRequestParameter('max_mails') == $content['value']) $OUT .= ' selected="selected"';
+                       if (postRequestElement('max_mails') == $content['value']) $OUT .= ' selected="selected"';
                        $OUT .= '>' . $content['value'] . ' {--PER_DAY--}';
                        if (!empty($content['comment'])) $OUT .= '(' . $content['comment'] . ')';
                        $OUT .= '</option>';
@@ -765,9 +768,9 @@ function getActionFromModuleWhat ($module, $what) {
 
        if ($module == 'admin') {
                // Action value for admin area
-               if (isGetRequestParameterSet('action')) {
+               if (isGetRequestElementSet('action')) {
                        // Use from request!
-                       return getRequestParameter('action');
+                       return getRequestElement('action');
                } elseif (isActionSet()) {
                        // Get it directly from URL
                        return getAction();
@@ -787,11 +790,16 @@ function getActionFromModuleWhat ($module, $what) {
                $module = mapModuleToTable($module);
 
                // Guest and member menu is 'main' as the default
-               if (empty($data['action'])) $data['action'] = 'main';
+               if (empty($data['action'])) {
+                       $data['action'] = 'main';
+               } // END - if
 
                // Load from database
                $result = SQL_QUERY_ESC("SELECT `action` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `what`='%s' LIMIT 1",
-                       array($module, $what), __FUNCTION__, __LINE__);
+                       array(
+                               $module,
+                               $what
+                       ), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load action value and pray that this one is the right you want... ;-)
                        $data = SQL_FETCHARRAY($result);
@@ -1216,7 +1224,7 @@ function getAdminDefaultAcl ($adminId) {
 }
 
 // Generates an option list from various parameters
-function generateOptionList ($table, $id, $name, $default = '', $special = '', $where = '', $disabled = array(), $callback = '') {
+function generateOptionList ($table, $id, $name, $default = '', $special = '', $whereStatement = '', $disabled = array(), $callback = '') {
        $ret = '';
        if ($table == '/ARRAY/') {
                // Selection from array
@@ -1253,7 +1261,7 @@ function generateOptionList ($table, $id, $name, $default = '', $special = '', $
                } // END - if
 
                // Query the database
-               $result = SQL_QUERY_ESC("SELECT `%s`,`%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$where." ORDER BY `%s` ASC",
+               $result = SQL_QUERY_ESC("SELECT `%s`,`%s`".$SPEC." FROM `{?_MYSQL_PREFIX?}_%s` ".$whereStatement." ORDER BY `%s` ASC",
                        array(
                                $id,
                                $name,
@@ -1372,9 +1380,9 @@ LIMIT 1",
 // Gets the matching what name from module
 function getWhatFromModule ($modCheck) {
        // Is the request element set?
-       if (isGetRequestParameterSet('what')) {
+       if (isGetRequestElementSet('what')) {
                // Then return this!
-               return getRequestParameter('what');
+               return getRequestElement('what');
        } // END - if
 
        // Default is empty