|
|
@ -67,7 +67,9 @@ deviceModule = function () {
|
|
|
|
var carbonUser = session.get(constants["USER_SESSION_KEY"]);
|
|
|
|
var carbonUser = session.get(constants["USER_SESSION_KEY"]);
|
|
|
|
if (!carbonUser) {
|
|
|
|
if (!carbonUser) {
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
throw constants["ERRORS"]["USER_NOT_FOUND"];
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var userName = carbonUser.username + "@" + carbonUser.domain;
|
|
|
|
var userName = carbonUser.username + "@" + carbonUser.domain;
|
|
|
|
var locationHistory = [];
|
|
|
|
var locationHistory = [];
|
|
|
@ -261,7 +263,9 @@ deviceModule = function () {
|
|
|
|
url, function (responsePayload) {
|
|
|
|
url, function (responsePayload) {
|
|
|
|
if(!responsePayload["responseText"]){
|
|
|
|
if(!responsePayload["responseText"]){
|
|
|
|
log.error("Error while fetching device count. API `" + url + "` returns HTTP: " + responsePayload["status"]);
|
|
|
|
log.error("Error while fetching device count. API `" + url + "` returns HTTP: " + responsePayload["status"]);
|
|
|
|
throw constants["ERRORS"]["UNKNOWN_ERROR"];
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return parse(responsePayload["responseText"])["count"];
|
|
|
|
return parse(responsePayload["responseText"])["count"];
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -272,7 +276,9 @@ deviceModule = function () {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
throw constants["ERRORS"]["USER_NOT_FOUND"];
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -300,7 +306,9 @@ deviceModule = function () {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
throw constants["ERRORS"]["USER_NOT_FOUND"];
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -369,7 +377,9 @@ deviceModule = function () {
|
|
|
|
var carbonUser = session.get(constants["USER_SESSION_KEY"]);
|
|
|
|
var carbonUser = session.get(constants["USER_SESSION_KEY"]);
|
|
|
|
if (!carbonUser) {
|
|
|
|
if (!carbonUser) {
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
throw constants["ERRORS"]["USER_NOT_FOUND"];
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var userName = carbonUser.username + "@" + carbonUser.domain;
|
|
|
|
var userName = carbonUser.username + "@" + carbonUser.domain;
|
|
|
|
var config = {};
|
|
|
|
var config = {};
|
|
|
|