Skip to content

Commit

Permalink
Merge pull request #216 from Panopto/ahrnjica/2024070900-release-code
Browse files Browse the repository at this point in the history
2024070900 release code
  • Loading branch information
zeroAps authored Jul 9, 2024
2 parents a05f8b6 + b98f5d6 commit 2410589
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 28 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Description


## Testing
<!-- How and what have you tested? What needs later verification? -->


## Jira Link
<!-- E.g. PC-### (link to Jira will populate automatically). Optional and Jira# must still be added to the PR title. -->
14 changes: 7 additions & 7 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.0'
- php: '8.1'
moodle-branch: 'master'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
- php: '8.1'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
- php: '8.1'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'

steps:
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Panopto plugin for Moodle 2
# Panopto plugin for Moodle

## What is it?

This is a block for Moodle 2, that allows courses in Moodle to link directly to Panopto folders, and to display recordings in the sidebar. It also allows for SSO between Moodle and Panopto, and automatically syncs user permissions between both systems.
This is a block for Moodle, that allows courses in Moodle to link directly to Panopto folders, and to display recordings in the sidebar. It also allows for SSO between Moodle and Panopto, and automatically syncs user permissions between both systems.

## Credits

Expand All @@ -12,15 +12,9 @@ The original Panopto plugin was written by Panopto for Moodle 1.9 and earlier. I

