Browse Source

Fix global user bbb meeting creation see BT#14069

jmontoyaa 7 years ago
parent
commit
f2e14449de
1 changed files with 3 additions and 8 deletions
  1. 3 8
      plugin/bbb/lib/bbb.lib.php

+ 3 - 8
plugin/bbb/lib/bbb.lib.php

@@ -74,11 +74,10 @@ class bbb
         $this->userSupport = isset($columns['user_id']) ? true : false;
         $this->accessUrl = api_get_current_access_url_id();
 
+        $this->enableGlobalConferencePerUser = false;
         if ($this->userSupport && !empty($isGlobalPerUser)) {
             $this->enableGlobalConferencePerUser = $this->plugin->get('enable_global_conference_per_user') === 'true' ? true : false;
             $this->userId = $isGlobalPerUser;
-        } else {
-            $this->enableGlobalConferencePerUser = false;
         }
 
         if ($this->groupSupport) {
@@ -111,7 +110,6 @@ class bbb
                 $this->userCompleteName = $userInfo['complete_name'];
             }
 
-
             $this->salt = $bbb_salt;
             $info = parse_url($bbb_host);
             $this->url = $bbb_host.'/bigbluebutton/';
@@ -307,11 +305,8 @@ class bbb
             $params['group_id'] = api_get_group_id();
         }
 
-        if ($this->isGlobalConferencePerUserEnabled()) {
-            $currentUserId = api_get_user_id();
-            if ($this->userId === $currentUserId) {
-                $params['user_id'] = $this->userId;
-            }
+        if ($this->isGlobalConferencePerUserEnabled() && !empty($this->userId)) {
+            $params['user_id'] = (int) $this->userId;
         }
 
         $params['attendee_pw'] = isset($params['attendee_pw']) ? $params['attendee_pw'] : $this->getUserMeetingPassword();