Commit 3b7f9e3f authored by Minteck's avatar Minteck 😸

Login prêt — <!> Fuite de mémoire après login

parent b50893ab
Pipeline #130111796 passed with stage
in 1 minute and 16 seconds
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' height='16' id='svg7384' xmlns:osb='http://www.openswatchbook.org/uri/2009/osb' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:svg='http://www.w3.org/2000/svg' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'>
<metadata id='metadata20854'>
<rdf:RDF>
<cc:Work rdf:about=''>
<dc:title/>
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs id='defs7386'>
<linearGradient id='linearGradient5606' osb:paint='solid'>
<stop id='stop5608' offset='0' style='stop-color:#000000;stop-opacity:1;'/>
</linearGradient>
<linearGradient id='linearGradient4526' osb:paint='solid'>
<stop id='stop4528' offset='0' style='stop-color:#ffffff;stop-opacity:1;'/>
</linearGradient>
<linearGradient id='linearGradient3600-4' osb:paint='gradient'>
<stop id='stop3602-7' offset='0' style='stop-color:#f4f4f4;stop-opacity:1'/>
<stop id='stop3604-6' offset='1' style='stop-color:#dbdbdb;stop-opacity:1'/>
</linearGradient>
</defs>
<g id='layer9' label='status' style='display:inline' transform='translate(-293.00017,47)'/>
<g id='layer2' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='layer4' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='g1812' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='g6217' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='layer3' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='g1833' style='display:inline' transform='translate(-51.999969,-320)'/>
<g id='layer1' style='display:inline' transform='translate(-51.999969,-320)'>
<path d='m 53,327.42578 c -0.0103,0.6801 0.08756,1.36907 0.300781,2.04297 C 54.153684,332.16433 56.665737,334 59.5,334 c 2.834263,0 5.346316,-1.83567 6.199219,-4.53125 0.852902,-2.69558 -0.1484,-5.63546 -2.470703,-7.25586 l -0.572266,0.82031 c 1.968157,1.37329 2.811943,3.85259 2.089844,6.13477 C 64.023994,331.45015 61.903421,333 59.5,333 c -2.403421,0 -4.523994,-1.54985 -5.246094,-3.83203 -0.722099,-2.28218 0.121687,-4.76148 2.089844,-6.13477 l -0.572266,-0.82031 c -1.741727,1.2153 -2.740579,3.17259 -2.771484,5.21289 z' id='path3202' style='color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate'/>
<path d='m 59,321 v 7 h 1 v -7 z' id='path3206' style='color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.82842755;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate'/>
</g>
</svg>
......@@ -21,6 +21,9 @@ function createWindow () {
win.setFullScreen(true);
win.debug = false;
}
win.command = null;
win.session = null;
win.windows = [];
}
app.whenReady().then(createWindow)
\ No newline at end of file
const cipc = require('electron').remote
function processCommand(command) {
cipc.getCurrentWindow().command = null;
if (command.startsWith("login:")) {
user = command.substr(6);
// Login the user
document.getElementById('wv-session').style.display = "flex";// $("#wv-session").fadeIn(200);
setInterval(() => {
document.getElementById('wv-fdm').style.display = "none";// $("#wv-fdm").fadeOut(200);
document.getElementById('wv-shell').style.display = "flex";// $("#wv-shell").fadeIn(200);
setInterval(() => {
document.getElementById('wv-session').style.display = "none";// $("#wv-session").fadeOut(200);
setInterval(() => {
cipc.getCurrentWindow().session = user;
}, 500)
}, 200)
}, 500)
}
}
setInterval(() => {
if (typeof cipc.getCurrentWindow().command == "string") {
buffer = cipc.getCurrentWindow().command;
cipc.getCurrentWindow().command = null;
processCommand(buffer);
// processCommand(cipc.getCurrentWindow().command);
buffer = undefined;
} else {
cipc.getCurrentWindow().command = null;
}
}, 500)
\ No newline at end of file
......@@ -6,8 +6,10 @@
<title>fde</title>
<link rel="stylesheet" href="../fonts/loader.css">
<link rel="stylesheet" href="../cursors/loader.css">
<script>var ipcMain = require('electron').ipcMain;</script>
<script src="commands.js"></script>
</head>
<body class="nocur" style="margin:0;background-color:black;height:100vh;">
<body class="nocur" style="margin:0;background-color:black;height:100vh;overflow:hidden;">
<div id="fde-debugger-debug" style="z-index:99999999999999999999999999;display:none;background-color:rgba(0,0,0,.75);color:white;width:156px;position:fixed;top:0;right:0;font-size:10px;font-family:'Ubuntu Mono'">
fdeDebug<br><br>Heap Used: <span id="fdedd-hu">n/a</span><br>Heap Total: <span id="fdedd-ht">n/a</span><br>Shared Memory: <span id="fdedd-rs">n/a</span><br><br><a title="Open/Close Dev Tools for the main wrapper process" onclick="ipc.getCurrentWindow().toggleDevTools()" style="cursor:pointer;">Toggle Dev Tools</a><br><a title="Force reloading the main wrapper process, killing all child processes" onclick="location.reload()" style="cursor:pointer;">Reload Wrapper</a><br><br><span id="fdedd-prc"></span>
</div>
......@@ -15,6 +17,7 @@
<webview class="nocur" id="wv-loader" src="../loader/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes webpreferences="width=100%" style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
<webview id="wv-oobe" src="../oobe/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
<webview id="wv-fdm" src="../packages/fdm/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
<webview id="wv-session" src="../packages/future-session/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
<webview id="wv-shell" src="../packages/future-shell/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
<webview id="wv-fwin" src="../packages/fwin/main.html" webpreferences="webviewTag" nodeintegration nodeintegrationinsubframes style="/*position:fixed;top:0;left:0;right:0;bottom:0;*/display:none;height:100%;"></webview>
......
......@@ -43,10 +43,19 @@
"error2": "Couldn't connect to Wi-Fi, try again later.",
"connected2": "Your computer is now connected to the following network:"
},
"fdm": {
"password": "Enter account password to login",
"confirm": "Login",
"cancel": "Cancel",
"loading": "Fetching list of users...",
"shutdown": "Shutting down...",
"invalid":"That didn't worked, check your password and try again..."
},
"phwifipasswd": "Wi-Fi Password",
"phhostname": "Computer Name",
"phuser": "Internal User Name",
"phfullname": "Full Name",
"phpassword": "Password",
"phpassrept": "Repeat Password"
"phpassrept": "Repeat Password",
"phpasswd": "Password"
}
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fdm</title>
<link rel="stylesheet" href="../../fonts/loader.css">
<link rel="stylesheet" href="../../cursors/loader.css">
<script>const $ = require('jquery');</script>
<script>var ipcRenderer = require('electron').ipcRenderer;</script>
</head>
<body>
<div id="loginbox" style="background-color:#2a001d;position:fixed;top:0;left:0;right:0;bottom:0;color:white;">
<div id="users" style="display:flex;justify-content:center;align-items:center;height:100%;">
<lang string="loading" parent="fdm"></lang>
</div>
<div id="shutdown" onclick="$('#shutdownask').fadeIn(200);require('child_process').exec('shutdown now');" style="position: fixed;bottom: 32px;height: 64px;width: 64px;right: 32px;background-color: lightgray;border-radius: 100%;display: flex;align-items: center;justify-content: center;transition: background-color 200ms;z-index: 999999999;">
<img src="../../icons/fdm/shutdown.svg" style="width: 32px;filter: brightness(0);">
</div>
<div id="logo" style="position: fixed;bottom: 32px;left:0;right:0;">
<center>
<img src="../../branding/fde-banner-white2.png" style="height: 48px;">
</center>
</div>
<style>
#shutdown:hover {
background-color: darkgray !important;
}
#shutdown:active {
background-color: gray !important;
}
.user {
width: 30%;
padding: 10px;
border-radius: 10px;
background-color: rgba(255, 255, 255, 0);
transition: background-color 200ms;
}
.user-picture {
width: 48px;
height: 48px;
border-radius: 100%;
vertical-align: middle;
margin-right: 10px;
}
.user:hover {
background-color: rgba(255, 255, 255, .25);
}
.user:active {
background-color: rgba(255, 255, 255, 0.5);
}
</style>
</div>
<div id="passaskph" style="background-color:rgba(0,0,0,.75);position:fixed;top:0;left:0;right:0;bottom:0;display:none;">
<div style="position:fixed;align-items:center;justify-content:center;display:flex;top:0;left:0;right:0;bottom:0;">
<div id="passask" style="width:256px;background-color:#eee;border-radius:10px;height:max-content;padding:20px;">
<center>
<h2><lang string="password" parent="fdm"></lang></h2>
<p><input id="password" type="password" langph="::phpasswd"></p>
<p id="passerr" style="opacity:0;transition:opacity 200ms;"><lang string="invalid" parent="fdm"></lang></p>
<button onclick="confirmLogin();"><lang string="confirm" parent="fdm"></lang></button> &nbsp; <button onclick="$('#passaskph').fadeOut(200);document.getElementById('password').value='';"><lang string="cancel" parent="fdm"></lang></button>
</center>
</div>
</div>
</div>
<div id="shutdownask" style="background-color:rgba(0,0,0,.75);position:fixed;top:0;left:0;right:0;bottom:0;display:none;">
<div style="position:fixed;align-items:center;justify-content:center;display:flex;top:0;left:0;right:0;bottom:0;">
<div id="shutdownask" style="width:256px;background-color:#eee;border-radius:10px;height:max-content;padding:20px;">
<center>
<p><lang string="shutdown" parent="fdm"></lang></p>
</center>
</div>
</div>
</div>
<script src="../fpkglang/processor.js"></script>
<script>
const fs = require('fs');
accounts = [];
str = "";
if (fs.existsSync("./user")) {
fs.readdirSync("./user").forEach((e) => {
if (fs.lstatSync("./user/" + e).isDirectory()) {
accounts.push(e);
}
})
}
accounts.forEach((e) => {
if (fs.existsSync("./user/" + e + "/profile.json")) {
str = str + "<div class=\"user\" onclick=\"askForPass('" + e + "')\">";
str = str + "<img class=\"user-picture\" src=\"../../icons/users/";
if (JSON.parse(fs.readFileSync("./user/" + e + "/profile.json")).fullname.substr(0, 1).toLowerCase().match(/^[0-9a-z]+$/)) {
str = str + JSON.parse(fs.readFileSync("./user/" + e + "/profile.json")).fullname.substr(0, 1).toLowerCase();
} else {
str = str + "spc"
}
str = str + ".png\"><span class=\"user-fullname\">" + JSON.parse(fs.readFileSync("./user/" + e + "/profile.json")).fullname + "</span>";
str = str + "</div>";
}
});
$("#users").fadeOut(200);
setTimeout(() => {
document.getElementById('users').innerHTML = str;
$("#users").fadeIn(200);
}, 200)
function askForPass(user) {
username = user;
$("#passaskph").fadeIn(200);
}
function confirmLogin() {
const bcrypt = require('bcrypt');
document.getElementById('password').disabled = true;
correctPassword = JSON.parse(fs.readFileSync("./user/" + username + "/profile.json")).password;
typedPassword = document.getElementById('password').value;
bcrypt.compare(typedPassword, correctPassword, (err, result) => {
if (result) {
$("#passaskph").fadeOut(200);
$("#users").fadeOut(200);
require('electron').remote.getCurrentWindow().command = "login:" + username;
document.getElementById('password').value = "";
} else {
document.getElementById('password').value = "";
document.getElementById('passerr').style.opacity = 1;
document.getElementById('password').disabled = false;
}
})
}
</script>
</body>
</html>
\ No newline at end of file
if (require('fs').existsSync("../user/system.json")) {
global.langprop = require("../user/system.json").lang;
} else {
global.langprop = "en";
}
function loadLang() {
global.lang = require('../../lang/' + langprop + ".json");
Array.from(document.getElementsByTagName("lang")).forEach(el => {
if (el.getAttribute("parent") == null) {
el.innerHTML = lang[el.getAttribute("string")];
} else {
el.innerHTML = lang[el.getAttribute("parent")][el.getAttribute("string")];
}
});
Array.from($("[lang^='::'")).forEach(el => { el.title = lang[el.getAttribute("lang").replace("::", "")]; });
Array.from($("[langph^='::'")).forEach(el => { el.placeholder = lang[el.getAttribute("langph").replace("::", "")]; });
}
loadLang();
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future-session</title>
<link rel="stylesheet" href="../../cursors/loader.css">
</head>
<body>
<div id="loginbox" style="background-color:#2a001d;position:fixed;top:0;left:0;right:0;bottom:0;color:white;"></div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future-shell</title>
<link rel="stylesheet" href="../../fonts/loader.css">
<link rel="stylesheet" href="../../cursors/loader.css">
<script>const $ = require('jquery');</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fwin</title>
<link rel="stylesheet" href="../../fonts/loader.css">
<link rel="stylesheet" href="../../cursors/loader.css">
<script>const $ = require('jquery');</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment