## Blocks: Microsoft Block

block_microsoft
Maintained by James McQuillan, Nima Mojgani, Zion Brewer
This block provides a user-facing menu to access various Office 365 integration features, resources, and settings.
1033 sites
22 fans

Office 365 Plugins for Moodle

#### Microsoft Block

This block provides a user-facing menu to access various Office 365 integration features, resources, and settings.

NOTE: This plugin replaces the two profile field plugins in the Office 365 plugin set: profilefield_oidc and profilefield_o365.

This is part of the suite of Office 365 plugins for Moodle.

#### Resources

Get Office 365: http://office.com/getoffice365

#### Contributing

Before we can accept your pull request, you'll need to electronically complete Microsoft's Contributor License Agreement. If you've done this for other Microsoft projects, then you're already covered.

Why a CLA? (from the FSF)

Any Microsoft trademarks and logos included in these plugins are property of Microsoft and should not be reused, redistributed, modified, repurposed, or otherwise altered or used outside of this plugin.

### Sets

This plugin is part of set Office 365.

### Contributors

Akinsaya Delamarre

### Awards

• Sat, 9 Jul 2016, 1:15 AM
We moved over to the Microsoft block a few weeks ago. Users who did not previously connect their Moodle account with their Office 365 account do not have the option to do so in the Microsoft block. I've attempted to both check and uncheck the 'Show Office 365 Connect link' option for the Microsoft block defaults, but this does not result in this option displaying for users.

Has anyone experienced this problem before? If anyone has any insight on how to fix it, it would be appreciated.
• Tue, 12 Jul 2016, 1:20 AM
Allowing OpenID Connection and Disconnection, OpenID Connection, and OpenID Disconnection for both the Authenticated user and other roles fixed the issue. The permission states that allowing could allow users to change site configuration and behavior.

Has anyone else allowed this permission for users on their site? Has anyone experienced any issues resulting from allowing this permission?

Thanks
• Thu, 11 Aug 2016, 9:41 AM
After upgrading this Microsoft block, users who did not previously connect their Moodle account with their Office 365 account do not have the option to do so in the Microsoft block. I've attempted to both check and uncheck the 'Show Office 365 Connect link' option for the Microsoft block defaults, but this does not result in this option displaying for users.

Anyone have a fix?
• Thu, 11 Aug 2016, 11:16 AM
Hi Mark - have you granted your users either the "auth/oidc:manageconnection" or "auth/oidc:manageconnectionconnect" capabilities - these capabilities are required to show this link. Older versions incorrectly did not require these capabilities (they were only checked further down the connection process).
• Thu, 11 Aug 2016, 5:11 PM
James - I later came across Thomas College's post regarding granting permissions for Authenicated Users "Allowing OpenID Connection and Disconnection". This was spot on and corrected my issue. Thanks to all for the help.
• Mon, 5 Sep 2016, 9:31 PM
Hi,

Not sure if this is at all related but it seems as though it might be. We are unable to run our daily cron. The error I have listed is as follows:

Server Time: Mon, 05 Sep 2016 13:30:46 +0000

... started 13:30:46. Current memory use 14.7MB.
!!! Coding error detected, it must be fixed by a programmer: A lock was created but not released at:

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type');$lock = $factory->get_lock(Resource id #607);$lock->release(); // Locks must ALWAYS be released like this.

!!!

Any Ideas?
• Wed, 5 Oct 2016, 12:30 PM
Hi Paul, I'm not sure why you're seeing that message - will investigate further. In the meantime, you can disable the task by going to the scheduled tasks settings page ([moodle URL]//admin/tool/task/scheduledtasks.php), clicking the gear icon next to the "Sync with SDS" and checking "Disable". Unless you are using school data sync, this task does not do anything anyway so it is safe to disable. Thanks!
• Thu, 1 Dec 2016, 3:44 PM
Hi, somebody facing the same problem with the calender? It´s just syncing one way moodle -> outlook, even if I check both ways, moodle version 2.8.12, thanks tom
• Thu, 1 Dec 2016, 5:32 PM
Sorry, cronjob was not runnning ;)
• Thu, 1 Dec 2016, 7:47 PM
Anyway looks like it´s not perfectly working, if I change or delete a calendar entry in Outlook, I can´t see the changes in Moodle
• Tue, 31 Jan 2017, 10:26 PM
This block has been very helpful for two Moodle sites that I manage! Is there a way to find out how many users have linked their accounts via the Microsoft block? We authenticate via LDAP, not Office 365 Azure, so users have to link manually.
• Fri, 3 Feb 2017, 6:21 AM
@bryce - If you can execute manual SQL queries on your database, the "mdl_auth_oidc_token" database will help you get that information. We don't currently have a front-end for that statistic though.
• Wed, 5 Apr 2017, 11:48 PM
Hello, we love this plugin but we have a problem

We are going to upgrade to Moodle 3.1 and reviewing the Groups we found that we can't see Study Groups in the Microsoft Block.

In /blocks/microsoft/block_microsoft.php on line 143 is the following code in comments:

// If (! Empty ($config ['settings_showstudygroups'])) { // Temporarily removed pending further design work. //$ Studygroups = \ local_o365 \ feature \ usergroups \ utils :: study_groups_list ($USER-> id, ['courseid' =>$ PAGE-> context-> instanceid], false, 0, 5);
//                    $Items = array_merge ($ items, \$ studygroups);
//                }

We remove the comments and we already see the list of Study Groups.

There are also two lost folders that are in Moodle 2.7
/ Moodle / blocks / microsoft / groups /
/ Moodle / blocks / microsoft / tests /

Our students and teachers are already using Study Groups and we can not remove this option.

We need help to know what files and folders to add so we not lose the functionality that was already in Moodle 2.7
• Wed, 3 May 2017, 9:17 PM
Hello, in my microsoft blocks the link to the OneNote is not showing up. Would anyone know what can be done to solve this problem? see the print https://seducgogov-my.sharepoint.com/personal/diego_rmborges_seduc_go_gov_br/_layouts/15/guestaccess.aspx?docid=0ab08381ebd2f4439aa8922717df88058&authkey=AQ47NZe2RSsBeLVoS7mEJ7o
• Tue, 26 Jun 2018, 8:03 PM
Hi I was just wondering about the progress on the School Data Sync option. Does it work? Can it create Moodle Courses and synchronise the enrolment of Students based on their membership to Office 365 Class Groups on Azure?