BREAKING CHANGES: (for SeCuRiTy):
By default: - `ssid_sessions[socket.ssid]` is now `session_data` - `require` is no longer allowed in user scripts To access global `socket_sessions` and `ssid_sessions`, as well as `require` additional modules, you must set `privileged: true` for the specific service. See `config.json`.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
var minisrv_service_file = true;
|
||||
var errpage = null;
|
||||
|
||||
if (ssid_sessions[socket.ssid].user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
|
||||
if (session_data.user_id != 0) errpage = wtvshared.doErrorPage(400, "You are not authorized to add users to this account.");
|
||||
|
||||
// seperate if statements as to not overwrite the first error if multiple occur
|
||||
|
||||
if (!errpage) {
|
||||
if (ssid_sessions[socket.ssid].getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
|
||||
if (session_data.getNumberOfUserAccounts() > minisrv_config.config.user_accounts.max_users_per_account) errpage = wtvshared.doErrorPage(400, "You are not authorized to add more than " + minisrv_config.config.user_accounts.max_users_per_account + ` account${minisrv_config.config.user_accounts.max_users_per_account > 1 ? 's' : ''}.`);
|
||||
}
|
||||
|
||||
if (!errpage) {
|
||||
|
||||
Reference in New Issue
Block a user