예제 #1
0
파일: Instance.php 프로젝트: eryx/labs
 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;
         }
     }
 }
예제 #2
0
파일: Profile.php 프로젝트: eryx/labs
 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;
     }
 }