]> git.mxchange.org Git - mailer.git/commitdiff
Sub ids "fixed":
authorRoland Häder <roland@mxchange.org>
Tue, 23 Oct 2012 14:19:45 +0000 (14:19 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 23 Oct 2012 14:19:45 +0000 (14:19 +0000)
- ADMIN_FORCED_ADS_404 was wrong in user_subids XML template
- Move alphabet for random passwords to initialize filter
- Removed some chars that may look to similar to others
- Other minor improvements

inc/filters.php
inc/functions.php
inc/language/user_de.php
inc/libs/user_functions.php
templates/xml/admin/admin_list_user_subid.xml

index ccdd4176c7bdd18a964ab9e59a6a32236679a875..39d170f9d0755db87fcca4d353bee7e221149994 100644 (file)
@@ -367,6 +367,9 @@ function FILTER_INIT_RANDOMIZER () {
 
        // 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
index a941932a6ca5d471dbe8008484b418f6c5802fbd..d13b75ec43a6364b13049dcc36645cfc126c192e 100644 (file)
@@ -89,27 +89,26 @@ function generatePassword ($length = '0', $exclude =  array()) {
                $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
index ba353ef6a141b6d9402022c124e468e251528e5f..9ee2e1feb18aeeff4522deab1293a5f0b9df09eb 100644 (file)
@@ -179,6 +179,7 @@ addMessages(array(
        '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&uuml;r die Sub-Id <span class=\"data\">{%get,getSubId=id%}</span> noch keine Statistikeintr&auml;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>",
index f4558fa77f05bdbdbc22191fa51f07fcfb41f626..189f3f782f9db78ffe3b9d7cac5bc83eaa642f4a 100644 (file)
@@ -449,19 +449,19 @@ function doNewUserPassword ($email, $userid) {
                // 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'));
 
index 691c25e406a1a21ab99f1ea517176af8faab58e3..7f9a24fef55b0bc66b448cbbe5f420ed06688ce3 100644 (file)
@@ -45,7 +45,7 @@ MA  02110-1301  USA
        <!--
        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.
        //-->