From 93364325d273d80cee268d5ab089d13497fb49f8 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 29 Jul 2010 15:10:59 -0400 Subject: [PATCH] Added a function to the class, which creates a password and encrypts it in sha1 --- bbb-api-examples/PHP/bbb_api.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bbb-api-examples/PHP/bbb_api.php b/bbb-api-examples/PHP/bbb_api.php index 266a380ee6..f4a11db8ff 100755 --- a/bbb-api-examples/PHP/bbb_api.php +++ b/bbb-api-examples/PHP/bbb_api.php @@ -353,5 +353,21 @@ function getServerIP() { return $serverIP = 'http://'.$sIP.'/bigbluebutton/'; } + +# function taken from http://www.php.net/manual/en/function.mt-rand.php +# modified by Sebastian Schneider +# credits go to www.mrnaz.com +function rand_string($len, $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') +{ + $string = ''; + for ($i = 0; $i < $len; $i++) + { + $pos = rand(0, strlen($chars)-1); + $string .= $chars{$pos}; + } + return (sha1($string)); +} + + } ?>