public function dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { $aADUSQL = Db_Orm::getADUSQL(); if (!empty($aADUSQL)) { $aLog = array('sIP' => $request->getClientIP(), 'sParam' => json_encode($request->getParams()), 'sSQL' => join("\n", $aADUSQL), 'sUserName' => Model_ActionLog::getUser(), 'iType' => Model_ActionLog::getType(), 'sUrl' => Util_Uri::getCurrUrl()); Model_ActionLog::addData($aLog); } }
/** * 执行Action前执行 * * @see Yaf_Controller::actionBefore() */ public function actionBefore() { Model_ActionLog::setType(Model_ActionLog::TYPE_FRONT); $this->_frame = 'frame.phtml'; // 访问者的GUID $this->sVistorGuid = Util_Cookie::get('guid'); if (empty($this->sVistorGuid)) { $this->sVistorGuid = Util_Guid::get('-'); Util_Cookie::set('guid', $this->sVistorGuid, 86400 * 365); } $this->assign('sStaticRoot', 'http://' . Yaf_G::getConf('static', 'domain')); }
/** * 用户列表 */ public function logAction() { $iPage = intval($this->getParam('page')); $aWhere = array('iStatus' => 1); $aParam = $this->getParams(); if (!empty($aParam['iType'])) { $aWhere['iType'] = $aParam['iType']; } if (!empty($aParam['sUserName'])) { $aWhere['sUserName'] = $aParam['sUserName']; } if (!empty($aParam['sParam'])) { $aWhere['sParam LIKE'] = '%' . $aParam['sParam'] . '%'; } if (!empty($aParam['sSQL'])) { $aWhere['sSQL LIKE'] = '%' . $aParam['sSQL'] . '%'; } $aList = Model_ActionLog::getList($aWhere, $iPage, $this->getParam('sOrder', '')); $this->assign('aList', $aList); $this->assign('aParam', $aParam); $this->assign('aType', array(1 => '前后', 2 => '后台')); }
/** * 设置当前类型 * @param unknown $iType */ public static function setType($iType) { self::$_iType = $iType; }