]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Bad things are now 'classified' as bad (CSS class 'bad' is being used instead of...
[mailer.git] / inc / modules / admin / admin-inc.php
index 308939d9b888cb1eef89341830a6bf9d0bbe6ccc..fb70b05816708e712cf0e756b55367677d6e2d7f 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -296,7 +296,7 @@ ORDER BY
                                                $OUT .= '[<a href="{%url=modules.php?module=admin&amp;action=' . $menu . '%}">';
                                        }
                                } else {
-                                       $OUT .= '<em style="cursor:help" class="notice" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $menu . '%}">';
+                                       $OUT .= '<em style="cursor:help" class="bad" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $menu . '%}">';
                                }
 
                                $OUT .= $title;
@@ -359,7 +359,7 @@ ORDER BY
                                                                        $OUT .= '[<a href="{%url=modules.php?module=admin&amp;what=' . $what_sub . '%}">';
                                                                }
                                                        } else {
-                                                               $OUT .= '<em style="cursor:help" class="notice" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $what_sub . '%}">';
+                                                               $OUT .= '<em style="cursor:help" class="bad" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $what_sub . '%}">';
                                                        }
 
                                                        $OUT .= $title_what;
@@ -389,7 +389,7 @@ ORDER BY
                // Free memory
                SQL_FREERESULT($result_main);
                $OUT .= '</ul>';
-       }
+       } // END - if
 
        // Is there a cache instance again?
        // Return or output content?
@@ -400,21 +400,68 @@ ORDER BY
        }
 }
 
