Begin modifying UserCake
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / users / models / funcs.php
index 07af426..b1afc72 100644 (file)
@@ -80,6 +80,16 @@ function generateHash($plainText, $salt = null)
        return crypt($plainText, $salt);\r
 }\r
 \r
+/**\r
+ * Generates a random password for emailing to new users.\r
+ * User should be asked to change the password.\r
+ */\r
+function generatePassword()\r
+{\r
+  $random = file_get_contents("/dev/urandom", false, null, 0, 25);\r
+  return bin2hex($random);\r
+}\r
+\r
 //Checks if an email is valid\r
 function isValidEmail($email)\r
 {\r

UCC git Repository :: git.ucc.asn.au