Skip to content

Commit

Permalink
Merge pull request #205 from Panopto/2023083100_release_code
Browse files Browse the repository at this point in the history
2023083100 release code
  • Loading branch information
zeroAps authored Aug 31, 2023
2 parents 857a85a + b40ea93 commit 2ff5dc0
Show file tree
Hide file tree
Showing 36 changed files with 1,087 additions and 169 deletions.
23 changes: 23 additions & 0 deletions edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected function specific_definition($mform) {

$mform->addElement('select', 'config_course', get_string('existing_course', 'block_panopto'),
$courselist['courses']);
$mform->addHelpButton('config_course', 'existing_course', 'block_panopto');
$mform->setDefault('config_course', $courselist['selected']);

// Set course context to get roles.
Expand Down Expand Up @@ -115,6 +116,28 @@ protected function specific_definition($mform) {
$mform->addElement('static', 'error', '', get_string('block_edit_error', 'block_panopto'));
}
}

/**
* Custom form validation
*
* @param array $data
* @param array $files
* @return array
*/
public function validation($data, $files) {
$errors = parent::validation($data, $files);

// Check to determine if folder is inheriting permissions.
$panoptodata = new \panopto_data($this->page->course->id);
$isfolderinheritingpermissions = $panoptodata->is_folder_inheriting_permissions($data['config_course']);

// If folder is inheriting permissions, display error.
if ($isfolderinheritingpermissions) {
$errors['config_course'] = get_string('block_edit_error_inherited_permissions', 'block_panopto');
}

return $errors;
}
}

