WebUntis Integration

General plugins (Local) ::: local_webuntis
Maintained by Robert Schrenk, Zentrum für Lernmanagement, Andreas Riepl
This plugin allows an integration of Moodle with WebUntis from Untis GmbH. WebUntis is a class management schedule tool for schools.
Latest release:
78 sites
278 downloads
3 fans
Current versions available: 1

local_webuntis

This plugins allows a connection between Moodle and WebUntis Instances of https://webuntis.com.

About this plugin

This plugin allows an integration of Moodle with WebUntis. The core features are:

  • User mapping
  • User creation based on WebUntis profile data *)
  • Mapping of courses for particular links inside WebUntis (main menu and lesson pages)
  • Automatic user enrolment to courses (can be disabled in sitewide in Moodle administration or for particular courses)
  • For admins: List of user mappings

Using this plugin

To use this plugin, you need at least on WebUntis instance and a running Moodle site.

At first, login to your WebUntis instance as Administrator and add the Moodle "platform". As soon as you save the platform, oAuth credentials are transferred from WebUntis to your Moodle-Instance in the background. You can check these in the Website-Configuration of local_webuntis under the page "tenants". Also, if for any reason the automatic creation of the tenant does not work, you can create the tenant manually on this page.

Follow the required steps within WebUntis to add the platform to the various navigation nodes in WebUntis for each user role. When you're done, links to your Moodle site are shown in the main menu of WebUntis and on each lesson page. When a user clicks on such link for the first time, a mapping of user accounts is required (also for the WebUntis-Administrator!)

User mapping

Users can now choose to map an existing Moodle account, or create a new one*). Once this user map has been created, the user is automatically logged in each time. This user mapping can be disconnected by the user using the Button "Disconnect from webuntis" in the Moodle main menu.

Map user

Attention: When external login systems like oAuth are used, the login procedure opens in a new tab. This is due to the reason, that these don't allow to be embedded in an iframe. Due to technical reasons, the browser must not be run in private mode! After the user was mapped, everything runs fine within the iframe.

Tenant specific administration

Using the link to the Moodle on the main menu of WebUntis, the WebUntis-Administrator can choose a target course, and open particular settings regarding the behavior of the sync between WebUntis and Moodle. Using the trigger "Enrolment" it can be decided, if users are automatically enrolled to the course(s), when they open the link in WebUntis. Attention: this feature can be disabled globally using the Moodle site administration.

Course mapping for main menu link

At the "settings" page the WebUntis-Administrator can configure options regarding the particular Webuntis tenant. The option regarding the creation of user accounts based on WebUntis profile data must be enabled in the Moodle Website-Administration and on this page too for each WebUntis tenant. This ensures that the consent was given by the Moodle Administrator and the WebUntis Administrator as well. The mapping of user roles as shown on the following screenshot only applies to Moodle sites that use the "eduvidual"-Plugin. This plugin allows to manage several organisations within one Moodle site with separated managements. The user role of WebUntis can be mapped to each organization individually. Moodle sites that don't use eduvidual, simply do not show this option.

Tenant settings

Lastly, the WebUntis Administrator can view a list of actual user mappings.

User mappings


Future versions of this plugin may provide an option for user synchronisation, management of the user mapping by the Administrator, or bulk creation of user accounts.

Lesson specific configuration

The target course of lesson pages can be selected by Teachers and Administrators. The functionality is the same as with the main menu link. Using the trigger "Enrolment" it can be decided, if users are automatically enrolled to the course(s), when they open the link in WebUntis. Attention: this feature can be disabled globally using the Moodle site administration.

Course mapping for lessons


------------------------------------
*) Can be disabled in the Moodle Website-Administration, and requires sufficient profile data in WebUntis!

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5

Contributors

