From 2ea02214b2fb6bedb58dbbd318ef171a9e146524 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 29 May 2006 03:08:07 +0000 Subject: Merge from 3.0 branch till 1099. --- demos/blog/protected/Pages/Users/NewUser.php | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 demos/blog/protected/Pages/Users/NewUser.php (limited to 'demos/blog/protected/Pages/Users/NewUser.php') diff --git a/demos/blog/protected/Pages/Users/NewUser.php b/demos/blog/protected/Pages/Users/NewUser.php new file mode 100644 index 00000000..166abf66 --- /dev/null +++ b/demos/blog/protected/Pages/Users/NewUser.php @@ -0,0 +1,31 @@ +Username->Text; + $param->IsValid=$this->DataAccess->queryUserByName($username)===null; + } + + public function createUser($sender,$param) + { + if($this->IsValid) + { + $userRecord=new UserRecord; + $userRecord->Name=$this->Username->Text; + $userRecord->FullName=$this->FullName->Text; + $userRecord->Role=0; + $userRecord->Password=md5($this->Password->Text); + $userRecord->Email=$this->Email->Text; + $userRecord->CreateTime=time(); + $userRecord->Website=$this->Website->Text; + $this->DataAccess->insertUser($userRecord); + $authManager=$this->Application->getModule('auth'); + $authManager->login($this->Username->Text,$this->Password->Text); + $this->gotoDefaultPage(); + } + } +} + +?> \ No newline at end of file -- cgit v1.2.3