ACIL FM
Dark
Refresh
Current DIR:
/home/mhhtmff/app/NH-HR-test/mb/scripts
/
home
mhhtmff
app
NH-HR-test
mb
scripts
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
bacheca.js
2.85 MB
chmod
View
DL
Edit
Rename
Delete
bootstrap.min.js
216.1 MB
chmod
View
DL
Edit
Rename
Delete
custom.js
88.73 MB
chmod
View
DL
Edit
Rename
Delete
globals.js
1.04 MB
chmod
View
DL
Edit
Rename
Delete
login.js
8.03 MB
chmod
View
DL
Edit
Rename
Delete
permission.js
10.14 MB
chmod
View
DL
Edit
Rename
Delete
profile.js
9.22 MB
chmod
View
DL
Edit
Rename
Delete
stamp.js
17.93 MB
chmod
View
DL
Edit
Rename
Delete
transfer.js
8.74 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/mhhtmff/app/NH-HR-test/mb/scripts/profile.js
function updateProfile() { var email = document.querySelector('#profile_email').value; var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!email.match(validRegex)) { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Email non valida" }); exit; } $.ajax({ type: "POST", url: "php/profile/update_profile.php", data: { email: email }, success: function (res) { if (res === 'error') { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Errore: " + res }); exit; } else { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "success", title: "Profilo aggiornato" }); location.reload(); } } }); } function sendVerificationCode() { $.ajax({ type: "POST", url: "php/profile/send_verification_code.php", data: { }, success: function (res) { if (res == "ok") { document.querySelector('#password_reset_content').style.display="none"; document.querySelector('#otp_verification_content').style.display="block"; } else { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Email non inviata" }); } } }); } function checkVerificationCode() { var otp_num_1 = document.querySelector('#otp_num_1').value; var otp_num_2 = document.querySelector('#otp_num_2').value; var otp_num_3 = document.querySelector('#otp_num_3').value; var otp_num_4 = document.querySelector('#otp_num_4').value; $.ajax({ type: "POST", url: "php/profile/check_verification_code.php", data: { otp_num_1 : otp_num_1, otp_num_2 : otp_num_2, otp_num_3 : otp_num_3, otp_num_4 : otp_num_4}, success: function (res) { if (res == "ok") { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "success", title: "Codice corretto" }); document.querySelector('#otp_verification_content').style.display="none"; openPasswordReset(); } else { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Codice non valido" }); } } }); } function openPasswordReset() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { document.querySelector("#password_reset_content").innerHTML = this.responseText; document.querySelector("#password_reset_content").style.display="block"; } }; xmlhttp.open("GET", "php/profile/password_reset_content.php"); xmlhttp.send(); } function changePassword() { var new_password = document.querySelector("#new_pass").value; var repeat_new_password = document.querySelector("#repeat_new_pass").value; if(new_password != repeat_new_password) { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Le password non sono uguali" }); exit; } if(new_password.length < 8) { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "La password deve essere di almeno 8 caratteri" }); exit; } if(/\d/.test(new_password) == false) { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "La password deve contenere almeno un numero" }); exit; } var special_char = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/; if(special_char.test(new_password) == false) { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "La password deve contenere almeno un carattere speciale" }); exit; } $.ajax({ type: "POST", url: "php/profile/change_password.php", data: { new_password : new_password}, success: function (res) { if (res == "ok") { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "success", title: "Password modificata. Disconnessione..." }); setTimeout(() => { window.location.href = "php/logout.php"; }, 2000); } else { const Toast = Swal.mixin({ toast: true, position: "bottom", showConfirmButton: false, timer: 3000, timerProgressBar: true, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); Toast.fire({ icon: "error", title: "Password non cambiata" }); } } }); }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply