From 7d47f685e1cd67976e61258659c27c70e5580769 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Fri, 24 Aug 2012 10:31:57 +0000 Subject: [PATCH] adding create_pass function --- bureau/class/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bureau/class/functions.php b/bureau/class/functions.php index 9a47ad0c..8e694f07 100644 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -578,6 +578,19 @@ function pager($offset,$count,$total,$url,$before="",$after="") { echo $after; } +function create_pass($length = 8){ + + $chars = "1234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $i = 0; + $password = ""; + while ($i <= $length) { + $password .= @$chars{mt_rand(0,strlen($chars))}; + $i++; + } + return $password; + +} + ?>