mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-77973-master' of https://github.com/snake/moodle
This commit is contained in:
commit
6732d8819d
1 changed files with 16 additions and 11 deletions
|
@ -4884,6 +4884,7 @@ class settings_navigation extends navigation_node {
|
||||||
// Send to MoodleNet.
|
// Send to MoodleNet.
|
||||||
$usercanshare = utilities::can_user_share($this->context->get_course_context(), $USER->id);
|
$usercanshare = utilities::can_user_share($this->context->get_course_context(), $USER->id);
|
||||||
$issuerid = get_config('moodlenet', 'oauthservice');
|
$issuerid = get_config('moodlenet', 'oauthservice');
|
||||||
|
try {
|
||||||
$issuer = \core\oauth2\api::get_issuer($issuerid);
|
$issuer = \core\oauth2\api::get_issuer($issuerid);
|
||||||
$isvalidinstance = utilities::is_valid_instance($issuer);
|
$isvalidinstance = utilities::is_valid_instance($issuer);
|
||||||
if ($usercanshare && $isvalidinstance) {
|
if ($usercanshare && $isvalidinstance) {
|
||||||
|
@ -4896,6 +4897,10 @@ class settings_navigation extends navigation_node {
|
||||||
$modulenode->add(get_string('moodlenet:sharetomoodlenet', 'moodle'),
|
$modulenode->add(get_string('moodlenet:sharetomoodlenet', 'moodle'),
|
||||||
$action, self::TYPE_SETTING, null, 'exportmoodlenet')->set_force_into_more_menu(true);
|
$action, self::TYPE_SETTING, null, 'exportmoodlenet')->set_force_into_more_menu(true);
|
||||||
}
|
}
|
||||||
|
} catch (dml_missing_record_exception $e) {
|
||||||
|
debugging("Invalid MoodleNet OAuth 2 service set in site administration: 'moodlenet | oauthservice'. " .
|
||||||
|
"This must be a valid issuer.");
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the module node if there are no children.
|
// Remove the module node if there are no children.
|
||||||
if ($modulenode->children->count() <= 0) {
|
if ($modulenode->children->count() <= 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue