Skip to content
Snippets Groups Projects
Unverified Commit c101c0c7 authored by Jan's avatar Jan Committed by GitHub
Browse files

Added new site & changed script name

parent 9ab4f4e2
No related branches found
No related tags found
No related merge requests found
// ==UserScript==
// @name Uni Hamburg Moodle Auto Login
// @name:de Uni-Hamburg-Moodle Auto-Login
// @name Uni Hamburg Auto Logins
// @name:de Uni Hamburg Auto-Logins
// @description Automatically logs you in to the Uni Hamburg Moodle, given automated password filling.
// @description:de Loggt Dich automatisch in das Moodle der Uni Hamburg ein, gegeben, dass die Login-Daten automatisch ausgefüllt werden.
// @description Automatically logs you in to a few different Uni Hamburg sites, given automated password filling.
// @description:de Loggt Dich automatisch in verschiedene Seiten der Uni Hamburg ein, gegeben, dass die Login-Daten automatisch ausgefüllt werden.
// @version 1.0.6
// @version 2.0.0
// @copyright 2023+, Jan G. (Rsge)
// @license Mozilla Public License 2.0
// @icon https://lernen.min.uni-hamburg.de/theme/image.php/uhh/theme/1698645195/favicon
// @icon https://www.uni-hamburg.de/favicon.ico
// @namespace https://github.com/Rsge
// @homepageURL https://github.com/Rsge/Uni-Hamburg-Moodle-Auto-Login
......@@ -17,6 +17,7 @@
// @updateURL https://update.greasyfork.org/scripts/479165/Uni%20Hamburg%20Moodle%20Auto%20Login.user.js
// @match https://lernen.min.uni-hamburg.de/login/*
// @match https://www.openolat.uni-hamburg.de/dmz/*
// @match https://login.uni-hamburg.de/idp/*
// @run-at document-end
......@@ -27,19 +28,38 @@
'use strict';
window.addEventListener('load', function() {
let firstLoginButtonElements = document.getElementsByClassName("btn login-identityprovider-btn btn-primary btn-lg btn-block");
if (firstLoginButtonElements.length > 0) {
firstLoginButtonElements[0].click();
// lernen.min.uni-hamburg.de
let lernenMINLoginButtons = document.getElementsByClassName("btn login-identityprovider-btn btn-primary btn-lg btn-block");
if (lernenMINLoginButtons.length > 0) {
lernenMINLoginButtons[0].click();
return;
}
let secondLoginButtonElements = document.getElementsByClassName("form-element form-button");
if (secondLoginButtonElements.length > 0) {
// openolat.uni-hamburg.de
let openOlatLoginButtonDivs = document.getElementsByClassName("o_block");
if (openOlatLoginButtonDivs.length > 0) {
let openOlatLoginButton = openOlatLoginButtonDivs[0].firstElementChild;
openOlatLoginButton.click();
return;
}
/*
let openOlatLoginVariantButton = document.getElementById("o_col_ShibGeneric");
if (openOlatLoginVariantButton) {
openOlatLoginVariantButton.click();
setTimeout(function() {
XXX
}
}, 800);
return;
}*/
// login.uni-hamburg.de
let loginLoginButtons = document.getElementsByClassName("form-element form-button");
if (loginLoginButtons.length > 0) {
let passwordInput = document.getElementById("password");
if (passwordInput?.value.length > 0) {
secondLoginButtonElements[0].click();
loginLoginButtons[0].click();
} else {
passwordInput.addEventListener("input", function() {
secondLoginButtonElements[0].click();
loginLoginButtons[0].click();
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment