<?php
/*
秀影系统控制用户登陆以及在线列表文件
*/
class ActivesController extends Easy_Controller_Action {
	public function Init(){
		$this->_Active = new PlaylogModel();
	}
	public function IndexAction(){
		header('Content-type: application/x-javascript');
		parse_str(base64_decode($this->_Request->getParam('token')), $ouput);
		//print_r($ouput);
		$this->_Active->state($ouput, $this->config['refreshplayer']);	//传入参数检测在线状态
		exit;
	}
	/*用户退出时清理当前的用户记录*/
	public function ExitAction(){
		header('Content-type: application/x-javascript');
		parse_str(base64_decode($this->_Request->getParam('token')), $output);
		$id = $output['id'];
		$user = new UsersModel();
		$user->delActive($id);
		//echo $user->_DB->sql;
		$this->_Active->clearPlayer($this->config['refreshplayer']);
		exit;
	}
	
}