summaryrefslogtreecommitdiff
path: root/demos/providers/protected
diff options
context:
space:
mode:
Diffstat (limited to 'demos/providers/protected')
-rw-r--r--demos/providers/protected/.htaccess1
-rw-r--r--demos/providers/protected/application.xml43
-rw-r--r--demos/providers/protected/pages/Home.page4
-rw-r--r--demos/providers/protected/pages/Home.php27
4 files changed, 75 insertions, 0 deletions
diff --git a/demos/providers/protected/.htaccess b/demos/providers/protected/.htaccess
new file mode 100644
index 00000000..3418e55a
--- /dev/null
+++ b/demos/providers/protected/.htaccess
@@ -0,0 +1 @@
+deny from all \ No newline at end of file
diff --git a/demos/providers/protected/application.xml b/demos/providers/protected/application.xml
new file mode 100644
index 00000000..d9258934
--- /dev/null
+++ b/demos/providers/protected/application.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<application id="Providers" mode="Debug">
+
+ <modules>
+ <module id="MembershipProvider"
+ class="System.Configuration.TProtectedConfiguration"
+ defaultProvider="SqlMembershipProvider" >
+ <provider
+ id="SqlMembershipProvider"
+ Description="Our SQL Membership provider"
+ class="System.Web.Security.TSqlMembershipProvider"
+ ConnectionStringName="SqlMembershipProvider"
+ Enabled="true"
+ EnablePasswordReset="True"
+ EnablePasswordRetrieval="True"
+ MaxInvalidPasswordAttempts="5"
+ MinRequiredNonAlphanumericCharacters="5"
+ MinRequiredPasswordLength="5"
+ PasswordAttemptWindow="5"
+ PasswordStrengthRegularExpression=""
+ RequiresQuestionAndAnswer="True"
+ RequiresUniqueEmail="True"/>
+ </module>
+
+ <module id="RoleProvider"
+ class="System.Configuration.TProtectedConfiguration"
+ defaultProvider="SqlRoleProvider">
+ <provider
+ id="SqlRoleProvider"
+ class="System.Web.Security.TSqlRoleProvider"
+ ConnectionStringName="SqlRoleProvider"
+ ApplicationName="SampleApplication"
+ Enabled="true"
+ CacheRolesInCookie="True"
+ CookieName="PRADO"
+ CookieTimeout="30"
+ CookiePath="/"
+ CookieRequireSSL="False"
+ CookieSlidingExpiration="True"/>
+ </module>
+ </modules>
+</application> \ No newline at end of file
diff --git a/demos/providers/protected/pages/Home.page b/demos/providers/protected/pages/Home.page
new file mode 100644
index 00000000..10069478
--- /dev/null
+++ b/demos/providers/protected/pages/Home.page
@@ -0,0 +1,4 @@
+<h1>Welcome to Prado!</h1>
+<com:TForm>
+ <com:TLogin ID="LoginCtrl" MembershipProvider="SqlMembershipProvider"/>
+</com:TForm> \ No newline at end of file
diff --git a/demos/providers/protected/pages/Home.php b/demos/providers/protected/pages/Home.php
new file mode 100644
index 00000000..bbcbc20b
--- /dev/null
+++ b/demos/providers/protected/pages/Home.php
@@ -0,0 +1,27 @@
+<?php
+class Home extends TPage
+{
+ public function OnLoad($param)
+ {
+ Prado::using('System.Util.TVarDumper');
+ Prado::using('System.Web.Security.TSqlMembershipProvider');
+ Prado::using('System.Configuration.TProtectedConfiguration');
+ // TRoles::CreateRole('test');
+ // TMembership::ValidateUser('test','test');
+ // echo TVarDumper::dump(TProtectedConfiguration::getDefaultProvider(),10,true);
+ // echo TVarDumper::dump($this->Application->getModule('ProtectedConfiguration'),10,true);
+
+
+ // Access by provider id
+ // $MembershipProvider = $this->Application->getModule('MembershipProvider')->getProvider('SqlMembershipProvider');
+ // or just get the default provider
+ $MembershipProvider = $this->Application->getModule('MembershipProvider')->Provider;
+ // $RoleProvider = $this->Application->getModule('RoleProvider')->Provider;
+ /* @VAR $MembershipProvider TSqlMembershipProvider */
+ /* @VAR $RoleProvider TSqlRoleProvider */
+ echo TVarDumper::dump($MembershipProvider,10,true);
+ echo TVarDumper::dump($MembershipProvider->getMembershipUser('testUser'),10,true);
+ // echo TVarDumper::dump($RoleProvider,10,true);
+ }
+}
+?> \ No newline at end of file