我正在使用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);
?>发布于 2014-02-23 18:21:41
我不太明白你的问题。但是你可以像这样访问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站点中注册时输入的用户名
https://stackoverflow.com/questions/21966900
复制相似问题