summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
diff options
context:
space:
mode:
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page')
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page16
1 files changed, 10 insertions, 6 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
index d54fc967..6d7967d4 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
@@ -16,23 +16,27 @@ The workflow of <tt>LoginUser</tt> is very similar to the <a href="?page=Day1.Cr
<li>If the user enters correct username and password, the system assigns him a valid identity and redirects his browser to the desired privileged page; If not, a "password invalid" message is displayed.
</ol>
+<p>
+We create two files <tt>protected/pages/users/LoginUser.page</tt> and <tt>protected/pages/users/LoginUser.php</tt> to save the page template and page class, respectively.
+</p>
+
<h2>Creating Page Template</h2>
<p>
-Below we show the template for <tt>LoginPage</tt>. As we see, the page mainly contains a text box for collecting username and a text box for password. The username input is required, which is ensured by the <tt>TRequiredFieldValidator</tt>. The correctness of the password input is ensured by the <a href="http://www.pradosoft.com/demos/quickstart/index.php?page=Controls.Validation">TCustomValidator</a> which invokes the page's <tt>validateUser()</tt> method when validation is performed. The page also has "login" button which invokes the page's <tt>loginButtonClicked()</tt> when it is clicked.
+Below we show the template for <tt>LoginUser</tt>. As we see, the page mainly contains a text box for collecting username and a text box for password. The username input is required, which is ensured by the <tt>TRequiredFieldValidator</tt>. The correctness of the password input is ensured by the <a href="http://www.pradosoft.com/demos/quickstart/index.php?page=Controls.Validation">TCustomValidator</a> which invokes the page's <tt>validateUser()</tt> method when validation is performed. The page also has "login" button which invokes the page's <tt>loginButtonClicked()</tt> when it is clicked.
</p>
<com:TTextHighlighter CssClass="source" Language="prado">
&lt;%@ Title="My Blog - Login" %>
&lt;com:TContent ID="Main">
-
+
<h1>Login</h1>
<span>Username:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide your username."
+ ErrorMessage="Please provide your username."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Username" />
@@ -116,11 +120,11 @@ We modify the footer section of the <tt>MainLayout</tt>'s template as follows. T
<com:TTextHighlighter CssClass="source" Language="prado">
<div id="footer">
-&lt;com:THyperLink Text="Login"
+&lt;com:THyperLink Text="Login"
NavigateUrl="&lt;%= $this->Service->constructUrl('users.LoginUser') %>"
Visible="&lt;%= $this->User->IsGuest %>" />
-&lt;com:TLinkButton Text="Logout"
+&lt;com:TLinkButton Text="Logout"
OnClick="logoutButtonClicked"
Visible="&lt;%= !$this->User->IsGuest %>" />