update security handling for user namespace

This commit is contained in:
2012-11-22 15:47:28 +01:00
parent b9efc6e860
commit ef31958bd6
24 changed files with 634 additions and 64 deletions
+6 -1
View File
@@ -13,7 +13,9 @@ window.Quser=
$.getJSON(data_host + '/user/list_info.json?' + authentication_string, (res) -> Quser.handle_active_list_default_actions(res))
handle_active_list: (callback) ->
$.getJSON(data_host + '/user/list_info.json?' + authentication_string, (res) ->
if !res.list_active
if(res.ok == false && res.status && res.status == 401)
direct_to_site('obtain_user_token')
else if !res.list_active
redirect_to 'user_root', {list_closed: 'true'}
return
window.active_list = res
@@ -22,6 +24,9 @@ window.Quser=
)
handle_active_list_default_actions: (response)->
response ||= {}
if(response.ok == false && response.status && response.status == 401)
direct_to_site('obtain_user_token')
return
if response.table_number
$('.table-number').text(response.table_number)
if response.supplier_name