0

我正在使用 BigBlueButton 的 php api,并试图弄清楚如何获得一个 wordpress 用户名代替用户,如果他们登录则必须输入他们的名字。如果你们中的任何一个好人可以提供帮助,将不胜感激!部分代码:

$step = 3;
    }
    break;
case 'enter':
    /*
     * The user is now attempting to join the meeting
     */

    if (trim($_REQUEST['username'])&& trim($_REQUEST['meetingID'])){
        $bbb_joinURL = BigBlueButton::joinURL($_REQUEST['meetingID'], $_REQUEST['username'],"ap", $salt, $url);
        //$joinURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?action=join&username='.urlencode($_REQUEST['$current_user']).'&meetingToken='.urlencode($_REQUEST['meetingToken']);

        if (BigBlueButton::isMeetingRunning( $_REQUEST['meetingID'], $url, $salt ))
        {
        ?>
        <script language="javascript" type="text/javascript">
          window.location.href="<?php echo $bbb_joinURL;?>";
        </script>
        <?php
        }
        else
        {
            /*
             * The meeting has not yet started, so check until we get back the status that the meeting is running
             */
            $step = 4;

            $checkMeetingStatus = BigBlueButton::getMeetingInfoURL( $_REQUEST['meetingID'], 'mp', $url, $salt );
        }
    }
    else if (!$_REQUEST['username']){
        $msg = "You must enter your name.";
        $step = 3;
    }
    break;
case 'isMeetingRunning':
    /*
     * This function proxy the request "isMeetingRunning" through PHP Script to BBB Server so we don't have any AJAX security issue
     */
    ob_clean();
    $checkMeetingStatus = BigBlueButton::isMeetingRunningURL( $_REQUEST['meetingID'], $url, $salt );
    echo file_get_contents($checkMeetingStatus);
    die;
    break;
case 'join':
    /*
     * We have an invite request to join an existing meeting and the meeting is running
     * We don't need to pass a meeting description as it's already been set by the first time the meeting was created.
     */
    $bbb_joinURL = BigBlueButton::joinURL($_REQUEST['meetingID'], $_REQUEST['username'],"ap", $salt, $url);
        ?>
4

1 回答 1

0

我不太明白你的问题。但是您可以访问 wordpress 的用户名

$user_id = get_current_user_id();
if($user_id){
    $user_information = get_userdata($user_id);
    $username = $user_information->user_login;
}
else{
//write you previous code where you ask user to post their name if not logged in 
}

在 $wpdb->users 表下,user_login 列存储用户通过 WordPress 登录面板在 WordPress 站点注册时输入的用户名

于 2014-02-23T10:21:40.537 回答