-// Create member selection box
-function addMemberSelectionBox ($def = 0, $add_all = false, $return = false, $none = false, $field = 'userid') {
+// Create an admin selection box form
+function addAdminSelectionBox ($adminId = NULL, $special = '') {
+       // Default is email as "special column"
+       $ADD = ',`email` AS `special`';
+
+       // Is a special column given?
+       if (!empty($special)) {
+               // Additional column for SQL query
+               $ADD = ',`' . $special . '` AS `special`';
+       } // END - if
+
+       // Query all entries
+       $result = SQL_QUERY('SELECT
+       `id`,`login`' . $ADD . '
+FROM
+       `{?_MYSQL_PREFIX?}_admins`
+ORDER BY
+       `login` ASC', __FUNCTION__, __LINE__);
+
+       // Init output
+       $OUT = '';
+
+       // Load all entries
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Add the entry
+               $OUT .= loadTemplate('select_admins_option', true, $content);
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Add form to content
+       $content['form_selection'] = $OUT;
+
+       // Output form
+       loadTemplate('select_admins_box', false, $content);
+}
+
+// Create a member selection box
+function addMemberSelectionBox ($userid = NULL, $add_all = false, $return = false, $none = false, $field = 'userid') {
        // Output selection form with all confirmed user accounts listed
-       $result = SQL_QUERY("SELECT `userid`,`surname`,`family` FROM `{?_MYSQL_PREFIX?}_user_data` ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY('SELECT
+       `userid`,`surname`,`family`
+FROM
+       `{?_MYSQL_PREFIX?}_user_data`
+ORDER BY
+       `userid` ASC', __FUNCTION__, __LINE__);
 
        // Default output
        $OUT = '';
 
        // USe this only for adding points (e.g. adding refs really makes no sence ;-) )
-       if ($add_all === true)   $OUT = '      <option value="all">{--ALL_MEMBERS--}</option>';
-        elseif ($none === true) $OUT = '      <option value="0">{--SELECT_NONE--}</option>';
+       if ($add_all === true) {
+               $OUT = '      <option value="all">{--ALL_MEMBERS--}</option>';
+       } elseif ($none === true) {
+               $OUT = '      <option value="0">{--SELECT_NONE--}</option>';
+       }
 
+       // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
                $OUT .= '<option value="' . bigintval($content['userid']) . '"';
-               if ($def == $content['userid']) $OUT .= ' selected="selected"';
+               if ($userid == $content['userid']) $OUT .= ' selected="selected"';
                $OUT .= '>' . $content['surname'] . ' ' . $content['family'] . ' (' . bigintval($content['userid']) . ')</option>';
        } // END - while
 
@@ -424,7 +471,7 @@ function addMemberSelectionBox ($def = 0, $add_all = false, $return = false, $no
        if ($return === false) {
                // Remeber options in constant
                $content['form_selection'] = $OUT;
-               $content['what']             = getWhat();
+               $content['what']           = '{%pipe,getWhat%}';
 
                // Load template
                loadTemplate('admin_form_selection_box', false, $content);
@@ -594,7 +641,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
        // Walk through all files
        foreach ($menuArray as $file) {
                // Is this a PHP script?
-               if ((!isDirectory($file)) && (strpos($file, '' . $type . '-') > -1) && (strpos($file, '.php') > 0)) {
+               if ((!isDirectory($file)) && (isInString('' . $type . '-', $file)) && (isInString('.php', $file))) {
                        // Then test if the file is readable
                        $test = sprintf("inc/modules/%s/%s", $menu, $file);
 
@@ -771,7 +818,7 @@ function sendAdminBuildMails ($mode, $tableName, $content, $id, $subjectPart = '
        } // END - if
 
        // Is the raw userid set?
-       if (postRequestParameter($userIdColumn[0], $id) > 0) {
+       if (postRequestElement($userIdColumn[0], $id) > 0) {
                // Load email template
                if (!empty($subjectPart)) {
                        $mail = loadEmailTemplate('member_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content);
@@ -780,7 +827,7 @@ function sendAdminBuildMails ($mode, $tableName, $content, $id, $subjectPart = '
                }
 
                // Send email out
-               sendEmail(postRequestParameter($userIdColumn[0], $id), strtoupper('{--MEMBER_' . $subject . '_' . $tableName[0] . '_SUBJECT--}'), $mail);
+               sendEmail(postRequestElement($userIdColumn[0], $id), strtoupper('{--MEMBER_' . $subject . '_' . $tableName[0] . '_SUBJECT--}'), $mail);
        } // END - if
 
        // Generate subject
@@ -788,9 +835,9 @@ function sendAdminBuildMails ($mode, $tableName, $content, $id, $subjectPart = '
 
        // Send admin notification out
        if (!empty($subjectPart)) {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content, postRequestParameter($userIdColumn[0], $id));
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
        } else {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . $tableName[0], $content, postRequestParameter($userIdColumn[0], $id));
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . $tableName[0], $content, postRequestElement($userIdColumn[0], $id));
        }
 }
 
@@ -813,7 +860,7 @@ function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $e
 
        // "Walk" through all entries
        //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'listType=<pre>'.print_r($listType,true).'</pre>,tableName<pre>'.print_r($tableName,true).'</pre>,columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,idColumn=<pre>'.print_r($idColumn,true).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,true).'</pre>,rawUserId=<pre>'.print_r($rawUserId,true).'</pre>');
-       foreach (postRequestParameter($idColumn[0]) as $id => $selected) {
+       foreach (postRequestElement($idColumn[0]) as $id => $selected) {
                // Secure id number
                $id = bigintval($id);
 
@@ -828,14 +875,21 @@ function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $e
                        // Filter all data
                        foreach ($content as $key => $value) {
                                // Search index
-                               $idx = array_search($key, $columns, true);
+                               $idx = searchXmlArray($key, $columns, 'column');
+
+                               // Skip any missing entries
+                               if ($idx === false) {
+                                       // Skip this one
+                                       //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ' - SKIPPED!');
+                                       continue;
+                               } // END - if
 
                                // Do we have a userid?
                                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
                                if ($key == $userIdColumn[0]) {
                                        // Add it again as raw id
                                        //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
-                                       $content[$userIdColumn[0]] = bigintval($value);
+                                       $content[$userIdColumn[0]] = makeZeroToNull($value);
                                        $content[$userIdColumn[0] . '_raw'] = $content[$userIdColumn[0]];
                                } // END - if
 
@@ -846,13 +900,24 @@ function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $e
                                        $GLOBALS['admin_list_builder_id_value'] = $value;
                                } // END - if
 
-                               // Handle the call in external function
-                               //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
-                               $content[$key] = handleExtraValues(
-                                       $filterFunctions[$idx],
-                                       $value,
-                                       $extraValues[$idx]
-                               );
+                               // Do we have a call-back function and extra-value pair?
+                               if ((isset($filterFunctions[$idx])) && (isset($extraValues[$idx]))) {
+                                       // Handle the call in external function
+                                       //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
+                                       $content[$key] = handleExtraValues(
+                                               $filterFunctions[$idx],
+                                               $value,
+                                               $extraValues[$idx]
+                                       );
+                               } elseif ((isset($columns[$idx]['name'])) && (isset($filterFunctions[$columns[$idx]['name']])) && (isset($extraValues[$columns[$idx]['name']]))) {
+                                       // Handle the call in external function
+                                       //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$columns[$idx]['name']] . ',value=' . $value);
+                                       $content[$key] = handleExtraValues(
+                                               $filterFunctions[$columns[$idx]['name']],
+                                               $value,
+                                               $extraValues[$columns[$idx]['name']]
+                                       );
+                               }
                        } // END - foreach
 
                        // Then list it
@@ -892,7 +957,7 @@ function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunction
        // All valid entries? (We hope so here!)
        if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && (count($statusArray) > 0)) {
                // "Walk" through all entries
-               foreach (postRequestParameter($idColumn[0]) as $id => $sel) {
+               foreach (postRequestElement($idColumn[0]) as $id => $sel) {
                        // Construct SQL query
                        $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}_%s` SET", SQL_ESCAPE($tableName[0]));
 
@@ -1006,9 +1071,9 @@ function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunct
 
                        // Delete them all
                        $idList = '';
-                       foreach (postRequestParameter($idColumn[0]) as $id => $sel) {
+                       foreach (postRequestElement($idColumn[0]) as $id => $sel) {
                                // Is there a userid?
-                               if (isPostRequestParameterSet($rawUserId[0], $id)) {
+                               if (isPostRequestElementSet($rawUserId[0], $id)) {
                                        // Load all data from that id
                                        $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
                                                array(
@@ -1035,12 +1100,12 @@ function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunct
                        SQL_QUERY_ESC($sql, array($tableName[0], $idColumn[0], substr($idList, 0, -1)), __FUNCTION__, __LINE__);
 
                        // Was this fine?
-                       if (SQL_AFFECTEDROWS() == count(postRequestParameter($idColumn[0]))) {
+                       if (SQL_AFFECTEDROWS() == count(postRequestElement($idColumn[0]))) {
                                // All deleted
                                displayMessage('{--ADMIN_ALL_ENTRIES_REMOVED--}');
                        } else {
                                // Some are still there :(
-                               displayMessage(sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_DELETED'), SQL_AFFECTEDROWS(), count(postRequestParameter($idColumn[0]))));
+                               displayMessage(sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_DELETED'), SQL_AFFECTEDROWS(), count(postRequestElement($idColumn[0]))));
                        }
                } else {
                        // List for deletion confirmation
@@ -1068,12 +1133,13 @@ function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctio
 
        // All valid entries? (We hope so here!)
        //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'idColumn=<pre>'.print_r($idColumn,true).'</pre>,tableName<pre>'.print_r($tableName,true).'</pre>,columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,editNow=<pre>'.print_r($editNow,true).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,true).'</pre>,rawUserId=<pre>'.print_r($rawUserId,true).'</pre>');
-       if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+       //if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+       if (true) {
                // Shall we change here or list for editing?
                if ($editNow[0] === true) {
                        // Change them all
                        $affected = '0';
-                       foreach (postRequestParameter($idColumn[0]) as $id => $sel) {
+                       foreach (postRequestElement($idColumn[0]) as $id => $sel) {
                                // Prepare content array (new values)
                                $content = array();
 
@@ -1144,12 +1210,12 @@ function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctio
                        } // END - foreach
 
                        // Was this fine?
-                       if ($affected == count(postRequestParameter($idColumn[0]))) {
+                       if ($affected == count(postRequestElement($idColumn[0]))) {
                                // All deleted
                                displayMessage('{--ADMIN_ALL_ENTRIES_EDITED--}');
                        } else {
                                // Some are still there :(
-                               displayMessage(sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_EDITED'), $affected, count(postRequestParameter($idColumn[0]))));
+                               displayMessage(sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_EDITED'), $affected, count(postRequestElement($idColumn[0]))));
                        }
                } else {
                        // List for editing
@@ -1232,10 +1298,10 @@ function adminAddEntries ($tableName, $columns = array(), $filterFunctions = arr
        $sqlValues  = array();
 
        // Add columns and values
-       foreach ($columns as $key=>$columnName) {
+       foreach ($columns as $key => $columnName) {
                // Copy entry to final arrays
                $sqlColumns[$key] = $columnName;
-               $sqlValues[$key]  = postRequestParameter($columnName);
+               $sqlValues[$key]  = postRequestElement($columnName);
                //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key='.$key.',columnName='.$columnName.',filterFunctions='.$filterFunctions[$key].',extraValues='.intval(isset($extraValues[$key])).',extraValuesName='.intval(isset($extraValues[$columnName . '_list'])).'<br />');
 
                // Send data through the filter function if found
@@ -1246,7 +1312,7 @@ function adminAddEntries ($tableName, $columns = array(), $filterFunctions = arr
        } // END - foreach
 
        // Build the SQL query
-       $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`, `', $sqlColumns) . "`) VALUES('" . implode("','", $sqlValues) . "')";
+       $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES ('" . implode("','", $sqlValues) . "')";
 
        // Run the SQL query
        SQL_QUERY($SQL, __FUNCTION__, __LINE__);
@@ -1274,30 +1340,12 @@ function adminListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tab
 
        // This is the minimum query, so at least columns and tableName must have entries
        $SQL = 'SELECT ';
-       foreach ($columns as $columnArray) {
-               // Init SQL part
-               $sqlPart = '';
-               // Do we have a table/alias
-               if (!empty($columnArray['table'])) {
-                       // Pre-add it
-                       $sqlPart .= $columnArray['table'] . '.';
-               } // END - if
 
-               // Add column
-               $sqlPart .= '`' . $columnArray['column'] . '`';
-
-               // Is a function and alias set?
-               if ((!empty($columnArray['function'])) && (!empty($columnArray['alias']))) {
-                       // Add both
-                       $sqlPart = $columnArray['function'] . '(' . $sqlPart . ') AS `' . $columnArray['alias'] . '`';
-               } // END - if
-
-               // Add finished SQL part to the query
-               $SQL .= $sqlPart . ',';
-       } // END - foreach
+       // Get the sql part back from given array
+       $SQL .= getSqlPartFromXmlArray($columns);
 
        // Remove last commata and add FROM statement
-       $SQL = substr($SQL, 0, -1) . ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
+       $SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
 
        // Do we have entries from whereColumns to add?
        if (count($whereColumns) > 0) {
@@ -1324,7 +1372,7 @@ function adminListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tab
        if (count($orderByColumns) > 0) {
                // Add them as well
                $SQL .= ' ORDER BY ';
-               foreach ($orderByColumns as $orderByColumn=>$array) {
+               foreach ($orderByColumns as $orderByColumn => $array) {
                        // Get keys (table/alias) and values (sorting itself)
                        $table   = trim(implode('', array_keys($array)));
                        $sorting = trim(implode('', array_keys($array)));
@@ -1358,7 +1406,7 @@ function doAdminListEntries ($SQL, $tableTemplate, $noEntryMessageId, $rowTempla
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        // "Translate" content
-                       foreach ($callbackColumns as $columnName=>$callbackFunction) {
+                       foreach ($callbackColumns as $columnName => $callbackFunction) {
                                // Fill the callback arguments
                                $args = array($content[$columnName]);
 
@@ -1389,7 +1437,7 @@ function doAdminListEntries ($SQL, $tableTemplate, $noEntryMessageId, $rowTempla
        SQL_FREERESULT($result);
 }
 
-// Checks proxy settins by fetching check-updates3.php from www.mxchange.org
+// Checks proxy settins by fetching check-updates3.php from mxchange.org
 function adminTestProxySettings ($settingsArray) {
        // Set temporary the new settings
        mergeConfig($settingsArray);
@@ -1398,7 +1446,7 @@ function adminTestProxySettings ($settingsArray) {
        $content = sendGetRequest('check-updates3.php');
 
        // Is the first line with "200 OK"?
-       $valid = (strpos($content[0], '200 OK') !== false);
+       $valid = isInString('200 OK', $content[0]);
 
        // Return result
        return $valid;
@@ -1426,7 +1474,7 @@ function sendAdminPasswordResetLink ($email) {
        SQL_FREERESULT($result);
 
        // Generate hash for reset link
-       $content['hash'] = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $content['login'] . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
+       $content['hash'] = generateHash(getUrl() . getEncryptSeparator() . $content['id'] . getEncryptSeparator() . $content['login'] . getEncryptSeparator() . $content['password'], substr($content['password'], getSaltLength()));
 
        // Remove some data
        unset($content['id']);
@@ -1457,7 +1505,7 @@ function adminResetValidateHashLogin ($hash, $login) {
                $content = SQL_FETCHARRAY($result);
 
                // Generate hash again
-               $hashFromData = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $login . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
+               $hashFromData = generateHash(getUrl() . getEncryptSeparator() . $content['id'] . getEncryptSeparator() . $login . getEncryptSeparator() . $content['password'], substr($content['password'], getSaltLength()));
 
                // Does both match?
                $valid = ($hash == $hashFromData);
@@ -1582,7 +1630,7 @@ function generateAdminLink ($adminId) {
                        }
                } else {
                        // Maybe deleted?
-                       $adminLink = '<div class="notice">{%message,ADMIN_ID_404=' . $adminId . '%}</div>';
+                       $adminLink = '<div class="bad">{%message,ADMIN_ID_404=' . $adminId . '%}</div>';
                }
        } // END - if
 
@@ -1614,7 +1662,7 @@ function doVerifyExpertSettings () {
                                // Ask for them
                                if (isFormSent()) {
                                        // Is the element set, then we need to change the admin
-                                       if (isPostRequestParameterSet('expert_settings')) {
+                                       if (isPostRequestElementSet('expert_settings')) {
                                                // Get it and prepare final post data array
                                                $postData['login'][getCurrentAdminId()] = getCurrentAdminLogin();
                                                $postData['expert_warning'][getCurrentAdminId()] = 'N';
@@ -1623,7 +1671,7 @@ function doVerifyExpertSettings () {
                                                adminsChangeAdminAccount($postData, 'expert_warning');
 
                                                // Clear form
-                                               unsetPostRequestParameter('ok');
+                                               unsetPostRequestElement('ok');
                                        } // END - if
 
                                        // All fine!
@@ -1689,7 +1737,7 @@ function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=f
        $NAV = '';
        for ($page = 1; $page <= $numPages; $page++) {
                // Is the page currently selected or shall we generate a link to it?
-               if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+               if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
                        // Is currently selected, so only highlight it
                        $NAV .= '<strong>-';
                } else {
@@ -1697,13 +1745,13 @@ function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=f
                        $NAV .= '<a href="{%url=modules.php?module=admin&amp;what=' . getWhat() . '&amp;page=' . $page . '&amp;offset=' . $offset;
 
                        // Add userid when we shall show all mails from a single member
-                       if ((isGetRequestParameterSet('userid')) && (isValidUserId(getRequestParameter('userid')))) $NAV .= '&amp;userid=' . bigintval(getRequestParameter('userid'));
+                       if ((isGetRequestElementSet('userid')) && (isValidUserId(getRequestElement('userid')))) $NAV .= '&amp;userid=' . bigintval(getRequestElement('userid'));
 
                        // Close open anchor tag
                        $NAV .= '%}">';
                }
                $NAV .= $page;
-               if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+               if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
                        // Is currently selected, so only highlight it
                        $NAV .= '-</strong>';
                } else {
@@ -1711,7 +1759,7 @@ function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=f
                        $NAV .= '</a>';
                }
 
-               // Add seperator if we have not yet reached total pages
+               // Add separator if we have not yet reached total pages
                if ($page < $numPages) {
                        // Add it
                        $NAV .= '|';
@@ -1738,7 +1786,7 @@ function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=f
 // Process menu editing form
 function adminProcessMenuEditForm ($type, $subMenu) {
        // An action is done...
-       foreach (postRequestParameter('sel') as $sel => $menu) {
+       foreach (postRequestElement('sel') as $sel => $menu) {
                $AND = "(`what` = '' OR `what` IS NULL)";
 
                $sel = bigintval($sel);
@@ -1747,25 +1795,25 @@ function adminProcessMenuEditForm ($type, $subMenu) {
                        $AND = "`action`='" . $subMenu . "'";
                } // END - if
 
-               switch (postRequestParameter('ok')) {
+               switch (postRequestElement('ok')) {
                        case 'edit': // Edit menu
-                               if (postRequestParameter('sel_what', $sel) == '') {
+                               if (postRequestElement('sel_what', $sel) == '') {
                                        // Update with 'what'=null
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`=NULL WHERE ".$AND." AND `id`=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s',`action`='%s',`what`=NULL WHERE ".$AND." AND `id`=%s LIMIT 1",
                                                array(
                                                        $type,
                                                        $menu,
-                                                       postRequestParameter('sel_action', $sel),
+                                                       postRequestElement('sel_action', $sel),
                                                        $sel
                                                ), __FILE__, __LINE__);
                                } else {
                                        // Update with selected 'what'
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s',`action`='%s',`what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
                                                array(
                                                        $type,
                                                        $menu,
-                                                       postRequestParameter('sel_action', $sel),
-                                                       postRequestParameter('sel_what', $sel),
+                                                       postRequestElement('sel_action', $sel),
+                                                       postRequestElement('sel_what', $sel),
                                                        $sel
                                                ), __FILE__, __LINE__);
                                }
@@ -1777,13 +1825,13 @@ function adminProcessMenuEditForm ($type, $subMenu) {
                                break;
 
                        case 'status': // Change status of menus
-                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
-                                       array($type, postRequestParameter('visible', $sel), postRequestParameter('locked', $sel), $sel), __FILE__, __LINE__);
+                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `visible`='%s',`locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+                                       array($type, postRequestElement('visible', $sel), postRequestElement('locked', $sel), $sel), __FILE__, __LINE__);
                                break;
 
                        default: // Unexpected action
-                               logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
-                               displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestParameter('ok') . '%}');
+                               logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+                               displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
                                break;
                } // END - switch
        } // END - foreach
@@ -1795,26 +1843,26 @@ function adminProcessMenuEditForm ($type, $subMenu) {
 // Handle weightning
 function doAdminProcessMenuWeightning ($type, $AND) {
        // Are there all required (generalized) GET parameter?
-       if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
+       if ((isGetRequestElementSet('act')) && (isGetRequestElementSet('tid')) && (isGetRequestElementSet('fid'))) {
                // Init variables
                $tid = ''; $fid = '';
 
                // Get ids
-               if (isGetRequestParameterSet('w')) {
+               if (isGetRequestElementSet('w')) {
                        // Sub menus selected
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
                                array(
                                        $type,
-                                       getRequestParameter('act'),
-                                       bigintval(getRequestParameter('tid'))
+                                       getRequestElement('act'),
+                                       bigintval(getRequestElement('tid'))
                                ), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
                                array(
                                        $type,
-                                       getRequestParameter('act'),
-                                       bigintval(getRequestParameter('fid'))
+                                       getRequestElement('act'),
+                                       bigintval(getRequestElement('fid'))
                                ), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -1823,14 +1871,14 @@ function doAdminProcessMenuWeightning ($type, $AND) {
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
                                array(
                                        $type,
-                                       bigintval(getRequestParameter('tid'))
+                                       bigintval(getRequestElement('tid'))
                                ), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
                                array(
                                        $type,
-                                       bigintval(getRequestParameter('fid'))
+                                       bigintval(getRequestElement('fid'))
                                ), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -1841,13 +1889,13 @@ function doAdminProcessMenuWeightning ($type, $AND) {
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(
                                        $type,
-                                       bigintval(getRequestParameter('tid')),
+                                       bigintval(getRequestElement('tid')),
                                        bigintval($fid)
                                ), __FILE__, __LINE__);
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(
                                        $type,
-                                       bigintval(getRequestParameter('fid')),
+                                       bigintval(getRequestElement('fid')),
                                        bigintval($tid)
                                ), __FILE__, __LINE__);
                } // END - if