Do let us know if get it working,
Either way i sum everything and came out with this possible solution:
Ape.registerHookCmd("connect", function(params, cmd) {
if (!$defined(params) || !$defined(params.name)) return 0;
if (userlist.has(params.name.toLowerCase())) return ["007", "NICK_USED"];
//if (params.name.length > 16 || params.name.test('[^a-zA-Z0-9]', 'i'))
return ["006", "BAD_NICK"];
var res, isauthorized;
cmd.user.setProperty('name', params.name);
cmd.user.setProperty('ip', cmd.ip);
var usernick = user.getProperty('name').toLowerCase();
sql.query('SELECT * FROM pfc_login WHERE BINARY
username="'+Ape.MySQL.escape(usernick)+'"',function(res,error){
if(error){
Ape.log('There was an error in the query '+this.errorString()+'');
}else if(res != ''){
cmd.user.setProperty('isauthorized', res);
Ape.addUser(cmd.user);
}
});
return -1;
});
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/