summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2017-04-12 19:33:38 -0400
committerCarson Fleming <cflems@cflems.net>2017-04-12 19:33:38 -0400
commit3532ad23553572ef91a9f079eadc6b7454f0cd3a (patch)
tree9436ee675528ee663c63a3d0546fb7cce34a7e6d /inc/functions.php
parent36acfe536ada307ba028e8de99ae12905642e5fa (diff)
downloadbulletin-3532ad23553572ef91a9f079eadc6b7454f0cd3a.tar.gz
Improved password recovery mechanism
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 12bf2fc..92343f7 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -84,4 +84,15 @@ function bulletin_mail ($to, $subject, $body) {
return 0;
}
}
+
+function pwgen ($len) {
+ $alpha = 'abcdefghijklmnopqrstuvwxyz';
+ $alpha .= strtoupper($alpha);
+ $alpha .= '0123456789';
+ $pass = '';
+ $alen = strlen($alpha);
+ for ($i = 0; $i < $len; $i++)
+ $pass .= $alpha[mt_rand(0, $alen-1)];
+ return $pass;
+}
?>