summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Users/ViewUser.php
diff options
context:
space:
mode:
authorxue <>2006-05-30 03:26:33 +0000
committerxue <>2006-05-30 03:26:33 +0000
commit6e0338629774fffe5fbe7136dfce34ce83844a5c (patch)
tree9520eaa7c3c278b5ebf525a0d1e09f0a4cdf7779 /demos/blog/protected/Pages/Users/ViewUser.php
parent7f508e187e4539a16cdbb1dd6a4b1133c53cf24d (diff)
Blog demo is completed.
Diffstat (limited to 'demos/blog/protected/Pages/Users/ViewUser.php')
-rw-r--r--demos/blog/protected/Pages/Users/ViewUser.php41
1 files changed, 32 insertions, 9 deletions
diff --git a/demos/blog/protected/Pages/Users/ViewUser.php b/demos/blog/protected/Pages/Users/ViewUser.php
index 3485f56b..453ae349 100644
--- a/demos/blog/protected/Pages/Users/ViewUser.php
+++ b/demos/blog/protected/Pages/Users/ViewUser.php
@@ -1,18 +1,41 @@
<?php
+/**
+ * ViewUser 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 $Revision: $ $Date: $
+ */
+/**
+ * ViewUser 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 ViewUser extends BlogPage
{
- private $_currentUser=null;
+ private $_userRecord=null;
- public function getCurrentUser()
+ public function onInit($param)
{
- if($this->_currentUser===null)
- {
- $id=TPropertyValue::ensureInteger($this->Request['id']);
- if(($this->_currentUser=$this->DataAccess->queryUserByID($id))===null)
- throw new BlogException('xxx');
- }
- return $this->_currentUser;
+ parent::onInit($param);
+ if(($id=$this->Request['id'])!==null)
+ $id=TPropertyValue::ensureInteger($id);
+ else
+ $id=$this->User->ID;
+ if(($this->_userRecord=$this->DataAccess->queryUserByID($id))===null)
+ throw new BlogException(500,'profile_id_invalid',$id);
+ $this->_userRecord->Email=strtr(strtoupper($this->_userRecord->Email),array('@'=>' at ','.'=>' dot '));
+ }
+
+ public function getProfile()
+ {
+ return $this->_userRecord;
}
}