mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
Son Goku
- Rebased sql, test, web, defintions, languages, INSTALL, and libs folders.
This commit is contained in:
parent
24de55e45a
commit
d0b12e92e7
362 changed files with 21716 additions and 7018 deletions
13
libs/auth.js
13
libs/auth.js
|
|
@ -35,6 +35,10 @@ module.exports = function(s,config,lang){
|
|||
//check IP address of connecting user
|
||||
var finish=function(user){
|
||||
if(s.api[params.auth].ip.indexOf('0.0.0.0')>-1||s.api[params.auth].ip.indexOf(params.ip)>-1){
|
||||
if(!user.lang){
|
||||
var details = s.parseJSON(user.details).lang
|
||||
user.lang = s.getDefinitonFile(user.details.lang) || s.copySystemDefaultLanguage()
|
||||
}
|
||||
cb(user);
|
||||
}else{
|
||||
failed();
|
||||
|
|
@ -43,7 +47,10 @@ module.exports = function(s,config,lang){
|
|||
//check if auth key is user's temporary session key
|
||||
if(s.group[params.ke]&&s.group[params.ke].users&&s.group[params.ke].users[params.auth]){
|
||||
s.group[params.ke].users[params.auth].permissions={};
|
||||
cb(s.group[params.ke].users[params.auth]);
|
||||
if(!s.group[params.ke].users[params.auth].lang){
|
||||
s.group[params.ke].users[params.auth].lang = s.copySystemDefaultLanguage()
|
||||
}
|
||||
cb(s.group[params.ke].users[params.auth])
|
||||
}else{
|
||||
//check if key is already in memory to save query time
|
||||
if(s.api[params.auth]&&s.api[params.auth].details){
|
||||
|
|
@ -185,6 +192,10 @@ module.exports = function(s,config,lang){
|
|||
if(userFound === true){
|
||||
return true
|
||||
}else{
|
||||
if(res)res.end(s.prettyPrint({
|
||||
ok: false,
|
||||
msg: lang['Not Authorized']
|
||||
}))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue