diff options
Diffstat (limited to 'demos/controls/protected/pages/private')
-rw-r--r-- | demos/controls/protected/pages/private/MemberPage.php | 12 | ||||
-rw-r--r-- | demos/controls/protected/pages/private/MemberPage.tpl | 8 | ||||
-rw-r--r-- | demos/controls/protected/pages/private/config.xml | 10 |
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 |