diff --git a/lib/AuthManagement/AuthManagementWsdlClass.php b/lib/AuthManagement/AuthManagementWsdlClass.php index 7f7b733..6b696f7 100644 --- a/lib/AuthManagement/AuthManagementWsdlClass.php +++ b/lib/AuthManagement/AuthManagementWsdlClass.php @@ -640,7 +640,8 @@ public function count(): int * @uses AuthManagementWsdlClass::offsetGet() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return $this->offsetGet($this->internArrayToIterateOffset); } @@ -678,7 +679,8 @@ public function valid(): bool * @uses AuthManagementWsdlClass::getInternArrayToIterateOffset() * @return mixed */ - public function key(): mixed + #[\ReturnTypeWillChange] + public function key() { return $this->getInternArrayToIterateOffset(); } @@ -777,7 +779,8 @@ public function offsetExists($_offset): bool * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null; } diff --git a/lib/SessionManagement/Array/Context/SessionManagementStructArrayOfFolderWithExternalContext.php b/lib/SessionManagement/Array/Context/SessionManagementStructArrayOfFolderWithExternalContext.php index 8933e69..ca7439e 100644 --- a/lib/SessionManagement/Array/Context/SessionManagementStructArrayOfFolderWithExternalContext.php +++ b/lib/SessionManagement/Array/Context/SessionManagementStructArrayOfFolderWithExternalContext.php @@ -81,7 +81,8 @@ public function setFolderWithExternalContext($_folderWithExternalContext) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfExtendedFolder.php b/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfExtendedFolder.php index 40417c0..b911f83 100644 --- a/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfExtendedFolder.php +++ b/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfExtendedFolder.php @@ -81,7 +81,8 @@ public function setExtendedFolder($_extendedFolder) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfFolder.php b/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfFolder.php index b6ca3a6..b25c5a8 100644 --- a/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfFolder.php +++ b/lib/SessionManagement/Array/Folder/SessionManagementStructArrayOfFolder.php @@ -81,7 +81,8 @@ public function setFolder($_folder) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Note/SessionManagementStructArrayOfNote.php b/lib/SessionManagement/Array/Note/SessionManagementStructArrayOfNote.php index 43eeb02..a503df3 100644 --- a/lib/SessionManagement/Array/Note/SessionManagementStructArrayOfNote.php +++ b/lib/SessionManagement/Array/Note/SessionManagementStructArrayOfNote.php @@ -81,7 +81,8 @@ public function setNote($_note) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/OfExternalHierarchyInfo/SessionManagementStructArrayOfExternalHierarchyInfo.php b/lib/SessionManagement/Array/OfExternalHierarchyInfo/SessionManagementStructArrayOfExternalHierarchyInfo.php index a2a2222..f01340e 100644 --- a/lib/SessionManagement/Array/OfExternalHierarchyInfo/SessionManagementStructArrayOfExternalHierarchyInfo.php +++ b/lib/SessionManagement/Array/OfExternalHierarchyInfo/SessionManagementStructArrayOfExternalHierarchyInfo.php @@ -79,7 +79,8 @@ public function setExternalHierarchyInfo($_externalHierarchyInfo) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -117,7 +118,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Ofguid/SessionManagementStructArrayOfguid.php b/lib/SessionManagement/Array/Ofguid/SessionManagementStructArrayOfguid.php index 43ebe94..f9945bd 100644 --- a/lib/SessionManagement/Array/Ofguid/SessionManagementStructArrayOfguid.php +++ b/lib/SessionManagement/Array/Ofguid/SessionManagementStructArrayOfguid.php @@ -81,7 +81,8 @@ public function setGuid($_guid) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Ofstring/SessionManagementStructArrayOfstring.php b/lib/SessionManagement/Array/Ofstring/SessionManagementStructArrayOfstring.php index 065374a..9d0f901 100644 --- a/lib/SessionManagement/Array/Ofstring/SessionManagementStructArrayOfstring.php +++ b/lib/SessionManagement/Array/Ofstring/SessionManagementStructArrayOfstring.php @@ -81,7 +81,8 @@ public function setString($_string) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Role/SessionManagementStructArrayOfAccessRole.php b/lib/SessionManagement/Array/Role/SessionManagementStructArrayOfAccessRole.php index 1bede21..bd84094 100644 --- a/lib/SessionManagement/Array/Role/SessionManagementStructArrayOfAccessRole.php +++ b/lib/SessionManagement/Array/Role/SessionManagementStructArrayOfAccessRole.php @@ -80,7 +80,8 @@ public function setAccessRole($_accessRole) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -118,7 +119,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Session/SessionManagementStructArrayOfSession.php b/lib/SessionManagement/Array/Session/SessionManagementStructArrayOfSession.php index 29c9584..8b776b8 100644 --- a/lib/SessionManagement/Array/Session/SessionManagementStructArrayOfSession.php +++ b/lib/SessionManagement/Array/Session/SessionManagementStructArrayOfSession.php @@ -81,7 +81,8 @@ public function setSession($_session) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfFolderAvailabilitySettings.php b/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfFolderAvailabilitySettings.php index 5a9fdde..6383c38 100644 --- a/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfFolderAvailabilitySettings.php +++ b/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfFolderAvailabilitySettings.php @@ -81,7 +81,8 @@ public function setFolderAvailabilitySettings($_folderAvailabilitySettings) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfSessionAvailabilitySettings.php b/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfSessionAvailabilitySettings.php index 80fe3e0..38104bd 100644 --- a/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfSessionAvailabilitySettings.php +++ b/lib/SessionManagement/Array/Settings/SessionManagementStructArrayOfSessionAvailabilitySettings.php @@ -81,7 +81,8 @@ public function setSessionAvailabilitySettings($_sessionAvailabilitySettings) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/Array/State/SessionManagementStructArrayOfSessionState.php b/lib/SessionManagement/Array/State/SessionManagementStructArrayOfSessionState.php index c7529e3..962c517 100644 --- a/lib/SessionManagement/Array/State/SessionManagementStructArrayOfSessionState.php +++ b/lib/SessionManagement/Array/State/SessionManagementStructArrayOfSessionState.php @@ -80,7 +80,8 @@ public function setSessionState($_sessionState) * @see SessionManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -118,7 +119,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/SessionManagement/SessionManagementWsdlClass.php b/lib/SessionManagement/SessionManagementWsdlClass.php index 9c6f0a9..7b343e9 100644 --- a/lib/SessionManagement/SessionManagementWsdlClass.php +++ b/lib/SessionManagement/SessionManagementWsdlClass.php @@ -639,7 +639,8 @@ public function count(): int * @uses SessionManagementWsdlClass::offsetGet() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return $this->offsetGet($this->internArrayToIterateOffset); } @@ -677,7 +678,8 @@ public function valid(): bool * @uses SessionManagementWsdlClass::getInternArrayToIterateOffset() * @return int */ - public function key(): mixed + #[\ReturnTypeWillChange] + public function key() { return $this->getInternArrayToIterateOffset(); } @@ -776,7 +778,8 @@ public function offsetExists($_offset): bool * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null; } diff --git a/lib/UserManagement/Array/Group/UserManagementStructArrayOfGroup.php b/lib/UserManagement/Array/Group/UserManagementStructArrayOfGroup.php index 8143ba6..a53766b 100644 --- a/lib/UserManagement/Array/Group/UserManagementStructArrayOfGroup.php +++ b/lib/UserManagement/Array/Group/UserManagementStructArrayOfGroup.php @@ -81,7 +81,8 @@ public function setGroup($_group) * @see UserManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/UserManagement/Array/Ofguid/UserManagementStructArrayOfguid.php b/lib/UserManagement/Array/Ofguid/UserManagementStructArrayOfguid.php index 5c6d180..94cf030 100644 --- a/lib/UserManagement/Array/Ofguid/UserManagementStructArrayOfguid.php +++ b/lib/UserManagement/Array/Ofguid/UserManagementStructArrayOfguid.php @@ -81,7 +81,8 @@ public function setGuid($_guid) * @see UserManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/UserManagement/Array/Ofstring/UserManagementStructArrayOfstring.php b/lib/UserManagement/Array/Ofstring/UserManagementStructArrayOfstring.php index a52f0b4..e7142d5 100644 --- a/lib/UserManagement/Array/Ofstring/UserManagementStructArrayOfstring.php +++ b/lib/UserManagement/Array/Ofstring/UserManagementStructArrayOfstring.php @@ -81,7 +81,8 @@ public function setString($_string) * @see UserManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/UserManagement/Array/User/UserManagementStructArrayOfUser.php b/lib/UserManagement/Array/User/UserManagementStructArrayOfUser.php index 270ee26..62872b9 100644 --- a/lib/UserManagement/Array/User/UserManagementStructArrayOfUser.php +++ b/lib/UserManagement/Array/User/UserManagementStructArrayOfUser.php @@ -81,7 +81,8 @@ public function setUser($_user) * @see UserManagementWsdlClass::current() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return parent::current(); } @@ -119,7 +120,8 @@ public function last() * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return parent::offsetGet($_offset); } diff --git a/lib/UserManagement/UserManagementWsdlClass.php b/lib/UserManagement/UserManagementWsdlClass.php index d8d18a6..d582266 100644 --- a/lib/UserManagement/UserManagementWsdlClass.php +++ b/lib/UserManagement/UserManagementWsdlClass.php @@ -634,7 +634,8 @@ public function count(): int * @uses UserManagementWsdlClass::offsetGet() * @return mixed */ - public function current(): mixed + #[\ReturnTypeWillChange] + public function current() { return $this->offsetGet($this->internArrayToIterateOffset); } @@ -771,7 +772,8 @@ public function offsetExists($_offset): bool * @param int $_offset * @return mixed */ - public function offsetGet($_offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($_offset) { return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null; } diff --git a/lib/panopto_user_soap_client.php b/lib/panopto_user_soap_client.php index 0d706eb..407066c 100644 --- a/lib/panopto_user_soap_client.php +++ b/lib/panopto_user_soap_client.php @@ -149,9 +149,19 @@ public function get_user_by_key($userkey) { if ($this->usermanagementserviceget->GetUserByKey($getuserbykeyparams)) { $result = $this->usermanagementserviceget->getResult()->GetUserByKeyResult; } else { - $lasterror = $this->usermanagementserviceget->getLastError()['UserManagementServiceGet::GetUserByKey']; - \panopto_data::print_log(var_export($lasterror, true)); - throw $lasterror; + // Try again in case if username is unified i.e unified\user, but user from moodle DB is still server\user. + $username = preg_replace('/^[^\\\\]*\\\\/', 'unified\\', $userkey); + $getuserbykeyparams = new UserManagementStructGetUserByKey( + $this->authparam, + $username + ); + if ($this->usermanagementserviceget->GetUserByKey($getuserbykeyparams)) { + $result = $this->usermanagementserviceget->getResult()->GetUserByKeyResult; + } else { + $lasterror = $this->usermanagementserviceget->getLastError()['UserManagementServiceGet::GetUserByKey']; + \panopto_data::print_log(var_export($lasterror, true)); + throw $lasterror; + } } return $result; } diff --git a/version.php b/version.php index 82c4763..12e8036 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ // Plugin version should normally be the same as the internal version. // If an admin wants to install with an older version number, however, set that here. -$plugin->version = 2023083100; +$plugin->version = 2023091800; // Requires this Moodle version - 2.7. $plugin->requires = 2014051200;