Beispiel #1
0
 /**
  * 删除帖子附件
  *
  * @param PwUserBo $user
  * @param array $attach
  * @return boolean
  */
 public function addDeleteAtachLog(PwUserBo $user, $attach)
 {
     if (!$attach) {
         return false;
     }
     $langArgs = array();
     $langArgs['{createdUser}'] = sprintf('<a href="%s" target="_blank">%s</a>', WindUrlHelper::createUrl('space/index/run', array('uid' => $user->uid)), $user->username);
     $langArgs['{attach}'] = sprintf('<a href="%s" target="_blank">%s</a>', WindUrlHelper::createUrl('bbs/read/run', array('tid' => $attach['tid']), $attach['pid'] ? $attach['pid'] : ''), $this->_buildSecurity($attach['name']));
     $_createdUser = Wekit::load('user.PwUser')->getUserByUid($attach['created_userid']);
     $dm = new PwLogDm();
     $dm->setFid($attach['fid'])->setTid($attach['tid'])->setPid($attach['pid'] ? $attach['pid'] : '')->setExtends($attach['name'])->setContent($this->getLogMsg('LOG:delete.attach.message', $langArgs))->setCreatedTime(Pw::getTime())->setCreatedUser($user->uid, $user->username)->setOperatedUser($attach['created_userid'], $_createdUser['username'])->setIp(Wind::getComponent('request')->getClientIp())->setTypeid($this->getOperatTypeid('delatc'));
     $this->_getLogDs()->addLog($dm);
     return true;
 }
 public function run($id)
 {
     if ($this->tag) {
         $data = Wekit::load('forum.PwThread')->getPost($id);
         if (!$data) {
             return false;
         }
         $tag = $this->tag;
         /* @var $logSrv PwLogService */
         $logSrv = Wekit::load('log.srv.PwLogService');
         $langArgs = array();
         $langArgs['tag_url'] = WindUrlHelper::createUrl('tag/index/view', array('name' => $tag['tag_name']));
         $langArgs['tag'] = $tag['tag_name'];
         $langArgs['content_url'] = WindUrlHelper::createUrl('bbs/read/run', array('tid' => $data['tid']), $data['pid']);
         $langArgs['content'] = $data['subject'];
         $langArgs['type'] = '帖子回复';
         $dm = new PwLogDm();
         $dm->setFid($data['fid'])->setTid($data['tid'])->setPid($data['pid'])->setOperatedUser($data['created_userid'], $data['created_username']);
         //从话题中屏蔽帖子。管理日志添加
         $logSrv->addShieldTagLog($this->srv->user, $dm, $langArgs, $this->srv->ifShield);
     }
 }