summaryrefslogtreecommitdiff
path: root/demos/controls/protected/pages/private
diff options
context:
space:
mode:
authorxue <>2005-11-10 12:47:19 +0000
committerxue <>2005-11-10 12:47:19 +0000
commit55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 (patch)
treea0599d5e36fdbb3f1e169ae56bab7d529597e3eb /demos/controls/protected/pages/private
Initial import of prado framework
Diffstat (limited to 'demos/controls/protected/pages/private')
-rw-r--r--demos/controls/protected/pages/private/MemberPage.php12
-rw-r--r--demos/controls/protected/pages/private/MemberPage.tpl8
-rw-r--r--demos/controls/protected/pages/private/config.xml10
3 files changed, 30 insertions, 0 deletions
diff --git a/demos/controls/protected/pages/private/MemberPage.php b/demos/controls/protected/pages/private/MemberPage.php
new file mode 100644
index 00000000..61fd113d
--- /dev/null
+++ b/demos/controls/protected/pages/private/MemberPage.php
@@ -0,0 +1,12 @@
+<?php
+
+class MemberPage extends TPage
+{
+ public function logout($sender,$param)
+ {
+ $this->Application->AuthManager->logout();
+ $this->Application->Response->redirect($this->Application->Service->constructUrl('home'));
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/controls/protected/pages/private/MemberPage.tpl b/demos/controls/protected/pages/private/MemberPage.tpl
new file mode 100644
index 00000000..cf92f22c
--- /dev/null
+++ b/demos/controls/protected/pages/private/MemberPage.tpl
@@ -0,0 +1,8 @@
+<com:TForm>
+Congratulations, <com:TLabel Text=<%=$this->Application->User->Name%> />!<br/>
+<%=
+ $this->Application->User->Name;
+%>
+You have reached this member-only area.
+<com:TButton Text="Logout" Click="logout" />
+</com:TForm> \ No newline at end of file
diff --git a/demos/controls/protected/pages/private/config.xml b/demos/controls/protected/pages/private/config.xml
new file mode 100644
index 00000000..ecfb6b00
--- /dev/null
+++ b/demos/controls/protected/pages/private/config.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <authorization>
+ <deny pages="member" users="?" />
+ </authorization>
+ <pages>
+ <page id="member" type="MemberPage" />
+ </pages>
+</configuration> \ No newline at end of file