diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-04-12 19:33:38 -0400 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-04-12 19:33:38 -0400 |
| commit | 3532ad23553572ef91a9f079eadc6b7454f0cd3a (patch) | |
| tree | 9436ee675528ee663c63a3d0546fb7cce34a7e6d /inc/functions.php | |
| parent | 36acfe536ada307ba028e8de99ae12905642e5fa (diff) | |
| download | bulletin-3532ad23553572ef91a9f079eadc6b7454f0cd3a.tar.gz | |
Improved password recovery mechanism
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 11 |
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; +} ?> |
