|
|
@ -49,20 +49,12 @@ function selectItemByValue(elmnt, value){ |
|
|
|
function doLogin() { |
|
|
|
function doLogin() { |
|
|
|
event.preventDefault(); |
|
|
|
event.preventDefault(); |
|
|
|
var user = document.getElementById("user").textContent |
|
|
|
var user = document.getElementById("user").textContent |
|
|
|
var password = document.getElementById("password").value |
|
|
|
|
|
|
|
var session = document.getElementById("sessions").value |
|
|
|
var session = document.getElementById("sessions").value |
|
|
|
if (!user || !password || !session) { |
|
|
|
if (!user || !session) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lightdm.cancel_authentication() |
|
|
|
lightdm.cancel_authentication(); |
|
|
|
|
|
|
|
|
|
|
|
lightdm.show_prompt.connect((text, type) => { |
|
|
|
|
|
|
|
lightdm.respond(password); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
lightdm.authentication_complete.connect(() => { |
|
|
|
|
|
|
|
lightdm.start_session(session); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateDefaults(user, session); |
|
|
|
updateDefaults(user, session); |
|
|
|
lightdm.authenticate(user) |
|
|
|
lightdm.authenticate(user) |
|
|
@ -136,6 +128,26 @@ function initGreeter() { |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("date").textContent=dateFormat(theme_utils.get_current_localized_date()); |
|
|
|
document.getElementById("date").textContent=dateFormat(theme_utils.get_current_localized_date()); |
|
|
|
document.getElementById("time").textContent=theme_utils.get_current_localized_time(); |
|
|
|
document.getElementById("time").textContent=theme_utils.get_current_localized_time(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lightdm.show_prompt.connect((text, type) => { |
|
|
|
|
|
|
|
var password = document.getElementById("password").value |
|
|
|
|
|
|
|
lightdm.respond(password); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
lightdm.authentication_complete.connect(() => { |
|
|
|
|
|
|
|
if (lightdm.is_authenticated) { |
|
|
|
|
|
|
|
var session = document.getElementById("sessions").value |
|
|
|
|
|
|
|
lightdm.start_session(session); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var password = document.getElementById("password") |
|
|
|
|
|
|
|
// Add a class that defines an animation
|
|
|
|
|
|
|
|
password.classList.add('error'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove the class after the animation completes
|
|
|
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
|
|
password.classList.remove('error'); |
|
|
|
|
|
|
|
}, 300); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("GreeterReady", initGreeter) |
|
|
|
window.addEventListener("GreeterReady", initGreeter) |
|
|
|