Fork the block, fix a bug or add a new feature, and send us a pull-request. Or, if you're not a developer, but you've found a bug, add it to our [issue tracker](https://github.com/Panopto/Moodle-2.0-Plugin-for-Panopto/issues).

## To do:
* Move language-specific strings into lang/en/block_panopto.php
* * lib/panopto_data.php
* * SSO.php
* * views/provisioned_course.html.php

## Copyright

Copyright Panopto 2009 - 2018 / With contributions from Spenser Jones ([email protected]), Hittesh Ahuja, and Tim Lock
Copyright Panopto 2009 - 2024 / With contributions from Spenser Jones ([email protected]), Hittesh Ahuja, and Tim Lock

## License

Expand All @@ -35,4 +29,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with the Panopto plugin for Moodle. If not, see <http://www.gnu.org/licenses/>.
along with the Panopto plugin for Moodle. If not, see <http://www.gnu.org/licenses/>.
5 changes: 3 additions & 2 deletions classes/rollingsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ public static function coursedeleted(\core\event\course_deleted $event) {
* @param \core\event\course_restored $event
*/
public static function courserestored(\core\event\course_restored $event) {
if (!\panopto_data::is_main_block_configured() ||
!\panopto_data::has_minimum_version()) {
if ( !\panopto_data::is_main_block_configured()
|| !\panopto_data::has_minimum_version()
|| \panopto_data::is_block_disabled()) {
return;
}

Expand Down
18 changes: 15 additions & 3 deletions lib/panopto_category_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ class panopto_category_data {
private $moodlecategoryid;

/**
* @var string $servername
* @var int $sessiongroupid The id of the session group.
*/
private $sessiongroupid;

/**
* @var string $uname The username of the current user.
*/
private $uname;

/**
* @var string $servername The server name.
*/
private $servername;

/**
* @var int $applicationkey
* @var int $applicationkey The application key.
*/
private $applicationkey;

Expand Down Expand Up @@ -259,7 +269,9 @@ public function ensure_category_branch($usehtmloutput, $leafcoursedata) {
$currentcategory = $DB->get_record('course_categories', ['id' => $targetcategory->parent]);

while (isset($currentcategory) && !empty($currentcategory)) {
$currentcategoryname = !empty(trim($currentcategory->name)) ? $currentcategory->name : $currentcategory->id;
$currentcategoryname = !empty(trim($currentcategory->name))
? $multilanguagefilter->filter($currentcategory->name)
: $currentcategory->id;

$categoryheirarchy[] = new SessionManagementStructExternalHierarchyInfo(
false,
Expand Down
18 changes: 17 additions & 1 deletion lib/panopto_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,22 @@ public static function is_main_block_configured() {
return $isconfigured;
}

/**
* Lets us know if we have a value inside the config for a Panopto block,
* we don't want any of our events to fire on a disabled block.
*
*/
public static function is_block_disabled() {
global $DB;

$sql = "SELECT * " .
"FROM {block} b " .
"WHERE b.name = :name AND b.visible = 0";
$isblockdisabled = $DB->get_record_sql($sql, ['name' => 'panopto']);

return $isblockdisabled ? true : false;
}

/**
* Lets us know is we are using at least the minumum required version for the Panopto block
*
Expand Down Expand Up @@ -1777,7 +1793,7 @@ public function is_folder_inheriting_permissions($folderid) {
'CURLOPT_RETURNTRANSFER' => true,
'CURLOPT_HEADER' => false,
'CURLOPT_HTTPHEADER' => ['Content-Type: application/json',
'Cookie: .ASPXAUTH='.$aspxauthcookie]
'Cookie: .ASPXAUTH='.$aspxauthcookie],
];

$sockettimeout = get_config('block_panopto', 'panopto_socket_timeout');
Expand Down
22 changes: 20 additions & 2 deletions lib/panopto_session_soap_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ class panopto_session_soap_client extends PanoptoTimeoutSoapClient {
*/
private $sessionmanagementserviceget;

/**
* @var SessionManagementServiceEnsure $sessionmanagementserviceensure soap service for ensure calls
*/
private $sessionmanagementserviceensure;

/**
* @var SessionManagementServiceUnprovision $sessionmanagementserviceunprovision soap service for unprovision calls.
*/
private $sessionmanagementserviceunprovision;

/**
* @var SessionManagementServiceUpdate $sessionmanagementserviceupdate soap service for update calls.
*/
private $sessionmanagementserviceupdate;




/**
* @var string PERSONAL_FOLDER_ERROR const string to return when user attempted to provision/sync a personal folder.
* This action is not supported.
Expand Down Expand Up @@ -625,7 +643,7 @@ public function get_session_list($folderid, $sessionshavespecificorder) {
[
SessionManagementEnumSessionState::VALUE_BROADCASTING,
SessionManagementEnumSessionState::VALUE_COMPLETE,
SessionManagementEnumSessionState::VALUE_RECORDING
SessionManagementEnumSessionState::VALUE_RECORDING,
]
);

Expand Down Expand Up @@ -790,7 +808,7 @@ public function get_recorder_download_urls() {
/**
* Handle error
*
* @param string $lasterror last error message
* @param object $lasterror last error message
*/
private function handle_error($lasterror) {
$ret = new stdClass;
Expand Down
2 changes: 1 addition & 1 deletion lib/panopto_timeout_soap_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = f
'CURLOPT_RETURNTRANSFER' => true,
'CURLOPT_HEADER' => true,
'CURLOPT_HTTPHEADER' => ['Content-Type: text/xml',
'SoapAction: ' . $action]
'SoapAction: ' . $action],
];

if (!is_null($this->socket_timeout)) {
Expand Down
10 changes: 10 additions & 0 deletions lib/panopto_user_soap_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ class panopto_user_soap_client extends PanoptoTimeoutSoapClient {
*/
private $usermanagementservicecreate;

/**
* @var UserManagementServiceUpdate object used to call the user update service
*/
private $usermanagementserviceupdate;

/**
* @var UserManagementServiceDelete object used to call the user delete service
*/
private $usermanagementservicedelete;

/**
* Main constructor
*
Expand Down
2 changes: 2 additions & 0 deletions panopto_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
$course = $DB->get_record('course', ['id' => $courseid], '*', MUST_EXIST);
require_login($course);
require_sesskey();
// Close the session so that the users other tabs in the same session are not blocked.
\core\session\manager::write_close();
header('Content-Type: text/html; charset=utf-8');
global $CFG, $USER;

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

// 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 = 2024012500;
$plugin->version = 2024070900;

// Requires this Moodle version - 4.1.0.
$plugin->requires = 2022112800;
$plugin->cron = 0;
$plugin->component = 'block_panopto';
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = [
'mod_forum' => ANY_VERSION
'mod_forum' => ANY_VERSION,
];
/* End of file version.php */

0 comments on commit 2410589

Please sign in to comment.