diff options
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page')
-rw-r--r-- | demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page | 16 |
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">
<%@ Title="My Blog - Login" %>
<com:TContent ID="Main">
-
+
<h1>Login</h1>
<span>Username:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide your username."
+ ErrorMessage="Please provide your username."
Display="Dynamic" />
<br/>
<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">
-<com:THyperLink Text="Login"
+<com:THyperLink Text="Login"
NavigateUrl="<%= $this->Service->constructUrl('users.LoginUser') %>"
Visible="<%= $this->User->IsGuest %>" />
-<com:TLinkButton Text="Logout"
+<com:TLinkButton Text="Logout"
OnClick="logoutButtonClicked"
Visible="<%= !$this->User->IsGuest %>" />
|