summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TCaptcha
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples/TCaptcha')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.page32
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.php27
2 files changed, 59 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.page
new file mode 100644
index 00000000..f47583e9
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.page
@@ -0,0 +1,32 @@
+<com:TContent ID="body">
+<h1>TCaptcha Samples</h1>
+
+<h2>Validating CAPTCHA</h2>
+<com:TCaptcha ID="Captcha" TokenImageTheme="5"/>
+<com:TTextBox ID="Input" />
+<com:TButton Text="Regenerate" OnClick="regenerateToken" CausesValidation="false" />
+<com:TButton Id="SubmitButton" Text="Submit" OnClick="buttonClicked" />
+<com:TCaptchaValidator CaptchaControl="Captcha" ControlToValidate="Input" Text="error" />
+
+<h2>Different Themes of TCaptcha</h2>
+
+<table border="1">
+<tr>
+<th>Theme</th><th>Image</th>
+</tr>
+<com:TRepeater ID="CaptchaList">
+ <prop:ItemTemplate>
+<tr>
+ <td>
+ <%# $this->Data %>
+ </td>
+ <td>
+ <com:TCaptcha TokenImageTheme="<%# $this->Data %>" MaxTokenLength="5"/>
+ </td>
+</tr>
+ </prop:ItemTemplate>
+</com:TRepeater>
+</table>
+
+<div class="last-modified">$Id$</div>
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.php
new file mode 100644
index 00000000..4d54ce87
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.php
@@ -0,0 +1,27 @@
+<?php
+
+class Home extends TPage
+{
+ public function onInit($param)
+ {
+ if(!$this->IsPostBack)
+ {
+ $this->CaptchaList->DataSource=range(0,31);
+ $this->CaptchaList->dataBind();
+ }
+ }
+
+ public function regenerateToken($sender,$param)
+ {
+ $this->Captcha->regenerateToken();
+ $this->SubmitButton->Text="Submit";
+ }
+
+ public function buttonClicked($sender,$param)
+ {
+ if($this->IsValid)
+ $sender->Text="You passed!";
+ }
+}
+
+?> \ No newline at end of file