Ability to include special characters in random password generation (SKINS)

Version 1.46


New directadmin.conf option, this is the internal default: special_characters_in_random_passwords=0 set it to 1 if you want to have the random password generation include special characters, eg: `~!@#$%^&*()_-+=... etc.. basically, all ascii characters: 33-126 inclusive, but not 47 or 92 (forward and backwards slashes) ! through ~ This applies to both the javascripts generation, and the internal AJAX password generation. When enabled, this will also change the difficult password enforcement script (if used) to require those characters. The difficult_password.php script will have a new token: special_characters_in_random_passwords=1|0 so it can use that to decide if the enforce_shift_chars should be used. The This also required the resulting passwords to be displayed in an html encoded string, since some special characters must be encoded anyway. This applies to email and database user creation/modification. SKINS: javascript.html new function: function has_special_chars(pass) in the random_pass function, change the "var chars" line, to these lines: |*if SPECIAL_CHARACTERS_IN_RANDOM_PASSWORDS="1"| var chars = ''; for (i=33; i<=126; i++) { if (i == 47) continue; if (i == 92) continue; chars = chars + String.fromCharCode(i); } |*else| var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; |*endif| and add this just before "return pass": |*if SPECIAL_CHARACTERS_IN_RANDOM_PASSWORDS="1"| if (!has_special_chars(pass)) { return random_pass(); } |*endif|

Interested to try DirectAdmin? Get a 30-day Free Trial!