fix could not unregister if multiple users existed
This commit is contained in:
@@ -9,9 +9,7 @@ if (!session_data.getSessionData("registered")) {
|
||||
var redirect = [5, "client:relogin?"];
|
||||
var message = "Error: Your box is not registered. You are accessing " + minisrv_config.config.service_name + " in Guest Mode. There is nothing to delete!";
|
||||
} else if (session_data.user_id !== 0) {
|
||||
headers += "\nwtv-noback-all: wtv-";
|
||||
headers += "\nwtv-expire-all: wtv-";
|
||||
var redirect = [5, "wtv-tricks:/tricks"];
|
||||
var redirect = [5, "client:relogin?"];
|
||||
var message = "Error: You must be the primary user to unregister this box.";
|
||||
} else if (request_headers.query.confirm_unregister) {
|
||||
if (session_data.unregisterBox()) {
|
||||
|
||||
@@ -91,7 +91,7 @@ class WTVClientSessionData {
|
||||
}
|
||||
|
||||
switchUserID(user_id, update_mail = true, update_ticket = true, update_favorite = true) {
|
||||
this.user_id = user_id;
|
||||
this.user_id = parseInt(user_id);
|
||||
if (user_id != null) {
|
||||
this.loadSessionData();
|
||||
if (this.isRegistered() && update_mail) this.assignMailStore();
|
||||
|
||||
Reference in New Issue
Block a user