summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Users/EditUser.php
diff options
context:
space:
mode:
Diffstat (limited to 'demos/blog/protected/Pages/Users/EditUser.php')
-rw-r--r--demos/blog/protected/Pages/Users/EditUser.php136
1 files changed, 68 insertions, 68 deletions
diff --git a/demos/blog/protected/Pages/Users/EditUser.php b/demos/blog/protected/Pages/Users/EditUser.php
index c574ca6b..8d5cb090 100644
--- a/demos/blog/protected/Pages/Users/EditUser.php
+++ b/demos/blog/protected/Pages/Users/EditUser.php
@@ -1,69 +1,69 @@
-<?php
-/**
- * EditUser class file
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- * @version $Id$
- */
-
-/**
- * EditUser class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- */
-class EditUser extends BlogPage
-{
- private $_userRecord=null;
-
- public function onInit($param)
- {
- parent::onInit($param);
- if(($id=$this->Request['id'])!==null)
- {
- $id=TPropertyValue::ensureInteger($id);
- if(!$this->User->IsAdmin && $this->User->ID!==$id)
- throw new BlogException(500,'profile_edit_disallowed',$id);
- }
- else
- $id=$this->User->ID;
- if(($this->_userRecord=$this->DataAccess->queryUserByID($id))===null)
- throw new BlogException(500,'profile_id_invalid',$id);
- }
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $userRecord=$this->_userRecord;
- $this->Username->Text=$userRecord->Name;
- $this->FullName->Text=$userRecord->FullName;
- $this->Email->Text=$userRecord->Email;
- $this->Website->Text=$userRecord->Website;
- }
- }
-
- public function saveButtonClicked($sender,$param)
- {
- if($this->IsValid)
- {
- $userRecord=$this->_userRecord;
- if($this->Password->Text!=='')
- $userRecord->Password=md5($this->Password->Text);
- $userRecord->FullName=$this->FullName->Text;
- $userRecord->Email=$this->Email->Text;
- $userRecord->Website=$this->Website->Text;
- $this->DataAccess->updateUser($userRecord);
- $authManager=$this->Application->getModule('auth');
- $this->gotoPage('Users.ViewUser',array('id'=>$userRecord->ID));
- }
- }
-}
-
+<?php
+/**
+ * EditUser class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ */
+
+/**
+ * EditUser class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+class EditUser extends BlogPage
+{
+ private $_userRecord=null;
+
+ public function onInit($param)
+ {
+ parent::onInit($param);
+ if(($id=$this->Request['id'])!==null)
+ {
+ $id=TPropertyValue::ensureInteger($id);
+ if(!$this->User->IsAdmin && $this->User->ID!==$id)
+ throw new BlogException(500,'profile_edit_disallowed',$id);
+ }
+ else
+ $id=$this->User->ID;
+ if(($this->_userRecord=$this->DataAccess->queryUserByID($id))===null)
+ throw new BlogException(500,'profile_id_invalid',$id);
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $userRecord=$this->_userRecord;
+ $this->Username->Text=$userRecord->Name;
+ $this->FullName->Text=$userRecord->FullName;
+ $this->Email->Text=$userRecord->Email;
+ $this->Website->Text=$userRecord->Website;
+ }
+ }
+
+ public function saveButtonClicked($sender,$param)
+ {
+ if($this->IsValid)
+ {
+ $userRecord=$this->_userRecord;
+ if($this->Password->Text!=='')
+ $userRecord->Password=md5($this->Password->Text);
+ $userRecord->FullName=$this->FullName->Text;
+ $userRecord->Email=$this->Email->Text;
+ $userRecord->Website=$this->Website->Text;
+ $this->DataAccess->updateUser($userRecord);
+ $authManager=$this->Application->getModule('auth');
+ $this->gotoPage('Users.ViewUser',array('id'=>$userRecord->ID));
+ }
+ }
+}
+
?> \ No newline at end of file