* -------------------------------------------------------------------- *
* 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 *
// 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);
} // 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);
}
// 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
// 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));
}
}
// "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);
// 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]));
// 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(
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
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();
} // 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
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
} // 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__);
} // END - if
// Now handle all over to the inner function which will execute the listing
- doAdminListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array());
+ doAdminListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters);
}
// Do the listing of entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// "Translate" content
- foreach ($callbackColumns as $column=>$callbackFunction) {
+ foreach ($callbackColumns as $columnName=>$callbackFunction) {
// Fill the callback arguments
- $args = array($content[$column]);
+ $args = array($content[$columnName]);
// Do we have more to add?
- if (isset($extraParameters[$column])) {
+ if (isset($extraParameters[$columnName])) {
// Add them as well
- merge_array($args, $extraParameters[$column]);
+ $args = merge_array($args, $extraParameters[$columnName]);
} // END - if
// Call the callback-function
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackFunction . ',args=<pre>'.print_r($args, true).'</pre>');
// @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
- $content[$column] = call_user_func_array($callbackFunction, $args);
+ $content[$columnName] = call_user_func_array($callbackFunction, $args);
} // END - foreach
// Load row template
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);
$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;
$OUT = '';
// Look up administator login
- $result = SQL_QUERY_ESC("SELECT `id`,`login`,`password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `email`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`,`login`,`password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE '%s' REGEXP `email` LIMIT 1",
array($email), __FUNCTION__, __LINE__);
// Is there an account?
// 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';
adminsChangeAdminAccount($postData, 'expert_warning');
// Clear form
- unsetPostRequestParameter('ok');
+ unsetPostRequestElement('ok');
} // END - if
// All fine!
$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 {
$NAV .= '<a href="{%url=modules.php?module=admin&what=' . getWhat() . '&page=' . $page . '&offset=' . $offset;
// Add userid when we shall show all mails from a single member
- if ((isGetRequestParameterSet('userid')) && (isValidUserId(getRequestParameter('userid')))) $NAV .= '&userid=' . bigintval(getRequestParameter('userid'));
+ if ((isGetRequestElementSet('userid')) && (isValidUserId(getRequestElement('userid')))) $NAV .= '&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 {
// 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);
$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",
array(
$type,
$menu,
- postRequestParameter('sel_action', $sel),
+ postRequestElement('sel_action', $sel),
$sel
), __FILE__, __LINE__);
} else {
array(
$type,
$menu,
- postRequestParameter('sel_action', $sel),
- postRequestParameter('sel_what', $sel),
+ postRequestElement('sel_action', $sel),
+ postRequestElement('sel_what', $sel),
$sel
), __FILE__, __LINE__);
}
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__);
+ 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
// 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);
$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);
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