From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../day4/blog/protected/pages/users/NewUser.php | 88 +++++++++++----------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php') diff --git a/demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php b/demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php index 76e8cb88..3bf6768a 100644 --- a/demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php +++ b/demos/blog-tutorial/samples/day4/blog/protected/pages/users/NewUser.php @@ -1,45 +1,45 @@ -IsValid=UserRecord::finder()->findByPk($this->Username->Text)===null; - } - - /** - * Creates a new user account if all inputs are valid. - * This method responds to the OnClick event of the "create" button. - * @param mixed event sender - * @param mixed event parameter - */ - public function createButtonClicked($sender,$param) - { - if($this->IsValid) // when all validations succeed - { - // populates a UserRecord object with user inputs - $userRecord=new UserRecord; - $userRecord->username=$this->Username->Text; - $userRecord->password=$this->Password->Text; - $userRecord->email=$this->Email->Text; - $userRecord->role=(int)$this->Role->SelectedValue; - $userRecord->first_name=$this->FirstName->Text; - $userRecord->last_name=$this->LastName->Text; - - // saves to the database via Active Record mechanism - $userRecord->save(); - - // redirects the browser to the homepage - $this->Response->redirect($this->Service->DefaultPageUrl); - } - } -} - +IsValid=UserRecord::finder()->findByPk($this->Username->Text)===null; + } + + /** + * Creates a new user account if all inputs are valid. + * This method responds to the OnClick event of the "create" button. + * @param mixed event sender + * @param mixed event parameter + */ + public function createButtonClicked($sender,$param) + { + if($this->IsValid) // when all validations succeed + { + // populates a UserRecord object with user inputs + $userRecord=new UserRecord; + $userRecord->username=$this->Username->Text; + $userRecord->password=$this->Password->Text; + $userRecord->email=$this->Email->Text; + $userRecord->role=(int)$this->Role->SelectedValue; + $userRecord->first_name=$this->FirstName->Text; + $userRecord->last_name=$this->LastName->Text; + + // saves to the database via Active Record mechanism + $userRecord->save(); + + // redirects the browser to the homepage + $this->Response->redirect($this->Service->DefaultPageUrl); + } + } +} + ?> \ No newline at end of file -- cgit v1.2.3