Example #1
0
 public function __construct($user = null)
 {
     $this->_db = DB::connect();
     $this->_sessionName = Config::get('session/session_name');
     $this->_cookieName = Config::get('remember/cookie_name');
     if (!$user) {
         if (Session::exists($this->_sessionName)) {
             $user = Session::get($this->_sessionName);
             if ($this->find($user)) {
                 $this->_isLoggedIn = true;
             } else {
                 // logout
             }
         }
     } else {
         $this->find($user);
     }
 }
Example #2
0
 function validAccess($id)
 {
     $row = \DB::table('tb_groups_access')->where('module_id', '=', $id)->where('group_id', '=', \Session::get('gid'))->get();
     if (count($row) >= 1) {
         $row = $row[0];
         if ($row->access_data != '') {
             $data = json_decode($row->access_data, true);
         } else {
             $data = array();
         }
         return $data;
     } else {
         return false;
     }
 }
Example #3
0
 public static function createRecord($data)
 {
     $data['organization_id'] = \Session::get('user_organization');
     return self::create($data);
 }