Maps.php 3.25 KB
<?php

/**
 * Created by PhpStorm.
 * User: liuziyang
 * Date: 14-2-17
 * Time: 20:01
 */
class YHMAuth_Maps
{

    /**
     * 默认调度
     * @var array
     */
    static public $defaultDispatch = array(
        'signin_preDispatch' => array(
            'YHMAuth_Hook_AntiXSRFFilter'
        ),
        'signin_endDispatch' => array(
            'YHMAuth_Hook_ReleaseAntiXSRFFilter',
            'YHMAuth_Hook_AddStore'
        ),
        'register_preDispatch' => array(
            'YHMAuth_Hook_AntiXSRFFilter',
            'YHMAuth_Hook_CheckNickname'
        ),
        'register_endDispatch' => array(
            'YHMAuth_Hook_ReleaseAntiXSRFFilter',
            'YHMAuth_Hook_AddStore'
        ),
        'associate_preDispatch' => array(),
        'associate_endDispatch' => array(
            'YHMAuth_Hook_AddStore'
        ),
        'signOut_preDispatch' => array(),
        'signOut_endDispatch' => array()
    );

    /**
     *
     * signin_preDispatch       登录前
     * signin_endDispatch       登录后
     * register_preDispatch     注册前
     * register_endDispatch     注册后
     * associate_preDispatch    联合登录前
     * associate_endDispatch    联合登录后
     * signOut_preDispatch      退出前
     * signOut_endDispatch      退出后
     * @var array
     */
    static public $channelMap = array(
        'web' => array(
            'channel_name' => 'web',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_DEFAULT,
            'register_endDispatch' => array(
                'YHMAuth_Hook_AddUserBase'
            )
        ),
        'qq' => array(
            'channel_name' => 'qq',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_PLATFORM_QQ,
            'associate_endDispatch' => array(
                'YHMAuth_Hook_AddQQUserBase'
            )
        ),
        'sina' => array(
            'channel_name' => 'sina',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_PLATFORM_WEIBO,
            'associate_endDispatch' => array(
                'YHMAuth_Hook_AddWeiboUserBase'
            )
        ),
        'alipay' => array(
            'channel_name' => 'alipay',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_PLATFORM_ALIPAY,
            'associate_endDispatch' => array(
                'YHMAuth_Hook_AddUserBase'
            )
        ),
        'iphone' => array(
            'channel_name' => 'iphone',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_DEFAULT,
            'register_endDispatch' => array(
                'YHMAuth_Hook_AddUserBase'
            )
        ),
        'android' => array(
            'channel_name' => 'android',
            'channel_code' => YHMConfig_Passport::PROFILE_TYPE_DEFAULT,
            'register_endDispatch' => array(
                'YHMAuth_Hook_AddUserBase'
            )
        )
    );

    /**
     * 用户来源反序列
     * @var array
     */
    public static $userSourceReverse = array(
        0 => 'web',
        3 => 'iphone',
        4 => 'andriod',
        10 => 'qq',
        11 => 'weibo',
        12 => 'alipay'
    );

    /**
     * SSO 关联
     * @var array
     */
    public static $referToSso = array(
        1 => 1,
        2 => 2,
        10 => 4,
        11 => 3,
        12 => 5
    );
}