Example #1
0
function plugin_livedoor_get_user_name()
{
    global $auth_api;
    // role,name,nick,profile
    if (!$auth_api['livedoor']['use']) {
        return array('role' => Auth::ROLE_GUEST, 'nick' => '');
    }
    $obj = new auth_livedoor();
    $msg = $obj->getSession();
    $info = 'http://www.livedoor.com/';
    if (!empty($msg['livedoor_id'])) {
        return array('role' => AuthLivedoor::ROLE_AUTH_LIVEDOOR, 'nick' => $msg['livedoor_id'], 'key' => $msg['livedoor_id'], 'profile' => $info);
    }
    return array('role' => Auth::ROLE_GUEST, 'nick' => '');
}