Adobe Connect Module does not add users to Meeting Hosts group

Adobe Connect Module does not add users to Meeting Hosts group

by Scott Gage -
Number of replies: 4

Hi All,

We're currently using the Adobe Connect module with our Moodle 2.6 and Adobe Connect 9 instances. We'd previously used the 1.9 module successfully, but we're currently having an issue where Moodle accepts a user as a host or presenter (putting logging in join.php confirms this) but Adobe Connect does not then add the user to the Meeting Host group - this extract from AC's access.log shows what I mean:

RTMP meetingas3app/7/1182784 [session=1182792]: {ticket=gqyec78hw22e, reconnect=false, action=validate-user, sco-id=1182784}
RTMP meetingas3app/7/1182784 [session=1182792]: {bytesdown=0, protocol=rtmp, ticket=gqyec78hw22e, status=C, nickname=Scott Gage, action=register-client, role=m, bytesup=0, session-timeout=24}
RTMP meetingas3app/7/1182784 [session=1182792]: {logModule=meeting-usermanager, eventObject=[{meeting-sco-id=1182784, user-id=2, principal-id=617663, namespace=meeting-usermanager, eventname=user-entered},{phonenumber=undefined, username=Scott Gage, status=null, telephony-id=null, user-id=2, role=host, principal-id=617663, phonestatus=0, offline=false, mute=false}], action=meeting-event-update}
RTMP meetingas3app/7/1182784 [session=1182792]: {logModule=meeting-usermanager, eventObject={meeting-sco-id=1182784, user-id=2, role=participant, namespace=meeting-usermanager, eventname=userrole-updated}, action=meeting-event-update}
RTMP meetingas3app/7/1182784 [session=1182792]: {ticket=gqyec78hw22e, status=U, action=register-client, role=v}

 

The issue may well be on Adobe Connect's end and I'm raising a call with our provider for that as well, but thought I would check to see if any other institutions had encountered something similar.

Thanks,

Scott

Average of ratings: -
In reply to Scott Gage

Re: Adobe Connect Module does not add users to Meeting Hosts group

by John Porten -

Did you ever get this sort out by any chance?

In reply to John Porten

Re: Adobe Connect Module does not add users to Meeting Hosts group

by Scott Gage -

We did! We added the following to the function aconnect_check_user_perm in locallib.php:


   if (ADOBE_REMOVE_ROLE != $perm_type) {
        $params['filter-permission-id'] = $perm_type;
    }

    $aconnect->create_request($params);

    /**************************************
     ***  BEGIN MODIFICATION     ***
     **************************************/
     // Add the user to the System Host group when the permission is assigned.
     if ($perm_type == ADOBE_HOST_ROLE) {

         $group_id = aconnect_get_meeting_host_group($aconnect);
         if (!$ug = aconnect_add_user_to_group($aconnect, $usrprincipal, $group_id)) {
             return false;
         }
     }
    /**************************************
     ***  END MODIFICATION       ***
     **************************************/

    if ($aconnect->call_success()) {


This calls two functions I added called aconnect_get_meeting_host_group, aconnect_add_user_to_group, which I added at the bottom of locallib.php:


function aconnect_get_meeting_host_group($aconnect) {

    $params = array(
        'action'       => 'principal-list',
        'filter-type'  => 'live-admins' // the built in meeting host group is called 'live-admins'
    );

    $aconnect->create_request($params);

    $principal_id = false;

    if($aconnect->call_success()) {
        $dom = new DomDocument();
        $dom->loadXML($aconnect->_xmlresponse);

        $domnodelist = $dom->getElementsByTagName('principal');

        if (!empty($domnodelist->length)) {
            if ($domnodelist->item(0)->hasAttributes()) {
                $domnode = $domnodelist->item(0)->attributes->getNamedItem('principal-id');

                if (!is_null($domnode)) {
                    $principal_id = (int) $domnode->nodeValue;
                }
            }
        }
    }

    return $principal_id;
}

function aconnect_user_in_group($aconnect, $username, $group_id) {

    // add the user to the group
    $params = array(
        'action'           => 'principal-list',
        'filter-is-member' => 1,
        'group-id'         => $group_id,
        'filter-like-name' => $username,
    );

    $aconnect->create_request($params);

    $principal_id = false;

    if($aconnect->call_success()) {
        $dom = new DomDocument();
        $dom->loadXML($aconnect->_xmlresponse);

        $domnodelist = $dom->getElementsByTagName('principal');

        if (!empty($domnodelist->length)) {
            if ($domnodelist->item(0)->hasAttributes()) {
                $domnode = $domnodelist->item(0)->attributes->getNamedItem('principal-id');

                if (!is_null($domnode)) {
                    $principal_id = (int) $domnode->nodeValue;
                }
            }
        }
    }

    return $principal_id;
}

function aconnect_add_user_to_group($aconnect, $username = '', $group_principal_id = 0) {

    if(empty($username)) {
        return false;
    }

    if (empty($group_principal_id)) {
        return false;
    }

    // Check to see if the username has been passed in or the ID..
    if(is_string($username)) {

        // Create an object for the user
        $user = new stdClass();
        $user->username = $username;

        // Make sure the user exists and get the users principal ID if they do
        if(!$principal_id = aconnect_user_exists($aconnect, $user)) {
            return false;
        }

    } else {
        // We already have the principal id from the parent.
        $principal_id = (int)$username;
    }

    // Check to see if the user is already in the group
    if(!aconnect_user_in_group($aconnect, $username, $principal_id, $group_principal_id)) {

        // add the user to the group
        $params = array(
            'action'       => 'group-membership-update',
            'principal-id' => $principal_id,
            'group-id'     => $group_principal_id,
            'is-member'    => 1,
        );

        $aconnect->create_request($params);

        if ($aconnect->call_success()) {
            return true;
        } else {
            return false;
        }

    } else {
        return true;
    }

}

In reply to Scott Gage

Re: Adobe Connect Module does not add users to Meeting Hosts group

by Michael Gardener -

Thank you for sharing code. It worked.

In reply to Scott Gage

Re: Adobe Connect Module does not add users to Meeting Hosts group

by Jordi Pujol-Ahulló -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi!

This seems to work also for us. However, we have a license of only 25 users under group hosts. That means that above solution only works for the first 25 users entering as a HOST. Once this limit is reached, a message like this is presented to all users that are supposed to be host in that meeting:


error assign user adobe host role
<?xml version="1.0" encoding="UTF-8"?>
<params><param name="action">group-membership-update</param><param name="principal-id">38207</param><param name="group-id">20009</param><param name="is-member">1</param></params>
<?xml version="1.0" encoding="utf-8"?>
<results><status code="no-access" subcode="no-quota" type="num-of-members-quota"/></results>

preventing the user to enter to the meeting. In addition, the sysadmin receives an email when the host group is at 80%.

Had someone a similar limitation? How did you solved or bypassed it?

Jordi