protected function __construct() { if (isset($_SESSION['sid'])) { $sid = trim($_SESSION['sid']); } else { if (isset($_COOKIE['sid'])) { $sid = trim($_COOKIE['sid']); } else { $sid = NULL; } } if (!is_null($sid)) { $_session = Common_Db::get('Common_Db_Session'); try { $rs = $_session->getById($sid); } catch (Exception $e) { $rs = NULL; } if (isset($rs['sid'])) { $this->sid = $rs['sid']; $this->uid = $rs['uid']; $this->uname = $rs['uname']; //$this->roles = $rs->roles; } } }
public function update($params, $where) { foreach ($params as $key => $value) { if (!in_array($key, $this->_cols)) { unset($params[$key]); } } try { $_user = Common_Db::get('User_Model_Db_UserProfile'); $_user->update($params, $where); } catch (Exception $e) { throw $e; } }