/* End of file edit_form.php */
18 changes: 10 additions & 8 deletions lang/en/block_panopto.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$string['attempt_unprovision_course'] = 'Attempting to unprovision a Panopto folder with an external Id of {$a}.';
$string['attempted_target_course_id'] = 'Moodle Id of the target course';
$string['attribute_ensure_branch_failed'] = 'Ensure branch error';
$string['attribute_ensured_branch'] = 'Ensured branch heirarchy';
$string['attribute_ensured_branch'] = 'Ensured branch hierarchy';
$string['attribute_new_name'] = 'New folder name';
$string['attribute_original_name'] = 'Original folder name';
$string['attribute_target_branch_leaf'] = 'Target branch leaf node category name';
Expand All @@ -52,6 +52,7 @@
$string['begin_building_category_structure'] = 'Start building category structure';
$string['begin_reinitializing_imports'] = 'Begin reinitializing imports';
$string['block_edit_error'] = 'Cannot configure block instance: Global configuration incomplete. Please contact your system administrator.';
$string['block_edit_error_inherited_permissions'] = 'This folder inherits its sharing permissions access from a parent folder and therefore cannot be tied to a course. Please adjust the sharing setting to remove the inherited settings.';
$string['block_edit_header'] = 'Select the Panopto course folder to display in this block.';
$string['block_edit_header_help'] = 'Choose an existing Panopto course folder or provision a new Panopto course folder for this block';
$string['block_global_add_courses'] = 'Add Moodle courses to Panopto';
Expand Down Expand Up @@ -123,10 +124,10 @@
$string['block_panopto_sso_sync_type_desc'] = 'Select the behavior for user syncing when accessing Panopto content. Users can be synced at the same time as they are logged into Panopto, or in the background using an asynchronous task after they have successfully logged in.';
$string['block_panopto_sync_after_login'] = 'Authenticate and Sync to Panopto on Moodle Login (not recommended)';
$string['block_panopto_sync_after_login_desc'] = 'When selected, users are authenticated with Panopto and their permissions are synced when logging in to Moodle. Typically, authentication and permission sync will occur when a user accesses Panopto in the course and as such, we only recommend that organizations turn this setting on if they do not place the Panopto block in Moodle (not recommended). Additionally, log-in time will be extended if this option is selected.';
$string['block_panopto_sync_after_provisioning'] = 'Sync Enroled Users after Successfully Provisioning (not recommended)';
$string['block_panopto_sync_after_provisioning_desc'] = 'When selected, all users enroled in a course will be synchronized after provisioning. Typically, when a user accesses the Panopto block in a course, authentication and permission sync of that course happen. As such, we only recommend that organizations turn this setting on if they do not place the Panopto block in Moodle (not recommended).';
$string['block_panopto_sync_after_provisioning'] = 'Sync Enrolled Users after Successfully Provisioning (not recommended)';
$string['block_panopto_sync_after_provisioning_desc'] = 'When selected, all users enrolled in a course will be synchronized after provisioning. Typically, when a user accesses the Panopto block in a course, authentication and permission sync of that course happen. As such, we only recommend that organizations turn this setting on if they do not place the Panopto block in Moodle (not recommended).';
$string['block_panopto_sync_on_enrolment'] = 'Sync Users after Class Enrolment (optional)';
$string['block_panopto_sync_on_enrolment_desc'] = 'When selected, the permission when a student is enroled into a course is synchronized with a valid Panopto folder. When disabled, users will be synced with Panopto when the user views the Panopto block. If you do not intend to use the block in a course, or if a course has embedded Panopto content directly into the course homepage (content will load before the block syncs in this case), this feature can be enabled. Note: Enabling this feature may cause a performance slowdown when enroling users.';
$string['block_panopto_sync_on_enrolment_desc'] = 'When selected, the permission when a student is enrolled into a course is synchronized with a valid Panopto folder. When disabled, users will be synced with Panopto when the user views the Panopto block. If you do not intend to use the block in a course, or if a course has embedded Panopto content directly into the course homepage (content will load before the block syncs in this case), this feature can be enabled. Note: Enabling this feature may cause a performance slowdown when enroling users.';
$string['block_panopto_wsdl_proxy_host'] = 'WSDL Proxy Host';
$string['block_panopto_wsdl_proxy_host_desc'] = 'Optionally, you can add in the host address used as a proxy for any Panopto service WSDL.';
$string['block_panopto_wsdl_proxy_port'] = 'WSDL Proxy Port';
Expand Down Expand Up @@ -180,8 +181,9 @@
$string['error_no_admin_account_found'] = 'Error: No admin account was found';
$string['error_retrieving'] = 'Error retrieving Panopto course folder. Please check the PHP error_log for more details.';
$string['existing_course'] = 'Select an existing Panopto folder that is not currently mapped to another course:';
$string['existing_course_help'] = 'Please note that we cannot map to the assignment folders or folders with inherited permissions.';
$string['fetching_content'] = 'Fetching Panopto content...';
$string['folder_not_found_error'] = 'The folder currenty provisioned to the target Moodle course on the Panopto server could not be found, was it deleted? Provisioning will continue by linking to the default Moodle folder or creating one if it does not already exist.';
$string['folder_not_found_error'] = 'The folder currently provisioned to the target Moodle course on the Panopto server could not be found, was it deleted? Provisioning will continue by linking to the default Moodle folder or creating one if it does not already exist.';
$string['get_provisioning_info'] = 'Attempting to get provisioning info for a course with the Moodle Id: {$a}.';
$string['groups_getting_synced'] = 'Groups to be synced with this call: {$a}';
$string['impacted_server'] = 'Impacted server: {$a}';
Expand Down Expand Up @@ -213,7 +215,7 @@
$string['no_publishers'] = 'No publishers.';
$string['no_server'] = 'There are no servers set up for provisioning. Please contact system administrator.';
$string['no_viewers'] = 'No viewers.';
$string['no_users_synced_desc'] = 'Any users enroled in the course will be synced to Panopto once they view the Panopto block in a course.';
$string['no_users_synced_desc'] = 'Any users enrolled in the course will be synced to Panopto once they view the Panopto block in a course.';
$string['or'] = 'OR';
$string['panopto:addinstance'] = 'Add a new Panopto block';
$string['panopto:myaddinstance'] = 'Add a new Panopto block to my page';
Expand Down Expand Up @@ -260,7 +262,7 @@
$string['show_less'] = 'Show less';
$string['sso_invalid_authcode'] = 'Invalid auth code.';
$string['sso_invalid_server'] = 'Invalid Panopto Server. Server needs to be configured in Panopto block config before use.';
$string['sso_type_asyncsync'] = 'Make asnchronous sync task on Panopto login';
$string['sso_type_asyncsync'] = 'Make asynchronous sync task on Panopto login';
$string['sso_type_nosync'] = 'Do not sync on Panopto login';
$string['sso_type_sync'] = 'Sync on Panopto login';
$string['synced_user_info'] = 'Synced user information';
Expand All @@ -279,7 +281,7 @@
$string['unprovisioncourseselect'] = 'Select which courses you want to unprovision from Panopto';
$string['unprovisioncourseselect_help'] = 'Multiple selections are possible by Ctrl-clicking (Windows) or Cmd-clicking (Mac).';
$string['unprovisioned'] = 'This course has not yet been provisioned.';
$string['upgrade_panopto_required_version'] = 'A Panopto server you are using does not meet the minimum required version to support this version of the Moodle Panopto Block. The upgrade will be blocked from succeeding until all Panopto servers in use meet miniumum version requirements.';
$string['upgrade_panopto_required_version'] = 'A Panopto server you are using does not meet the minimum required version to support this version of the Moodle Panopto Block. The upgrade will be blocked from succeeding until all Panopto servers in use meet minimum version requirements.';
$string['users_have_been_synced'] = 'The below users have been synced and should be ready to use Panopto.';
$string['users_will_be_synced_custom'] = 'Future users will automatically be synced according to your custom Panopto settings.';
$string['verifying_permission'] = 'Verifying permission';
Expand Down
44 changes: 20 additions & 24 deletions lib/AuthManagement/AuthManagementWsdlClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ public function length()
* @uses AuthManagementWsdlClass::getInternArrayToIterateIsArray()
* @return int
*/
public function count()
public function count(): int
{
return $this->getInternArrayToIterateIsArray()?count($this->getInternArrayToIterate()):-1;
}
Expand All @@ -640,45 +640,45 @@ public function count()
* @uses AuthManagementWsdlClass::offsetGet()
* @return mixed
*/
public function current()
public function current(): mixed
{
return $this->offsetGet($this->internArrayToIterateOffset);
}
/**
* Method moving the current position to the next element
* @uses AuthManagementWsdlClass::getInternArrayToIterateOffset()
* @uses AuthManagementWsdlClass::setInternArrayToIterateOffset()
* @return int
* @return void
*/
public function next()
public function next(): void
{
return $this->setInternArrayToIterateOffset($this->getInternArrayToIterateOffset() + 1);
$this->setInternArrayToIterateOffset($this->getInternArrayToIterateOffset() + 1);
}
/**
* Method resetting itemOffset
* @uses AuthManagementWsdlClass::setInternArrayToIterateOffset()
* @return int
* @return void
*/
public function rewind()
public function rewind(): void
{
return $this->setInternArrayToIterateOffset(0);
$this->setInternArrayToIterateOffset(0);
}
/**
* Method checking if current itemOffset points to an existing item
* @uses AuthManagementWsdlClass::getInternArrayToIterateOffset()
* @uses AuthManagementWsdlClass::offsetExists()
* @return bool true|false
*/
public function valid()
public function valid(): bool
{
return $this->offsetExists($this->getInternArrayToIterateOffset());
}
/**
* Method returning current itemOffset value, alias to getInternArrayToIterateOffset
* @uses AuthManagementWsdlClass::getInternArrayToIterateOffset()
* @return int
* @return mixed
*/
public function key()
public function key(): mixed
{
return $this->getInternArrayToIterateOffset();
}
Expand Down Expand Up @@ -767,7 +767,7 @@ public function last()
* @param int $_offset
* @return bool true|false
*/
public function offsetExists($_offset)
public function offsetExists($_offset): bool
{
return ($this->getInternArrayToIterateIsArray() && array_key_exists($_offset,$this->getInternArrayToIterate()));
}
Expand All @@ -777,29 +777,25 @@ public function offsetExists($_offset)
* @param int $_offset
* @return mixed
*/
public function offsetGet($_offset)
public function offsetGet($_offset): mixed
{
return $this->offsetExists($_offset)?$this->internArrayToIterate[$_offset]:null;
}
/**
* Method useless but necessarly overridden, can't set
* @param mixed $_offset
* @param mixed $_value
* @return null
* @return void
*/
public function offsetSet($_offset,$_value)
{
return null;
}
public function offsetSet($_offset,$_value): void
{}
/**
* Method useless but necessarly overridden, can't unset
* @param mixed $_offset
* @return null
* @return void
*/
public function offsetUnset($_offset)
{
return null;
}
public function offsetUnset($_offset): void
{}
/**
* Method returning current result from Soap call
* @return mixed
Expand Down Expand Up @@ -1008,7 +1004,7 @@ public function __construct ($wsdl, array $options = null) {
* @param string $version
* @param int $one_way
*/
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
public function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
if (get_config('block_panopto', 'enforce_https_on_wsdl')) {
$location = str_replace('http://', 'https://', $location);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public function setFolderWithExternalContext($_folderWithExternalContext)
/**
* Returns the current element
* @see SessionManagementWsdlClass::current()
* @return SessionManagementStructFolderWithExternalContext
* @return mixed
*/
public function current()
public function current(): mixed
{
return parent::current();
}
Expand Down Expand Up @@ -117,9 +117,9 @@ public function last()
* Returns the element at the offset
* @see SessionManagementWsdlClass::last()
* @param int $_offset
* @return SessionManagementStructFolderWithExternalContext
* @return mixed
*/
public function offsetGet($_offset)
public function offsetGet($_offset): mixed
{
return parent::offsetGet($_offset);
}
Expand Down
Loading

0 comments on commit 2ff5dc0

Please sign in to comment.