Implements language selection

This commit is contained in:
Simone Mainardi 2017-07-18 20:24:55 +02:00
parent 4d69182c89
commit 7ed1e49888
13 changed files with 201 additions and 17 deletions

View file

@ -12,6 +12,7 @@ local username = _POST["username"]
local host_role = _POST["user_role"]
local networks = _POST["allowed_networks"]
local allowed_interface = _POST["allowed_interface"]
local language = _POST["user_language"]
-- for captive portal users
local old_host_pool_id = _POST["old_host_pool_id"]
@ -56,6 +57,13 @@ if(allowed_interface ~= nil) then
end
end
if(language ~= nil) then
if(not ntop.changeUserLanguage(username, language)) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the user language\" }")
return
end
end
if(limited_lifetime ~= nil) then
if not ntop.addUserLifetime(username, lifetime_secs) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the host lifetime\" }")