Joined on Rank: Role: Packs Uploaded: Posts posted: Answered Questions: Edit Profile Logout If you want to change the password go below. Type Old Password New Password Change your profile image. Edit profile image? Kindly paste the link of an image.Upload your image here and paste below the url. Save Settings let tempInfos = ''; // RUN if(localStorage.getItem('loginUser')) { displayInformations(); } else { document.querySelector('.main').style.display = 'none'; window.location.href = 'https://storehaccounts.blogspot.com/p/create-account-with-ptc.html'; } function logout() { localStorage.removeItem('loginUser'); localStorage.removeItem('loginUserImg'); localStorage.removeItem('loginUserDisplayName'); window.location.href = 'https://storehaccounts.blogspot.com/'; } function openLink() { window.open('https://imgtr.ee/?lang=en', '_blank'); } function edit() { if(document.querySelector('#editForm').style.display == 'none') document.querySelector('#editForm').style.display = 'block'; else document.querySelector('#editForm').style.display = 'none'; clear(); } function clear() { for(i=0; i<document.querySelectorAll('#editForm input').length; i++) document.querySelectorAll('#editForm input')[i].value = ''; } function editAccount() { if(document.querySelectorAll('#editForm input')[0].value && document.querySelectorAll('#editForm input')[1].value) { if(document.querySelectorAll('#editForm input')[0].value == atob(tempInfos[1].split(':')[1])) { let temp = tempInfos[1].split(':'); temp[1] = btoa(document.querySelectorAll('#editForm input')[1].value); tempInfos[1] = temp.join(':'); saveAccount(); } else { window.alert('Invalid old password, please try again.'); clear(); } } if(document.querySelectorAll('#editForm input')[2].value) { document.querySelector('#profileImg').src = document.querySelectorAll('#editForm input')[2].value; let temp = tempInfos[4].split('|'); temp[1] = document.querySelectorAll('#editForm input')[2].value; tempInfos[4] = temp.join('|'); saveAccount(); } } async function saveAccount() { await insertData('ptc-user.txt', tempInfos.join('\\n'), localStorage.getItem('loginUser')); window.alert('Account has been saved.'); edit(); } function insertData(file, content, id) { // Get the old record '7a708887ca818fc4c0302f53efad2553' // Insert the new record $.ajax({ url: 'https://api.github.com/gists/' + id, type: 'PATCH', beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "token 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"); }, data: '{"description": "updated gist via ajax","public": true,"files": {"' + file + '": {"content": "' + content + '"}}}' }).done(function(response) { console.log(response); }); } async function displayInformations() { await getGistFile(localStorage.getItem('loginUser'), 'ptc-user.txt'); let prof = document.querySelectorAll('.profile *'); let prof1 = document.querySelectorAll('.profile span'); tempInfos = tempInfos.split('\n'); console.log(tempInfos); localStorage.setItem('loginUserImg', tempInfos[4].split('|')[1]); localStorage.setItem('loginUserDisplayName', tempInfos[2].split(':')[1]); document.querySelector('#nav_profile_img').src = localStorage.getItem('loginUserImg'); document.querySelector('#account_name').innerText = localStorage.getItem('loginUserDisplayName'); prof[0].src = tempInfos[4].split('|')[1]; //img prof1[0].innerHTML = tempInfos[2].split(':')[1]; //display name prof1[1].innerHTML = tempInfos[0].split(':')[1]; //username prof1[2].innerHTML = tempInfos[3].split(':')[1]; //joined prof1[3].innerHTML = tempInfos[5].split(':')[1]; //rank prof1[4].innerHTML = tempInfos[6].split(':')[1]; //role prof1[5].innerHTML = tempInfos[7].split(':')[1]; //packs prof1[6].innerHTML = tempInfos[8].split(':')[1]; //posts prof1[7].innerHTML = tempInfos[9].split(':')[1]; //answered } function getGistFile(gist, filename) { return $.ajax({ url: 'https://api.github.com/gists/' + gist, type: 'GET', dataType: 'jsonp', success: function(gistdata) { var content = gistdata.data.files[filename].content; tempInfos = content; }, error: function(e) { window.alert(e); } }); }