YSMWLogoutAction.class.php 1.3 KB
<?php
require_once dirname(__FILE__).'/../facade/YSMFLogoutFacade.class.php';
require_once dirname(__FILE__).'/common/YSMWBaseAction.class.php';

class YSMWLogoutAction extends YSMWBaseAction
{
    private $mUserLogoutFacade = null;
    
    /**
     * 初始化函数
     */
    public function __construct()
    {
        $this->mUserLogoutFacade = new YSMFLogoutFacade();
    }
    
    /**
     * 退出函数
     */
    public function logout()
    {
        $userID = $this->getUserID();
        $result = $this->mUserLogoutFacade->logout($userID);
        return $result;
    }
    
    /**
     * 设置访问规则函数
     * 
     * @return array
     */
    public function accessRule()
    {
        return array(
                        array(
                                 'allow',
                                 'actions' => array(    
                                                       'logout'
                                                   ),
                                 'users' => array('@'),
                             ),
                    );
    }
    
    /**
     * (non-PHPdoc)
     * @see YSMWBaseAction::optLoggerRule()
     */
    public function optLoggerRule()
    {
        return array(
                        'logout' => 'PS000505001',
                    );
    }
}
?>