Add UserCake
[matches/MCTX3420.git] / testing / MCTXWeb / public_html / users / models / captcha.php
diff --git a/testing/MCTXWeb/public_html/users/models/captcha.php b/testing/MCTXWeb/public_html/users/models/captcha.php
new file mode 100644 (file)
index 0000000..a62adcb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/*\r
+UserCake Version: 2.0.2\r
+http://usercake.com\r
+*/\r
+session_start();\r
+$md5_hash = md5(rand(0,99999)); \r
+$security_code = substr($md5_hash, 25, 5); \r
+$enc = md5($security_code);\r
+$_SESSION['captcha'] = $enc;\r
+\r
+$width = 150;\r
+$height = 30; \r
+\r
+$image = ImageCreate($width, $height);  \r
+$white = ImageColorAllocate($image, 255, 255, 255);\r
+$black = ImageColorAllocate($image, 0, 0, 0);\r
+$grey = ImageColorAllocate($image, 200, 200, 200);\r
+\r
+ImageFill($image, 0, 0, $white); \r
+ImageString($image, 10, 5, 0, $security_code, $black); \r
+\r
+header("Content-Type: image/png"); \r
+ImagePng($image);\r
+ImageDestroy($image);\r
+\r
+?>\r

UCC git Repository :: git.ucc.asn.au