<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class RenamesAction extends MemberAction
{
    public function run()
    {
        $uid = S::gp('uid','G',2);
        $member = $this->getMember($uid);
        if (!$member['isrename'] || ($member['isrename'] && $member['hiderename'] && CTIME < $member['hiderename']))
        {
            throw new iSystemException('此用户没有改过名字');
        }
        
        $renames = $this->db()->select()->from(Rename::table())->where('uid='.S::sqlEscape($uid))->find();
        if (empty($renames))
        {
            throw new iSystemException('此用户没有改过名字');
        }
        
        $this->getController()->render('renames', array('renames' => $renames));
    }
}