<?php
class TruncateAction extends ForumAction
{
    public function run()
    {
        $this->isManager();
        
        $uid = S::gp('cid','G',2);
        if (empty($uid))
        {
            throw new iSystemException('请选择要清空的用户');
        }
        $fullTable = Chat::single($this->id())->table();
        $sql = 'DELETE FROM '.$fullTable.' WHERE uid='.$uid;
        $this->db()->query($sql);
        
        iforward($this->getController()->url('system',array('s'=>'forum','c'=>'chat','id'=>$this->id())));
    }
}