update security handling for user namespace
This commit is contained in:
@@ -110,6 +110,14 @@ function redirect_to(mapping, variables){
|
||||
}
|
||||
window.location = QMobile.root_url() + path_mapping[mapping] + '.html?' + vars.join('&')
|
||||
}
|
||||
function direct_to_site(mapping, variables){
|
||||
variables || (variables = {});
|
||||
var vars = []
|
||||
for(var name in variables){
|
||||
vars.push(name + '=' +variables[name])
|
||||
}
|
||||
window.location = data_host + path_mapping[mapping] + '.html?' + vars.join('&')
|
||||
}
|
||||
function currency(num) {
|
||||
return Qwaiter.currency(num);
|
||||
}
|
||||
@@ -131,9 +139,11 @@ function t(path, vars){
|
||||
return result;
|
||||
}
|
||||
$.ajaxSetup({
|
||||
error: function(xhr, ajaxOptions, error){
|
||||
if(xhr.status == 401 || xhr.status == 0){
|
||||
window.location = data_host + '/user/obtain_token.html';
|
||||
error: function(xhr, ajaxOptions, error, another){
|
||||
if(xhr.status == 401){
|
||||
direct_to_site('obtain_user_token');
|
||||
}else if(xhr.status == 0){
|
||||
QMobile.connection_problem();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user