X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=testing%2FMCTXWeb%2Fpublic_html%2Fusers%2Fmodels%2Ffuncs.php;h=b1afc72946b023bb03228f487130be304ae9216e;hb=4c11eff00a00e4b744eff9a6633c1b5608844632;hp=07af4266539c4fdf0594509aca2ab432410d4616;hpb=dd239d26439d97188aa6cad06573a6584dc250a6;p=matches%2FMCTX3420.git diff --git a/testing/MCTXWeb/public_html/users/models/funcs.php b/testing/MCTXWeb/public_html/users/models/funcs.php index 07af426..b1afc72 100644 --- a/testing/MCTXWeb/public_html/users/models/funcs.php +++ b/testing/MCTXWeb/public_html/users/models/funcs.php @@ -80,6 +80,16 @@ function generateHash($plainText, $salt = null) return crypt($plainText, $salt); } +/** + * Generates a random password for emailing to new users. + * User should be asked to change the password. + */ +function generatePassword() +{ + $random = file_get_contents("/dev/urandom", false, null, 0, 25); + return bin2hex($random); +} + //Checks if an email is valid function isValidEmail($email) {