Skip to content
Browse files

randomness

  • Loading branch information...
1 parent 6e2d0ec commit 7c28f36d0a292587821b089d54ef728921e4b27a @claudehohl committed Jun 12, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 htdocs/application/controllers/main.php
  2. +7 −1 htdocs/application/helpers/captcha_helper.php
View
2 htdocs/application/controllers/main.php
@@ -401,7 +401,7 @@ function captcha()
$this->load->helper('captcha');
//get "word"
- $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@';
$str = '';
for ($i = 0;$i < 4;$i++)
{
View
8 htdocs/application/helpers/captcha_helper.php
@@ -4,6 +4,7 @@
* Function list:
* - create_captcha()
* - display_captcha()
+ * - b()
* Classes list:
*/
@@ -362,7 +363,12 @@ function display_captcha($word = '')
// -----------------------------------
- $bg_color = imagecolorallocate($im, 255, 255, 255);
+
+ function b()
+ {
+ return mt_rand(240, 255);
+ }
+ $bg_color = imagecolorallocate($im, b() , b() , b());
$border_color = imagecolorallocate($im, 153, 102, 102);
$text_color = imagecolorallocate($im, 204, 153, 153);
$grid_color = imagecolorallocate($im, 255, 182, 182);

0 comments on commit 7c28f36

Please sign in to comment.
Something went wrong with that request. Please try again.