Robert Schrenk (Lead maintainer)
Zentrum für Lernmanagement
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Plugins bot
    Tue, 29 June 2021, 5:20 PM
    Approval issue created: CONTRIB-8590
  • sebastian seitz
    Fri, 15 July 2022, 3:26 AM
    Hi,

    das plugin klingt ja sehr interessant!

    Ich habe das plugin in unserem schulmoodle installiert und der webuntis Kollege hat dann den entsprechenden link zum moodle konfiguriert.

    Allerdings passiert nichts.

    Wir sehen glaube ich gerade den Wald vor lauter Bäumen nicht.
    Muss man irgendwas noch in moodle konfigurieren oder könnte etwas in moodle verstellt sein?
  • Robert Schrenk
    Fri, 15 July 2022, 3:50 AM
    Hallo,

    was genau bedeutet "der webuntis kollege hat dann den entsprechenden Link zum Moodle konfiguriert"? Man muss Moodle in WebUntis als Plattform hinzufügen. Dabei werden credentials an Moodle übermittelt. Man sollte in der Website-Administration unter Plugins / Lokale Plugins / WebUntis / Tenants eine Liste aufrufen können, in der diese Credentials zu sehen sind.

    LG
  • sebastian seitz
    Fri, 15 July 2022, 6:29 AM
    Hi,
    Vielen Dank für die schnelle Rückmeldung!

    Also ein Kollege zuständig für webuntis und ich für moodle. Also der webuntis Kollege hat die Anleitung befolgt die es in der untis Hilfe dazu gibt.

    Er hat also Moodle in webuntis als Plattform hinzugefügt.

    Aber in moodle kann ich unter

    Plugins / Lokale Plugins / WebUntis / Tenants

    Keine Zeile finden. Es klappt also nicht mit der Übergabe der credentials?

    Die Pfade in moodle sollten passen.

    Liegt in /var/www/moodle/local/webuntis/credentials.php

    Die Rechte auf die Files sind 644. Muss da was angepasst werden oder sonst was in moodle aktiviert werden damit das klappt?

    Es etwas schwierig mit der Abstimmung gerade da ich im Krankenstand bin...

    Aber ich hoffte auf einen guten Hinweis was man da falsch machen kann ;)


  • Robert Schrenk
    Fri, 15 July 2022, 1:26 PM
    Die credentials.php loggt ins Apache-Log, wenn etwas reinkommt. Da können Sie sehen, ob ein Request erfolgt und ob dieser erfolgreich ist oder nicht. Die Datei liegt in /var/log/apache2/. Bei der Übertragung werden die credentials mit einem Zertifikat signiert und in Moodle kann man die Public Keys dazu konfigurieren. Die Standard-Keys sollten aber laut Auskunft von Untis für alle passen.
  • sebastian seitz
    Fri, 15 July 2022, 8:44 PM
    Danke für den Tipp!

    In den logs hab ich jetzt mal folgendes gefunden:

    ...
    213.208.138.146 - - [14/Jul/2022:21:11:05 +0200] "POST
    /local/webuntis/credentials.php HTTP/1.1" 428 5879 "-"
    "Apache-HttpClient/4.5.13 (Java/11.0.13)"
    213.208.138.146 - - [14/Jul/2022:21:11:14 +0200] "POST
    /login/index.php/local/webuntis/credentials.php HTTP/1.1" 200 10583
    "-" "Apache-HttpClient/4.5.13 (
    Java/11.0.13)"
    95.117.83.155 - - [14/Jul/2022:21:11:31 +0200] "GET
    /login/index.php/local/webuntis/index.php?tenant_id=xxxxxxxx&school=sbs-fachinformatik
    HTTP/1.1" 200 10
    257 "https://ajax.webuntis.com/" "Mozilla/5.0 (Windows NT 10.0; Win64;
    x64; rv:102.0) Gecko/20100101 Firefox/102.0"
    ...

    Ich bin mir nicht sicher was genau ich da jetzt sehe... Das eine ist die webuntis IP, aber da gibt es zwei POST versuche, einer mit Code 428 error und der andere mit 200 OK .

    Die andere IP ist scheinbar irgendeine dynamische Telefonica IP. Da werden ja scheinbar wirklich credentials übergeben (die id habe ich mal mit xxxxxxx ersetzt), aber in moodle wird nichts eingetragen unter tenants.

    Noch irgendwelche Tipps?
  • Robert Schrenk
    Fri, 15 July 2022, 9:00 PM
    Ja, das ist aus dem Access-Log. Da sehen wir aber nur, dass der Zugriff erfolgt ist. Im error-log sollte mehr dazu stehen.
  • sebastian seitz
    Fri, 15 July 2022, 9:17 PM
    Mensch, vielen Dank, ich dachte ich hätte alle logs durchsucht und nur im access log was gefunden. Das hatte mich eh schon irritiert...

    [Thu Jul 14 17:38:09.024438 2022] [php7:notice] [pid 17268] [client 213.208.138.146:46485] Verification of signature failed using public key of production
    [Thu Jul 14 17:38:09.024554 2022] [php7:notice] [pid 17268] [client 213.208.138.146:46485] Verification of signature failed using public key of integration

    Tiptop!
    Also das war jetzt auch das einzige wo ich mir noch ein Problem vorstellen konnte. Hatte auch extra die Keys dem Kollegen geschickt zum Abgleichen...müssen wir wohl nochmal genau hinsehen.

    Vielen Dank erstmal für die tolle Hilfe!
  • sebastian seitz
    Sat, 16 July 2022, 7:06 PM
    Eine Frage hätte ich noch...

    gibt es eine Möglichkeit die beiden public keys für Integration und Produktion selbst herauszufinden?

    Es gibt scheinbar diese beiden Environments dafür...

    https://help.untis.at/hc/de/articles/4403351094034
    ---
    Environments
    Stage WebUntis (WU_URL) External API Provider (EAP_URL)
    Integration https://tom.integration.webuntis.dev/ https://api.integration.webuntis.dev/
    Production https://{host}.webuntis.com/ https://api.webuntis.com/
    ---

    Wenn ich von dort die Keys auslese und mit den in moodle hinterlegten vergleiche, passen keine zueinander!?

  • Robert Schrenk
    Sat, 16 July 2022, 7:08 PM
    Die Keys werden von der Untis GmbH erstellt. Ich habe darauf keinen Einfluss. Es kann natürlich möglich sein, dass sich diese geändert haben - aus diesem Grund lassen sich die Keys auch in der Moodle Administration ändern. Eventuell kann Ihnen da der Untis-Support Auskunft geben.
  • Tünnes Schäl
    Sat, 25 Mar 2023, 11:37 PM
    Das Plugin enthält einen Fehler, der es unmöglich macht, Moodle in einem Unterverzeichnis auf dem Webserver laufen zu lassen.

    Wenn man allerdings die Datei /local/webuntis/classes/usermap.php editiert, kommt man einen Schritt weiter:

    if (substr($_SERVER['PHP_SELF'],-31) != '/local/webuntis/landinguser.php')

    Sollte gehen...
  • Robert Schrenk
    Mon, 27 Mar 2023, 2:42 PM
    Hallo, bugs bitte immer im Issue Tracker des Plugins (GitHub) posten. Ich habe Version 1.9.4 released und das Problem behoben.
  • Margarita Krioukov
    Thu, 15 Feb 2024, 11:42 PM
    Hallo , Ich bekomme "The oAuth-endpoint of the webuntis instance is unknown" kann jemand sagen wo liegt die Problema ?Danke
Please login to post comments