• Fixed possible issue at chat_sec.js?

    From Karloch@VERT/HISPAMSX to All on Saturday, April 11, 2015 20:49:15
    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.

    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.

    Also, many thanks to all the developers for their amazing work!

    Greets,
    Carlos

    ---
    þ Synchronet þ HISPAMSX
  • From Digital Man@VERT to Karloch on Monday, April 13, 2015 19:29:03
    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
  • From Karloch@VERT/HISPAMSX to Digital Man on Saturday, April 18, 2015 03:00:56
    Re: Fixed possible issue at chat_sec.js?
    By: Digital Man to Karloch on Mon Apr 13 2015 19:29:03

    You're very welcome! And thanks again for the bug report and root-cause analysis.

    Thanks to you for fixing and the credits at the commit log, I'm really happy to help Synchronet in any way; I really love this software :)

    Greets,
    Carlos

    ---
    þ Synchronet þ HISPAMSX BBS - The BBS dedicated to the 8-bit MSX computers