X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=testing%2FMCTXWeb%2Fpublic_html%2Fusers%2Fmodels%2Ffuncs.php;h=a3a9928005c4994343e0417df54c94c2c7bdaaf2;hb=c93b3c1b0dc67d03e4f60d99785929b8c319ddb6;hp=07af4266539c4fdf0594509aca2ab432410d4616;hpb=1b3737962d2abeb9359d92de0977d0ca108ff05b;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..a3a9928 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) { @@ -144,31 +154,59 @@ function resultBlock($errors,$successes){ //Error block if(count($errors) > 0) { - echo "
".$error."
"; } - echo ""; echo "".$success.""; } - echo ""; echo "