const minisrv_service_file = true; const WTVAdmin = require(classPath + "/WTVAdmin.js"); const wtva = new WTVAdmin(minisrv_config, session_data, service_name); const auth = wtva.isAuthorized(); if (auth === true) { let user_info, ssid, password; let ssid_match = false; if (request_headers.Authorization) { const authheader = request_headers.Authorization.split(' '); if (authheader[0] === "Basic") { password = Buffer.from(authheader[1], 'base64').toString(); if (password) password = password.split(':')[1]; } } if (wtva.checkPassword(password)) { if (request_headers.query.ssid) { ssid = request_headers.query.ssid.toLowerCase(); user_info = wtva.getAccountInfoBySSID(ssid); if (request_headers.query.confirm_delete) { user_info = null; if (ssid === socket.ssid) { ssid_match = true; } else { // delete const userAccount = wtva.getAccountBySSID(ssid); userAccount.unregisterBox(); } } } headers = `200 OK Content-Type: text/html wtv-expire-all: wtv-admin:/deleteaccount wtv-noback-all: wtv-admin:/deleteaccount`; data = `
Delete an Account` if (ssid) { if (user_info) { data += ` User Information:
Try ${minisrv_config.config.service_name} Tricks Unregister. `; } else if (request_headers.query.confirm_delete) { data += "Account for SSID \"" + ssid + "\" has been deleted. "; } else { data += "Could not find an account for SSID \"" + ssid + "\" "; } } data += ` | ||||||||||||