• Fixed possible issue at chat_sec.js?

    From Digital Man@VERT to Karloch on Mon Apr 13 19:29:03 2015
    Re: Fixed possible issue at chat_sec.js?ã By: Karloch to All on Sat Apr 11 2015 08:49 pmãã > U have been looking arround the IRC chat feature at Synchronet, and I wantedã > to change the default IRC network and channel, giving the users theã > possibility of writting down their on server. For some reason, the usersã > were not able to join another IRC network regardless of writting it when theã > BBS asked.ããThanks for the bug report!ãã > I spotted this code at chat_sec.js:ã >ã > case 'R':ã > {ã > if(user.security.level >= 90 || user.security.exemptions&UFLAG_C) {ã > write("\r\n\001n\001y\001hIRC Server: ");ã > server=console.getstr(irc_server, 40, K_EDIT|K_LINE|K_AUTODEL);ã > if(console.aborted)ã > break;ã > }ã > write("\r\n\001n\001y\001hIRC Channel: ");ã > var channel=console.getstr(irc_channel, 40, K_EDIT|K_LINE|K_AUTODEL);ã > if(!console.aborted)ã > bbs.exec("?irc -a " + irc_server + " " + channel);ã > }ã > break;ã >ã > I though that the vars were not right, so I changed that code to this one:ã >ã > case 'R':ã > {ã > if(user.security.level >= 50 || user.security.exemptions&UFLAG_C) {ã > write("\r\n\001n\001y\001hIRC Server: ");ã > var server=console.getstr(irc_server, 40, K_EDIT|K_LINE|K_AUTODEL);ã > if(console.aborted)ã > break;ã > }ã > write("\r\n\001n\001y\001hIRC Channel: ");ã > var channel=console.getstr(irc_channel, 40, K_EDIT|K_LINE|K_AUTODEL);ã > if(!console.aborted)ã > bbs.exec("?irc -a " + server + " " + channel);ã > }ã > break;ã >ã > Everything is working like a charm now. I would like to know if there is anã > official way to contribute with the Synchronet code in order to help theã > development in some way.ããThe official way is to post or email the patch.ããIn this case, I couldn't accept the patch exactly as you'd written because it ãdoesn't appear that it would work for security levels < 50 (the "server" ãvariable would not be defined and you'd get a JS error). Also, you changed the ãminimum security level for changing the IRC server from 90 to 50.ããSo I'm committing a fix which should be correct for all conditions and also ãadding a modopts.ini option to change the minimum security level for entering a ãcustom IRC server. Just set irc_seclevel in the [chat_sec] of your ãctrl/modopts.ini file to 50 and you should be good to go (after getting the ãlatest chat_sec.js from CVS).ãã > Also, many thanks to all the developers for their amazing work!ããYou're very welcome! And thanks again for the bug report and root-cause ãanalysis.ãã digital manããSynchronet "Real Fact" #51:ãAnswers to Frequently Asked Questions: http://wiki.synchro.net/faq:indexãNorco, CA WX: 67.4øF, 59.0% humidity, 5 mph ESE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã