Skip to content

Commit

Permalink
2018081400 beta release code (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalmsten-panopto authored Aug 14, 2018
1 parent a34e1f5 commit 9314bb0
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 11 deletions.
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function xmldb_block_panopto_upgrade($oldversion = 0) {
$existingcoursemappings = $DB->get_records(
'block_panopto_foldermap',
null,
'moodleid, publisher_mapping, creator_mapping'
'id,moodleid,publisher_mapping,creator_mapping'
);

// Define table table where we will place all of our creator mappings.
Expand Down
2 changes: 2 additions & 0 deletions lang/en/block_panopto.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
$string['block_panopto_async_tasks_desc'] = 'Enable this option to allow the enrolment, unenrolment, and delete user tasks to happen asynchronously (may have a short delay before running)';
$string['block_panopto_folder_name_style'] = 'Panopto folder name style';
$string['block_panopto_folder_name_style_desc'] = 'Use this option to select which visual name style you wish to have for your new Panopto folders';
$string['block_panopto_enforce_https_on_wsdl'] = 'Enforce HTTPS on Panopto API calls';
$string['block_panopto_enforce_https_on_wsdl_desc'] = 'Enforce HTTPS endpoints are used for Panopto API calls (recommended to everyone)';
$string['block_panopto_wsdl_proxy_host'] = 'WSDL proxy host';
$string['block_panopto_wsdl_proxy_host_desc'] = 'The host address used as a proxy for any Panopto service WSDL. (Optional)';
$string['block_panopto_wsdl_proxy_port'] = 'WSDL proxy port';
Expand Down
33 changes: 33 additions & 0 deletions lib/AuthManagement/AuthManagementWsdlClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* @version 20150429-01
* @date 2017-05-25
*/

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

class AuthManagementWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable
{
/**
Expand Down Expand Up @@ -949,3 +952,33 @@ public function __toString()
return __CLASS__;
}
}

/**
* Class AuthManagementSoapClient
*/
class AuthManagementSoapClient extends SoapClient {

/**
* Constructor wrapper
*/
public function __construct ($wsdl, array $options = null) {
parent::__construct($wsdl, $options);
}

/**
* wrapper around dorequest so we can enforce https on all calls
*
* @param object $request - the request being made
* @param string $location - the location the request will be made to
* @param string $action
* @param string $version
* @param int $one_way
*/
public function __doRequest ($request, $location, $action, $version, $one_way = 0) {
if (get_config('block_panopto', 'enforce_https_on_wsdl')) {
$location = str_replace('http://', 'https://', $location);
}

return parent::__doRequest($request, $location, $action, $version, $one_way);
}
}
33 changes: 33 additions & 0 deletions lib/SessionManagement/SessionManagementWsdlClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* @version 20150429-01
* @date 2017-01-19
*/

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

class SessionManagementWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable
{
/**
Expand Down Expand Up @@ -949,3 +952,33 @@ public function __toString()
return __CLASS__;
}
}

/**
* Class SessionManagementSoapClient
*/
class SessionManagementSoapClient extends SoapClient {

/**
* Constructor wrapper
*/
public function __construct ($wsdl, array $options = null) {
parent::__construct($wsdl, $options);
}

/**
* wrapper around dorequest so we can enforce https on all calls
*
* @param object $request - the request being made
* @param string $location - the location the request will be made to
* @param string $action
* @param string $version
* @param int $one_way
*/
public function __doRequest ($request, $location, $action, $version, $one_way = 0) {
if (get_config('block_panopto', 'enforce_https_on_wsdl')) {
$location = str_replace('http://', 'https://', $location);
}

return parent::__doRequest($request, $location, $action, $version, $one_way);
}
}
33 changes: 33 additions & 0 deletions lib/UserManagement/UserManagementWsdlClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* @version 20150429-01
* @date 2017-01-19
*/

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

class UserManagementWsdlClass extends stdClass implements ArrayAccess,Iterator,Countable
{
/**
Expand Down Expand Up @@ -944,3 +947,33 @@ public function __toString()
return __CLASS__;
}
}

/**
* Class UserManagementSoapClient
*/
class UserManagementSoapClient extends SoapClient {

/**
* Constructor wrapper
*/
public function __construct ($wsdl, array $options = null) {
parent::__construct($wsdl, $options);
}

/**
* wrapper around dorequest so we can enforce https on all calls
*
* @param object $request - the request being made
* @param string $location - the location the request will be made to
* @param string $action
* @param string $version
* @param int $one_way
*/
public function __doRequest ($request, $location, $action, $version, $one_way = 0) {
if (get_config('block_panopto', 'enforce_https_on_wsdl')) {
$location = str_replace('http://', 'https://', $location);
}

return parent::__doRequest($request, $location, $action, $version, $one_way);
}
}
2 changes: 1 addition & 1 deletion lib/cli/upgrade_all_folders.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function upgrade_all_panopto_folders() {
'block_panopto_foldermap',
null,
null,
'moodleid'
'id,moodleid'
);

$currindex = 0;
Expand Down
10 changes: 5 additions & 5 deletions lib/panopto_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public static function get_import_list($courseid) {
'block_panopto_importmap',
array('target_moodle_id' => $courseid),
null,
'import_moodle_id'
'id,import_moodle_id'
);

$retarray = array();
Expand All @@ -703,7 +703,7 @@ public static function get_import_target_list($courseid) {
'block_panopto_importmap',
array('import_moodle_id' => $courseid),
null,
'target_moodle_id'
'id,target_moodle_id'
);

$retarray = array();
Expand Down Expand Up @@ -799,7 +799,7 @@ public static function get_moodle_course_id($sessiongroupid) {
'block_panopto_foldermap',
array('panopto_id' => $sessiongroupid),
null,
'moodleid'
'id,moodleid'
);
}

Expand Down Expand Up @@ -878,7 +878,7 @@ public static function get_course_role_mappings($moodlecourseid) {
$creatorrolesraw = $DB->get_records(
'block_panopto_creatormap',
array('moodle_id' => $moodlecourseid),
'role_id'
'id,role_id'
);

if (isset($creatorrolesraw) && !empty($creatorrolesraw)) {
Expand All @@ -891,7 +891,7 @@ public static function get_course_role_mappings($moodlecourseid) {
$pubrolesraw = $DB->get_records(
'block_panopto_publishermap',
array('moodle_id' => $moodlecourseid),
'role_id'
'id,role_id'
);

if (isset($pubrolesraw) && !empty($pubrolesraw)) {
Expand Down
1 change: 1 addition & 0 deletions lib/panopto_user_soap_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function __construct($servername, $apiuseruserkey, $apiuserauthcode) {
$apiuseruserkey);

$this->serviceparams = generate_wsdl_service_params('https://'. $servername . '/Panopto/PublicAPI/4.6/UserManagement.svc?singlewsdl');

}

/**
Expand Down
3 changes: 1 addition & 2 deletions reinitialize_imports.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ function reinitialize_all_imports() {
$courseimports = $DB->get_records(
'block_panopto_importmap',
null,
null,
'import_moodle_id,target_moodle_id'
null
);

$coursepanoptoarray = array();
Expand Down
9 changes: 9 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@
)
);

$settings->add(
new admin_setting_configcheckbox(
'block_panopto/enforce_https_on_wsdl',
get_string('block_panopto_enforce_https_on_wsdl', 'block_panopto'),
get_string('block_panopto_enforce_https_on_wsdl_desc', 'block_panopto'),
1
)
);

$settings->add(
new admin_setting_configtext_trimmed(
'block_panopto/wsdl_proxy_host',
Expand Down
2 changes: 1 addition & 1 deletion upgrade_all_folders.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function upgrade_all_panopto_folders() {
'block_panopto_foldermap',
null,
null,
'moodleid'
'id,moodleid'
);

$currindex = 0;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2018070900;
$plugin->version = 2018081400;

// Requires this Moodle version - 2.7.
$plugin->requires = 2014051200;
Expand Down

0 comments on commit 9314bb0

Please sign in to comment.