// Simply init the randomizer with seed and _ADD value
mt_srand(generateSeed() + getConfig('_ADD'));
+
+ // Initialize array with all allowed chars
+ $GLOBALS['_abc'] = explode(',', '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,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,1,2,3,4,6,7,8,9,-,+,_,/,.');
}
// Filter for removing updates
$length = getPassLen();
} // END - if
- // Initialize array with all allowed chars
- $ABC = explode(',', '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,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,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
-
// Exclude some entries
- $ABC = array_diff($ABC, $exclude);
+ $localAbc = array_diff($GLOBALS['_abc'], $exclude);
// Start creating password
- $PASS = '';
- for ($i = '0'; $i < $length; $i++) {
- $PASS .= $ABC[mt_rand(0, count($ABC) -1)];
- } // END - for
+ $password = '';
+ while (strlen($password) < $length) {
+ $password .= $localAbc[mt_rand(0, count($localAbc) -1)];
+ } // END - while
- // When the size is below 40 we can also add additional security by scrambling
- // it. Otherwise we may corrupt hashes
- if (strlen($PASS) <= 40) {
+ /*
+ * When the size is below 40 we can also add additional security by
+ * scrambling it. Otherwise the hash may corrupted..
+ */
+ if (strlen($password) <= 40) {
// Also scramble the password
- $PASS = scrambleString($PASS);
+ $password = scrambleString($password);
} // END - if
// Return the password
- return $PASS;
+ return $password;
}
// Generates a human-readable timestamp from the Uni* stamp
'ADMIN_USER_ACTION_LINK_LIST_USER_SUBID' => "Sub-Ids auflisten",
// Admin - list/edit/delete sub ids and stats
+ 'ADMIN_USER_SUBIDS_404' => "Das Mitglied <span class=\"data\">{%get,generateUserProfileLink=userid%}</span> hat noch keine Sub-Ids eingerichtet.",
'ADMIN_USER_SUBID_STATS_404' => "Das Mitglied <span class=\"data\">{%get,generateUserProfileLink=userid%}</span> hat für die Sub-Id <span class=\"data\">{%get,getSubId=id%}</span> noch keine Statistikeinträge.",
'ADMIN_USER_SUBID_NOT_ASSIGNED_404' => "Die angegebene Sub-Id-Kennung ist der Mitglieder-Id <span class=\"data\">{%get,generateUserProfileLink=userid%}</span> nicht zugewiesen oder existiert nicht.",
'ADMIN_LIST_USER_SUBID_TITLE' => "Auflisten der Sub-Ids von Mitglied <span class=\"data\">{%get,generateUserProfileLink=userid%}</span>",
// Is the account confirmed
if (getUserData('status') == 'CONFIRMED') {
// Generate new password
- $NEW_PASS = generatePassword();
+ $newPassword = generatePassword();
// Update database
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `password`='%s' WHERE `userid`=%s LIMIT 1",
array(
- generateHash($NEW_PASS),
+ generateHash($newPassword),
getUserData('userid')
), __FUNCTION__, __LINE__);
// Prepare data and message for email
$message = loadEmailTemplate('guest_new_password',
array(
- 'new_pass' => $NEW_PASS,
+ 'new_pass' => $newPassword,
'nickname' => $userid
), getUserData('userid'));
<!--
Message id to display if no entry could be found
//-->
- <no-entry-found-message type="string" value="ADMIN_FORCED_ADS_404" />
+ <no-entry-found-message type="string" value="ADMIN_USER_SUBIDS_404" />
<!--
The table(s) we shall grab the data from, all as list.
//-->