// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Add links for selecting some users
function alpha ($sortby, $colspan, $return=false) {
if (!isGetRequestElementSet('offset')) setRequestGetElement('offset', 0);
- $add = "&page=".getRequestElement('page')."&offset=".getRequestElement('offset');
- if (isGetRequestElementSet('mode')) $add .= "&mode=".getRequestElement('mode');
+ $add = '&page='.getRequestElement('page').'&offset='.getRequestElement('offset');
+ if (isGetRequestElementSet('mode')) $add .= '&mode='.getRequestElement('mode');
/* Creates the list of letters and makes them a link. */
$alphabet = explode(',', getMessage('_ALL2') . ',A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,' . getMessage('_OTHERS'));
while (list($counter, $ltr) = each($alphabet)) {
if (getRequestElement('letter') == $ltr) {
// Current letter is letter from URL
- $OUT .= "<strong>".$ltr."</strong>";
+ $OUT .= '<strong>' . $ltr . '</strong>';
} else {
// Output link to letter
- $OUT .= "<a href=\"{?URL?}/modules.php?module=admin&what=".getWhat();
- if (isGetRequestElementSet('mode')) $OUT .= "&mode=".getRequestElement('mode');
- $OUT .= "&letter=".$ltr."&sortby=".$sortby.$add."\">".$ltr."</a>";
+ $OUT .= '<a href="{?URL?}/modules.php?module=admin&what=' . getWhat();
+ if (isGetRequestElementSet('mode')) $OUT .= '&mode=' . getRequestElement('mode');
+ $OUT .= '&letter=' . $ltr . '&sortby=' . $sortby . $add . '">' . $ltr . '</a>';
}
if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) {
- $OUT .= " ]<br />[ ";
+ $OUT .= ' ]<br />[ ';
} elseif ( $counter != $num ) {
- $OUT .= " | ";
+ $OUT .= ' | ';
}
} // END - while
foreach ($list as $sort => $title) {
if ($sortby == $sort) {
- $OUT .= "<strong>" . $title . "</strong> | ";
+ $OUT .= '<strong>' . $title . '</strong> | ';
} else {
- $OUT .= "<a href=\"{?URL?}/modules.php?module=admin&what=list_user&letter=" . $letter . "&sortby=" . $sort.$add . "\">" . $title . "</a> | ";
+ $OUT .= '<a href="{?URL?}/modules.php?module=admin&what=list_user&letter=' . $letter . '&sortby=' . $sort.$add . '">' . $title . '</a> | ';
}
} // END - foreach
// Try to send a new password for the given user account
function doNewUserPassword ($email, $userid) {
- // Compile email when found in address (only secure chars!)
- if (!empty($email)) $email = str_replace('{DOT}', '.', $email);
-
// Init result and error
$errorCode = '';
$result = false;
// @TODO We should try to rewrite this to fetchUserData() somehow
if (!empty($email)) {
// Email entered
- $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' LIMIT 1",
- array($email), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' OR `email`='%s' LIMIT 1",
+ array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__);
} elseif ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) {
// Nickname entered
$result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' OR `userid`='%s' OR `email`='%s' LIMIT 1",