diff options
author | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
---|---|---|
committer | ctrlaltca <ctrlaltca@gmail.com> | 2014-08-26 16:59:21 +0200 |
commit | 74b31be9515eddfa63005d6760614badfaba9fea (patch) | |
tree | 47c952901dcb5eccd6dd8b7c6ee7e0b6bf176510 /demos/time-tracker/protected/pages/TimeTracker/UserCreate.php | |
parent | 2b11341614ac4a15be697fa8acad07055154ac54 (diff) | |
parent | 0c5026b55cde5c104f10686afd8b441568175d38 (diff) |
Backports for Prado 3.2.4
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/UserCreate.php')
-rwxr-xr-x | demos/time-tracker/protected/pages/TimeTracker/UserCreate.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php index 2c73752a..34e69713 100755 --- a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php +++ b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php @@ -6,18 +6,16 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2006 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos */ /** * Create new user wizard page class. Validate that the usernames are unique and * set the new user credentials as the current application credentials. - * + * * If logged in as admin, the user role can be change during creation. * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $ * @package Demos * @since 3.1 */ @@ -30,11 +28,11 @@ class UserCreate extends TPage { if(!$this->IsPostBack) { - $this->role->SelectedValue = + $this->role->SelectedValue = $this->Application->Parameters['NewUserRoles']; } } - + /** * Verify that the username is not taken. * @param TControl custom validator that created the event. @@ -46,11 +44,11 @@ class UserCreate extends TPage if($userDao->usernameExists($this->username->Text)) { $param->IsValid = false; - $sender->ErrorMessage = + $sender->ErrorMessage = "The user name is already taken, try '{$this->username->Text}01'"; } } - + /** * Skip the role assignment step if not admin. */ @@ -66,7 +64,7 @@ class UserCreate extends TPage } } } - + /** * Create a new user if all data entered are valid. * The default user roles are obtained from "config.xml". The new user @@ -84,11 +82,11 @@ class UserCreate extends TPage $newUser->Name = $this->username->Text; $newUser->IsGuest = false; $newUser->Roles = $this->role->SelectedValue; - + //save the user $userDao = $this->Application->Modules['daos']->getDao('UserDao'); $userDao->addNewUser($newUser, $this->password->Text); - + //update the user credentials if not admin if(!$this->User->isInRole('admin')) { @@ -97,7 +95,7 @@ class UserCreate extends TPage } } } - + /** * Continue with requested page. */ |