Skip to content

Commit

Permalink
2017080100 release candidate. (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalmsten-panopto authored Aug 1, 2017
1 parent aaaceb0 commit 05b87f6
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 291 deletions.
2 changes: 1 addition & 1 deletion block_panopto.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public function instance_allow_config() {
* @param bool $nolongerused depcrecated variable
*/
public function instance_config_save($data, $nolongerused = false) {

if (!empty($data->course)) {

panopto_data::set_panopto_course_id($this->page->course->id, $data->course);
Expand Down Expand Up @@ -123,6 +122,7 @@ public function cron() {
$panoptodata->moodlecourseid = $course->moodleid;
$provisioningdata = $panoptodata->get_provisioning_info();
$provisioneddata = $panoptodata->provision_course($provisioningdata);

if (!empty($provisioneddata)) {
mtrace("Successfully provisioned course for $provisioneddata->ExternalCourseID");
} else {
Expand Down
46 changes: 0 additions & 46 deletions classes/rollingsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,6 @@
*/
class block_panopto_rollingsync {

/**
* Called when a user has been logged in as.
*
* @param \core\event\user_loggedinas $event
*/
public static function userloggedinas(\core\event\user_loggedinas $event) {
if (!\panopto_data::is_main_block_configured() ||
!\panopto_data::has_minimum_version()) {
return;
}

$task = new \block_panopto\task\sync_user();
$task->set_custom_data(array(
'userid' => $event->relateduserid
));

if (get_config('block_panopto', 'async_tasks')) {
\core\task\manager::queue_adhoc_task($task);
} else {
$task->execute();
}
}

/**
* Called when a user has been logged in.
*
* @param \core\event\user_loggedin $event
*/
public static function userloggedin(\core\event\user_loggedin $event) {
if (!\panopto_data::is_main_block_configured() ||
!\panopto_data::has_minimum_version()) {
return;
}

$task = new \block_panopto\task\sync_user();
$task->set_custom_data(array(
'userid' => $event->userid
));

if (get_config('block_panopto', 'async_tasks')) {
\core\task\manager::queue_adhoc_task($task);
} else {
$task->execute();
}
}

/**
* Called when a course has been created.
*
Expand Down
54 changes: 0 additions & 54 deletions classes/task/sync_user.php

This file was deleted.

8 changes: 0 additions & 8 deletions db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@

$observers = array(
// User enrolled event.
array(
'eventname' => '\core\event\user_loggedinas',
'callback' => 'block_panopto_rollingsync::userloggedinas',
),
array(
'eventname' => '\core\event\user_loggedin',
'callback' => 'block_panopto_rollingsync::userloggedin',
),
array(
'eventname' => '\core\event\course_created',
'callback' => 'block_panopto_rollingsync::coursecreated',
Expand Down
7 changes: 4 additions & 3 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ function xmldb_block_panopto_upgrade($oldversion = 0) {
update_upgrade_progress($currindex, $totalupgradesteps, $upgradestep);

$panoptocourseobjects = array();
$errorstring = get_string('upgrade_provision_access_error', 'block_panopto');

$getunamepanopto = new panopto_data(null);
$errorstring = get_string('upgrade_provision_access_error', 'block_panopto', $getunamepanopto->panopto_decorate_username($getunamepanopto->uname));
$versionerrorstring = get_string('upgrade_panopto_required_version', 'block_panopto');
$usercanupgrade = true;

Expand All @@ -306,8 +308,7 @@ function xmldb_block_panopto_upgrade($oldversion = 0) {
isset($oldpanoptocourse->panopto->applicationkey) && !empty($oldpanoptocourse->panopto->applicationkey);

if ($moodlecourseexists && $hasvalidpanoptodata) {
if (isset($oldpanoptocourse->panopto->uname) && !empty($oldpanoptocourse->panopto->uname) &&
$oldpanoptocourse->panopto->uname !== 'guest') {
if (isset($oldpanoptocourse->panopto->uname) && !empty($oldpanoptocourse->panopto->uname)) {
$oldpanoptocourse->panopto->ensure_auth_manager();
$activepanoptoserverversion = $oldpanoptocourse->panopto->authmanager->get_server_version();
if (!version_compare($activepanoptoserverversion, \panopto_data::$requiredpanoptoversion, '>=')) {
Expand Down
7 changes: 2 additions & 5 deletions lang/en/block_panopto.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@
$string['block_panopto_non_editing_teacher_provision_desc'] = 'Enable this option to allow non-editing teachers to provision Panopto course folders.';
$string['block_panopto_auto_sync_imports'] = 'Automatically grant permissions when importing a course';
$string['block_panopto_auto_sync_imports_desc'] = 'Enable this option to allow Panopto to automatically grant viewer permissions when importing a course.';
$string['block_panopto_auto_add_admins'] = 'Grant creator permissions to Moodle admins for all Panopto course folders';
$string['block_panopto_auto_add_admins_desc'] = 'Enable this option to allow Panopto to automatically grant creator permissions to Moodle admins to all Panopto folders that are provisioned for Moodle courses. (changes take effect on User login).';
$string['block_global_hostname'] = 'Panopto Server Hostname';
$string['block_global_hostname_desc'] = 'Enter the FQDN of your Panopto server.';
$string['block_global_instance_desc'] = 'Enter the Instance Name from the Panopto Identity Providers page.';
$string['block_global_instance_name'] = 'Moodle Instance Name';
$string['block_panopto_server_number_desc'] = 'Click \'Save Changes\' to update number of servers.';
$string['block_panopto_server_number_name'] = 'Number of Panopto Servers';
$string['block_panopto_async_tasks'] = 'Asynchronous enrollment sync';
$string['block_panopto_async_tasks_desc'] = 'Enable this option to allow the sync user task that happens during login to run in the background. Check this option if the login operation is taking longer than desired.';
$string['block_panopto_auto_provision'] = 'Automatically provision newly created courses';
$string['block_panopto_auto_provision_desc'] = 'Enable this option to automatically provision a Panopto course folder when a course is created.';
$string['block_panopto_prefix_new_folder_shortnames'] = 'Prefix new Panopto folder display names with the Moodle course\'s shortname.';
Expand Down Expand Up @@ -121,6 +117,7 @@
$string['select_server'] = 'Select a Panopto server';
$string['select_server_help'] = 'Choose the Panopto server where the course folders will be provisioned.';
$string['server_name'] = 'Server name';
$string['server_not_available'] = 'The Panopto server {$a} was not available. Server may be down';
$string['server_info_not_valid'] = 'The server name or application key are not valid, below are attempted values.';
$string['show_all'] = 'Show All';
$string['show_less'] = 'Show Less';
Expand All @@ -129,7 +126,7 @@
$string['unconfigured'] = 'Global configuration incomplete. Please contact your system administrator.';
$string['unknown_provisioning_error'] = "An unknown error has occurred.";
$string['unprovisioned'] = 'This course has not yet been provisioned.';
$string['upgrade_provision_access_error'] = 'UPGRADE BLOCKED: The user does not have access to a provisioned Panopto course folder. Upgrading user must have at least viewer access to all Panopto course folders. It is highly reccommended that the upgrading user is an Administrator on Panopto.';
$string['upgrade_provision_access_error'] = 'UPGRADE BLOCKED: The user {$a} does not have access to a provisioned Panopto course folder. Upgrading user must have at least viewer access to all Panopto course folders. It is highly reccommended that the upgrading user is an Administrator on Panopto.';
$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['watch_live'] = 'Watch Live';
/* End of file block_panopto.php */
Loading

0 comments on commit 05b87f6

Please sign in to comment.