mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
New client id gen, only filling pw field if user has old client ID
This commit is contained in:
parent
5ffcdcaf85
commit
7bccf3c7ee
1 changed files with 11 additions and 6 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 2.0.0.7
|
||||
// @version 2.0.1.0
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author MrFry
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
@ -1552,10 +1552,12 @@
|
|||
const loginButton = document.createElement('button')
|
||||
loginButton.innerText = 'Login'
|
||||
const loginInput = document.createElement('input')
|
||||
loginInput.type = 'text'
|
||||
loginInput.type = 'password'
|
||||
loginInput.style.textAlign = 'center'
|
||||
loginInput.value = getVal('clientId') || ''
|
||||
|
||||
if (getVal('clientId') && getVal('clientId')[0] !== 0) {
|
||||
loginInput.value = getVal('clientId') || ''
|
||||
loginInput.type = 'text'
|
||||
}
|
||||
loginDiv.appendChild(loginInput)
|
||||
loginDiv.appendChild(loginButton)
|
||||
|
||||
|
@ -1668,8 +1670,11 @@
|
|||
return currId
|
||||
} else {
|
||||
currId = new Date()
|
||||
currId = currId.getTime() + Math.floor(Math.random() * 10000000)
|
||||
setVal('clientId', currId.toString())
|
||||
currId = currId.getTime() + Math.floor(Math.random() * 1000000000000)
|
||||
currId = currId.toString().split('')
|
||||
currId.shift()
|
||||
currId = '0' + currId.join('')
|
||||
setVal('clientId', currId)
|
||||
return currId
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue