/** * checkonlineuser * * @param mixed $ip * @param mixed $type * @access public * @return void */ public function checkonlineuser($ip, $type) { $timestamp = time(); $timeout = time() - 300; $online_user = ORM::factory('system_online'); $online_user->system_id = system::id(); $online_user->timestamp = $timestamp; $online_user->ip = $ip; $online_user->file = $_SERVER['PHP_SELF']; $online_user->type = $type; $online_user->save(); $online_user->deleteold($timeout); }
/** * add * * @param mixed $type * @param mixed $action * @static * @access public * @return void */ public static function add($type, $action) { if (Auth::instance()->logged_in('admin')) { $user_type = ':admin'; $user_id = Auth::instance()->get_user()->id; } elseif (Auth::instance()->logged_in('cliente')) { $user_type = ':cliente'; $user_id = Auth::instance()->get_user()->id; } else { $user_type = ':visitante'; $user_id = null; } $model = ORM::factory('Log'); $model->system_id = system::id(); $model->ip = ORM::factory('Online')->get_ip(); $model->type = $type; $model->action = $action; $model->user_id = $user_id; $model->user_type = $user_type; $model->save(); }
/** * layout_dir * * @static * @access public * @return void */ public static function layout_dir() { $theme_id = ORM::factory('system_system', system::id())->find()->systems_theme_id; return ORM::factory('system_theme', $theme_id)->find()->layout_dir; }