$adminId = getAdminId($adminLogin);
// Continue only with found admin ids
- if ($adminId > 0) {
+ if (isValidId($adminId)) {
// Then we need to lookup the login name by getting the admin hash
$adminHash = getAdminHash($adminId);
if (!SQL_HASZERONUMS($result)) {
// Load menu as selection
$OUT = '<select name="' . $mode . '_menu';
- if ((!empty($defid)) || ($defid == '0')) $OUT .= '[' . $defid . ']';
+ if (!isValidId($defid)) $OUT .= '[' . intval($defid) . ']';
$OUT .= '" size="1" class="form_select">
<option value="">{--SELECT_NONE--}</option>';
// Load all entries
//* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
foreach ($postData as $id => $val) {
// Process only formular field but not submit buttons ;)
- if ($id =='save_config') {
+ if ($id == 'save_config') {
// Skip this button
continue;
} // END - if
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid][$title . '_' . $what])) {
// Is title empty and valid userid?
- if (($title == '') && (isValidUserId($userid))) {
+ if (($title == '') && (isValidId($userid))) {
// Set userid as title
$title = $userid;
- } elseif (!isValidUserId($userid)) {
+ } elseif (!isValidId($userid)) {
// User id zero is invalid
return '<strong>' . convertNullToZero($userid) . '</strong>';
}
// Add other columns as well
foreach (postRequestArray() as $key => $entries) {
// Debug message
- logDebugMessage(__FUNCTION__, __LINE__, 'Found entry: ' . $key);
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Found entry: ' . $key);
// Skip id, raw userid and 'do_$mode'
if (!in_array($key, array($idColumn[0], $rawUserId[0], ('do_' . $mode)))) {
// Add entry
$content[$key] = $entries[$id];
}
- } else {
+ } elseif (isDebugModeEnabled()) {
// Skipped entry
logDebugMessage(__FUNCTION__, __LINE__, 'Skipped: ' . $key);
}
mergeConfig($settingsArray);
// Now get the test URL
- $content = sendGetRequest('check-updates3.php');
+ $content = sendHttpGetRequest('check-updates3.php');
// Is the first line with "200 OK"?
$valid = isInString('200 OK', $content[0]);
// Creates a link to the user's admin-profile
function adminCreateUserLink ($userid) {
// Is the userid set correctly?
- if (isValidUserId($userid)) {
+ if (isValidId($userid)) {
// Create a link to that profile
return '{%url=modules.php?module=admin&what=list_user&userid=' . bigintval($userid) . '%}';
} // END - if
$adminLink = '{--ADMIN_NO_ADMIN_ASSIGNED--}';
// Zero? = Not assigned
- if (isValidUserId($adminId)) {
+ if (isValidId($adminId)) {
// Load admin's login
$login = getAdminLogin($adminId);
}
// Generate link to unconfirmed mails for admin
-function generateUnconfirmedAdminLink ($id, $unconfirmed, $type = 'bid') {
+function generateUnconfirmedAdminLink ($id, $unconfirmed, $type) {
// Init output
$OUT = $unconfirmed;
// Is there unconfirmed mails?
if ($unconfirmed > 0) {
// Add link to list_unconfirmed what-file
- $OUT = '<a href="{%url=modules.php?module=admin&what=list_unconfirmed&' . $type . '=' . $id . '%}">{%pipe,translateComma=' . $unconfirmed . '%}</a>';
+ $OUT = '<a href="{%url=modules.php?module=admin&what=list_unconfirmed&type=' . $type . '&id=' . $id . '%}">{%pipe,translateComma=' . $unconfirmed . '%}</a>';
} // END - if
// Return it
$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 ((isGetRequestElementSet('userid')) && (isValidUserId(getRequestElement('userid')))) $NAV .= '&userid=' . bigintval(getRequestElement('userid'));
+ if ((isGetRequestElementSet('userid')) && (isValidId(getRequestElement('userid')))) $NAV .= '&userid=' . bigintval(getRequestElement('userid'));
// Close open anchor tag
$NAV .= '%}">';
} // END - if
// Output error messages
- $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage);
+ $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage);
$content['password1_message'] = loadTemplate('admin_login_msg', TRUE, $password1Message);
$content['password2_message'] = loadTemplate('admin_login_msg', TRUE, $password2Message);
- $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage);
+ $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage);
} // END - if
// Output message in seperate template