Changeset 1752
- Timestamp:
- 03/09/2007 02:21:01 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 modified
-
COPYRIGHT (modified) (1 diff)
-
HISTORY (modified) (1 diff)
-
demos/quickstart/protected/pages/Advanced/Auth.page (modified) (1 diff)
-
demos/quickstart/protected/pages/GettingStarted/Introduction.page (modified) (1 diff)
-
demos/quickstart/protected/pages/GettingStarted/NewFeatures.page (modified) (1 diff)
-
framework/Data/TDataSourceConfig.php (modified) (3 diffs)
-
framework/Security/TDbUserManager.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/COPYRIGHT
r1398 r1752 2 2 They are released under the terms of the following BSD License. 3 3 4 Copyright 2004-200 6, The PRADO Group (http://www.pradosoft.com)4 Copyright 2004-2007, The PRADO Group (http://www.pradosoft.com) 5 5 All rights reserved. 6 6 -
trunk/HISTORY
r1740 r1752 23 23 NEW: TShellApplication (Qiang) 24 24 NEW: TDbCache (Qiang) 25 NEW: TDbUserManager and TDbUser (Qiang) 25 26 NEW: Active Record driver for IBM DB2 (Cesar Ramos) 26 27 -
trunk/demos/quickstart/protected/pages/Advanced/Auth.page
r1650 r1752 90 90 where the <tt>roles</tt> attribute in <tt>user</tt> element is optional. User roles can be specified in either the <tt>user</tt> element or in a separate <tt>role</tt> element. 91 91 </p> 92 93 <h2 id="5505">Using <tt>TDbUserManager</tt></h2> 94 <p id="720563" class="block-content"> 95 <tt>TDbUserManager</tt> is introduced in v3.1.0. Its main purpose is to simplify the task of managing user accounts that are stored in a database. It requires developers to write a user class that represents the necessary information for a user account. The user class must extend from <tt>TDbUser</tt>. 96 </p> 97 <p id="720564" class="block-content"> 98 To use <tt>TDbUserManager</tt>, configure it in the application configuration like following: 99 </p> 100 <com:TTextHighlighter Language="xml" CssClass="source block-content" id="code4"> 101 <module id="db" 102 class="System.Data.TDataSourceConfig" ..../> 103 <module id="users" 104 class="System.Security.TDbUserManager" 105 UserClass="Path.To.MyUserClass" 106 ConnectionID="db" /> 107 <module id="auth" 108 class="System.Security.TAuthManager" 109 UserManager="users" LoginPage="Path.To.LoginPage" /> 110 </com:TTextHighlighter> 111 112 </p> 113 <p id="720565" class="block-content"> 114 In the above, <tt>UserClass</tt> specifies what class will be used to create user instance. The class must extend from <tt>TDbUser</tt>. <tt>ConnectionID</tt> refers to the ID of a <tt>TDataSourceConfig</tt> module which specifies how to establish database connection to retrieve user information. 115 </p> 116 <p id="720566" class="block-content"> 117 The user class has to implement the two abstract methods in <tt>TDbUser</tt>: <tt>validateUser()</tt> and <tt>createUser()</tt>. Since user account information is stored in a database, the user class may make use of its <tt>DbConnection</tt> property to reach the database. 118 </p> 119 92 120 <div class="last-modified">$Id$</div></com:TContent> -
trunk/demos/quickstart/protected/pages/GettingStarted/Introduction.page
r1729 r1752 5 5 This Quickstart tutorial is provided to help you quickly start building your own Web applications based on PRADO version 3.x. 6 6 </p> 7 <p> 8 If you are an existing PRADO 3.x user and would like to learn what enhancements are available for each new version, please check out the <a href="?page=GettingStarted.NewFeatures">new features</a> page. Otherwise, the following sections are helpful for newbies. 9 </p> 7 10 <div class="start-page"> 8 11 <div class="concepts start-block"> 9 <h2>How P radoWorks</h2>12 <h2>How PRADO Works</h2> 10 13 <p>Concepts and fundamentals</p> 11 14 <ol> 12 <li><a href="#">Building web applications with P rado</a></li>15 <li><a href="#">Building web applications with PRADO</a></li> 13 16 <li><a href="#">Web controls and events</a></li> 14 17 <li><a href="#">Validating user input</a></li> -
trunk/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page
r1695 r1752 20 20 <li>Added support to allow <a href="?page=Configurations.AppConfig">including external application configurations</a>. Enhanced template syntax to facilitate <a href="?page=Configurations.Templates1">subproperty configuration</a>.</li> 21 21 22 <li>Added TDbUserManager and TDbUser to simplify <a href="?page=Advanced.Auth">authentication and authorization</a> with user accounts stored in a database.</li> 23 22 24 </ul> 23 25 -
trunk/framework/Data/TDataSourceConfig.php
r1596 r1752 10 10 * @package System.Data 11 11 */ 12 13 Prado::using('System.Data.TDbConnection'); 12 14 13 15 /** … … 47 49 class TDataSourceConfig extends TModule 48 50 { 49 private $_connID ;51 private $_connID=''; 50 52 private $_conn; 51 53 private $_connClass='System.Data.TDbConnection'; … … 92 94 public function getDbConnection() 93 95 { 94 if( is_null($this->_conn))96 if($this->_conn===null) 95 97 { 96 if( !is_null($this->_connID))98 if($this->_connID!=='') 97 99 $this->_conn = $this->findConnectionByID($this->getConnectionID()); 98 100 else
