Skip to content

Commit 1ad9b26

Browse files
committed
Merge branch 'master' into Release_37
2 parents 74a49b7 + e939d6a commit 1ad9b26

File tree

8 files changed

+38
-44
lines changed

8 files changed

+38
-44
lines changed

classes/local/type/base/meeting.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,11 @@ public function get_authed_host_url($authfail = false, $hostsuccess = false) {
710710
/**
711711
* Get the link for a moodle user to join the meeting.
712712
*
713-
* @param stdClass $user Moodle user record.
714-
* @param string $returnurl The url to return the use to.
715-
* @return string The moodle join url.
713+
* @param object|null $user Moodle user record.
714+
* @param string $returnurl The url to return the use to.
715+
* @return string The moodle join url.
716716
*/
717-
public function get_moodle_join_url($user, $returnurl = false) {
717+
public function get_moodle_join_url($user = null, $returnurl = false) {
718718
$gen = static::GENERATOR;
719719

720720
$xml = $gen::get_join_url($this, $user);
@@ -743,12 +743,10 @@ public function get_moodle_join_url($user, $returnurl = false) {
743743
* @return string The external join url.
744744
*/
745745
public function get_external_join_url() {
746-
if (!isset($this->meetinglink)) {
747-
$this->get_session_info(true);
748-
}
749-
750-
if (empty($this->meetinglink)) {
751-
return $this->get_old_external_join_url();
746+
// See if the link appears to be the new style already. If not, create.
747+
if (stristr($this->meetinglink, 'e.php') === false) {
748+
$this->meetinglink = $this->get_moodle_join_url();
749+
$this->save_to_db();
752750
}
753751

754752
return $this->meetinglink;

classes/local/type/base/xml_gen.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,21 @@ public static function get_host_url($meeting) {
246246

247247
/**
248248
* Provide the xml to retrieve the participant join url for a meeting.
249+
* Works with TC and MC.
249250
*
250-
* @param meeting $meeting The meeting to get the host URL for.
251-
* @param object $user The user object
252-
* @return string The XML.
251+
* @param meeting $meeting The meeting to get the host URL for.
252+
* @param object|null $user The user object. If null, get external participant link.
253+
* @return string The XML.
253254
*/
254-
public static function get_join_url($meeting, $user) {
255+
public static function get_join_url($meeting, $user = null) {
255256
$xml = '<body><bodyContent xsi:type="java:com.webex.service.binding.meeting.GetjoinurlMeeting">'.
256-
'<sessionKey>'.$meeting->meetingkey.'</sessionKey>'.
257-
'<attendeeEmail>'.$user->email.'</attendeeEmail>'.
258-
'<attendeeName>'.fullname($user).'</attendeeName>';
257+
'<sessionKey>'.$meeting->meetingkey.'</sessionKey>';
258+
259+
// User is optional.
260+
if (!is_null($user)) {
261+
$xml .= '<attendeeEmail>'.$user->email.'</attendeeEmail>'.
262+
'<attendeeName>'.fullname($user).'</attendeeName>';
263+
}
259264

260265
if (!empty($meeting->password)) {
261266
$xml .= '<meetingPW>'.$meeting->password.'</meetingPW>';

classes/local/type/meeting_center/meeting.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,4 @@ protected function process_response($response) {
9999
return true;
100100
}
101101

102-
// ---------------------------------------------------
103-
// URL Functions.
104-
// ---------------------------------------------------
105-
/**
106-
* Get the link for external users to join the meeting.
107-
*
108-
* @return string The external join url.
109-
*/
110-
public function get_old_external_join_url() {
111-
$baseurl = \mod_webexactivity\webex::get_base_url();
112-
113-
if (!isset($this->eventid)) {
114-
$this->get_info(true);
115-
}
116-
117-
$url = $baseurl.'/j.php?ED='.$this->eventid.'&UID=1';
118-
119-
return $url;
120-
}
121-
122102
}

classes/local/type/training_center/xml_gen.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ private static function training_session_xml($data) {
174174

175175
$xml .= '<enableOptions>';
176176

177+
$xml .= '<attendeeSendVideo>true</attendeeSendVideo>';
178+
177179
/*if (isset($data->allchat)) {
178180
if ($data->allchat) {
179181
$xml .= '<chatAllAttendees>true</chatAllAttendees>';

classes/user.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,20 @@ public function save_to_webex() {
446446
} else {
447447
$errors = $webex->get_latest_errors();
448448

449-
// Failure creating user. Check to see if exists.
449+
// Failure creating user.
450450
if (!isset($errors['exception'])) {
451-
throw new \invalid_response_exception('No errors found when creating users. Error expected.');
451+
throw new \invalid_response_exception('No exception found when creating users. Exception code expected.');
452452
}
453453

454454
$exception = $errors['exception'];
455+
$message = 'WebEx exception '.$exception.' when creating new user.';
456+
if (isset($errors['message'])) {
457+
$message .= ' Reason given: "' . $message . '"';
458+
}
459+
460+
$message .= "\n".get_string('user_create_exception', 'mod_webexactivity');
455461

456-
throw new \coding_exception('WebEx exception '.$exception.' when creating new user.');
462+
throw new \coding_exception($message);
457463
}
458464

459465
throw new \coding_exception('Unknown error when creating new user.');

lang/en/webexactivity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
$string['typetrainingcenter_desc'] = '';
154154
$string['undeletelink'] = '<a href="{$a->url}">Undelete</a>';
155155
$string['unknownhostwebexidexception'] = 'WebEx Host ID doesn\'t exist';
156+
$string['user_create_exception'] = 'For more information about this error, see <a href="https://github.com/merrill-oakland/moodle-mod_webexactivity/wiki/Manual#webex-exception-xxxxxxx-when-creating-new-user" target="_blank">this page</a>.';
156157
$string['usereditauto'] = 'Your WebEx user is managed internally, and cannot be edited.';
157158
$string['usereditbad'] = 'You should not have arrived at this page.';
158159
$string['usereditunabletoload'] = 'Unable to load your user from WebEx.';

settings.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
$setting = new admin_setting_configmulticheckbox('webexactivity/typemeetingcenter',
6363
get_string('typemeetingcenter', 'mod_webexactivity'),
6464
get_string('typemeetingcenter_desc', 'mod_webexactivity'),
65-
array(\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_PASSWORD_REQUIRED => 1),
65+
array(\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_INSTALLED => 1,
66+
\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_ALL => 1,
67+
\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_PASSWORD_REQUIRED => 1),
6668
$typeopts);
6769
$settings->add($setting);
6870

version.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
defined('MOODLE_INTERNAL') || die();
2727

28-
$plugin->version = 2019120500;
29-
$plugin->requires = 2017111309; // Moodle 3.4.0.
28+
$plugin->version = 2020072400;
29+
$plugin->requires = 2019052000; // Moodle 3.7.0.
3030
$plugin->component = 'mod_webexactivity';
3131
$plugin->maturity = MATURITY_STABLE;
32-
$plugin->release = '3.8.0';
32+
$plugin->release = '3.9.0';

0 commit comments

Comments
 (0)