From 2d5890de670f08d72ef0fc12071caa84b12fcd16 Mon Sep 17 00:00:00 2001 From: Madalin Tache Date: Sat, 5 Nov 2016 13:43:50 +0200 Subject: [PATCH 1/3] gutter changes, some typos fixed, markdown syntax added. --- README-NEW-Features.txt | 264 +++++++++++++++++++++++++--------------- 1 file changed, 167 insertions(+), 97 deletions(-) diff --git a/README-NEW-Features.txt b/README-NEW-Features.txt index 0d1aa53..cb2a597 100644 --- a/README-NEW-Features.txt +++ b/README-NEW-Features.txt @@ -2,33 +2,40 @@ * Added halfop support: mod.cservice HALFOPCommand and HALFDEOPCommand ------------------------------------------------------------------------------ To enable halfop command in mod.cservice you must +``` #define USING_NEFARIOUS #define USE_HALFOPS +``` in mod.cservice/cservice_config.h The syntax is very similar to op and deop. +``` /msg X halfop <#channel> [nick1 nick2 nick3] /msg X haldefop <#channel> [nick1 nick2 nick3] - +``` + Warning! This feature requires Nefarious2 with it's halfop support. Warning! Don't forget to enable halfops in ircd.conf: +``` "HALFOPS" = "TRUE"; + ``` If you have an existing installation, to upgrade read README-DO-UPDATES.txt ============================================================================== - * Recognizing and handling Nefarious2's cloacked IP and cloacked Host + * Recognizing and handling Nefarious2's cloaked IP and cloaked Host ------------------------------------------------------------------------------ If you set "HOST_HIDING_STYLE" greater than 1 in Nefarious2's ircd.conf -gnuworld now will recognize the cloacked style +gnuworld now will recognize the cloaked style ============================================================================== * Prevent users to set 'exotic' hostnames, like with colors, etc. ------------------------------------------------------------------------------ You might find lame to see colored/bolded/etc. hostnames, so if you enable - - #define VALIDATE_SET_HOSTNAME +``` +#define VALIDATE_SET_HOSTNAME +``` in mod.cservice/cservice_config.h only normal characters will be allowed. Also it is a possibility of confusion/abuse to allow users to set hosts -with the network's hidden-host-suffix(eg. something.users.yournetwork.org) +with the network's hidden-host-suffix (eg. something.users.yournetwork.org) so this is not allowed from now on. ============================================================================ * Added mod.cservice SCANCommand @@ -41,7 +48,9 @@ To find an owner of a nickname: ------------------------------------------------------------------------------ Admins above access level level::newpass can set target users a new password: Syntax: +``` /msg X@channels.yournetwork.org newpass +``` Note: Changing own password remained valid as originally: /msg X@channels.yournetwork.org newpass @@ -49,22 +58,26 @@ Note: Changing own password remained valid as originally: * Nick protection through mod.cservice (nickreg/nickserv function) ------------------------------------------------------------------------------ Warning! This feature requires Nefarious2 with it's svsnick support. -Warning! This feature requires to patch Nefarious2 for a proper svsnick handling. Read README-DO-UPDATES.txt! +Warning! This feature requires to patch Nefarious2 for a proper svsnick +handling. Read README-DO-UPDATES.txt! Also USING_NEFARIOUS must be #define in mod.cservice/cservice_config.h If you have an existing installation, to upgrade read README-DO-UPDATES.txt -This nick protection works through an svsnick nick changing mechanism by gnuworld. -For the cservice user structure is added a nickname field, so gnuworld takes care any nick on the network is used by the 'right person' -by force-changing and generating an arbitrary 4 digits numbers ended nickname. +This nick protection works through an svsnick nick changing mechanism +by gnuworld. +For the cservice user structure is added a nickname field, so gnuworld takes +care any nick on the network is used by the 'right person' by force-changing +and generating an arbitrary 4 digits numbers ended nickname. -Syntax: +Syntax: /msg X set nick|nickname - + To clear any nickname: /msg X set nick|nickname OFF or simply /msg X set nick|nickname - -Also coders/admins with (levels.h -> level::nickset) access can set nickname for a target username. + +Also coders/admins with (levels.h -> level::nickset) access can set +nickname for a target username. /msg X set nick|nickname @@ -78,13 +91,17 @@ If it is ON, on login the saved nickname will be set for the client. ------------------------------------------------------------------------------ The command syntax for setting welcome message for a channel: +``` /msg X set #channel_name welcome - +``` To clear any welcome message: - +``` /msg X set #channel_name welcome OFF +``` or simply +``` /msg X set #channel_name welcome +``` Done. You can see the welcome message on any channel join. @@ -96,31 +113,37 @@ Warning! This feature requires Nefarious2 with it's Fake host support. If you have an existing installation, to upgrade read README-DO-UPDATES.txt The command syntax for setting a hostname for a username: - +``` /msg X set hostname - +``` To clear your hostname use: - +``` /msg X set hostname off - -The set hostname will be applied instantaneously (if +x), and on every login with +x -insted of the default users hiddenhost suffix +``` +The set hostname will be applied instantaneously (if +x), and on every +login with +x +instead of the default users hiddenhost suffix ============================================================================== * Status * command shows currently logged in officials ------------------------------------------------------------------------------ +``` /msg X status * - +``` +``` -X- Status of currently logged '*' officials: -X- Auth: SomeUser1/SomeNick1 (1000) SomeUser2/SomeNick2 (750) SomeUser3/SomeNick31 SomeNick32 (750) SomeUser4/SomeNick4 (600) - - Note: The original function of status * is moved to stats * +``` + Note: The original function of status * is moved to stats * ============================================================================== * Suspension of users on channels with reason ------------------------------------------------------------------------------ +``` -X- SYNTAX: SUSPEND <#channel> [duration] [level] [reason] +``` ------------------------------------------------------------------------------ --X- Your reason must be 2 - 300 charcters long. +-X- Your reason must be 2 - 300 characters long. ------------------------------------------------------------------------------ +``` -> *x* access #coder-com Seven -X- USER: Seven ACCESS: 499 L -X- CHANNEL: #coder-com -- AUTOMODE: None @@ -128,25 +151,28 @@ insted of the default users hiddenhost suffix -X- Reason: Not proper behavior -X- LAST SEEN: 0 days, 10:13:18 ago. -X- End of access list - +``` +``` -X- SYNTAX: UNSUSPEND <#channel> [reason] - +``` +``` -> *x* unsuspend #coder-com Seven I forgive you this time -X- USER: Seven ACCESS: 499 L -X- CHANNEL: #coder-com -- AUTOMODE: None -X- UNSUSPENDED - I forgive you this time -X- LAST SEEN: 0 days, 10:16:09 ago. -X- End of access list - +``` If the suspension expires, no reason will be show. If no reason is supplied, reason will be "No reason supplied" ============================================================================== * NOTEs is accessible for normal users too. ------------------------------------------------------------------------------ -Notes can be used to bother the another, and maybe admins don't even want to get notes from normal users, for -this I introduced config lines in "cservice_config.h" - +Notes can be used to bother the another, and maybe admins don't even want +to get notes from normal users, for this I introduced config +lines in "cservice_config.h" +``` #define USE_NOTES /** @@ -160,38 +186,41 @@ this I introduced config lines in "cservice_config.h" */ #define USERS_NOTE_ADMINS - -It can be choose between only admins use notes, admins and users, and admins can or cannot get notes from users. +``` +It can be chosen between only admins use notes, admins and users, and admins +can or cannot get notes from users. An ignore option might be advisable. ============================================================================== * Target users get notification about a new access modification. ------------------------------------------------------------------------------ -... and if the target user is not logged in in the moment of modification, the notification will be saved and displayed when the user logs in. +... and if the target user is not logged in in the moment of modification, +the notification will be saved and displayed when the user logs in. +``` -X- You have been added to channel #coder-com with access level 499 -X- Your access on #coder-com has been suspended. -X- Your suspension on #coder-com has been cancelled. -X- Your access on #coder-com has been modified from 499 to 400 -X- Your access from #coder-com has been removed by Admin. +``` -The maxmimum amount of notification can be set up in "cservice.example.conf" at the "max_notes" line. Only the latest "max_notes" count will be stored. +The maxmimum amount of notification can be set up in "cservice.example.conf" +at the "max_notes" line. Only the latest "max_notes" count will be stored. +``` -X- AUTHENTICATION SUCCESSFUL as Seven -X- Remember: Nobody from CService will ever ask you for your password, do NOT give out your password to anyone claiming to be CService. - -X- You have been added to channel #coder-com with access level 499 -- -X- Your access on #coder-com has been suspended. -- -X- Your suspension on #coder-com has been cancelled. -- -X- Your access on #coder-com has been modified from 499 to 400 -- --X- Your access from #coder-com has been removed. +-X- Your access from #coder-com has been removed. +``` ============================================================================== - * Completed users url, useable as a short description, motto, etc of the user (like we do with the Real Name). + * Completed users url, useable as a short description, motto, etc of + the user (like we do with the Real Name). ------------------------------------------------------------------------------ It can be used with 3 keywords: @@ -199,23 +228,28 @@ It can be used with 3 keywords: /msg X set DESC || DESCRIPTION /msg X set MOTTO +``` -> *x* set motto Escape from Paradise -X- Set your MOTTO to Escape from Paradise. - +``` +``` -> *x* info seven -X- Information about: Seven (2) -X- Escape from Paradise -X- Currently logged on via: +``` To clear a motto/desc/url must type: +``` /msg X set url off -X- Cleared your URL - +``` ============================================================================= * Chaninfo shows information about channels under registration ------------------------------------------------------------------------------ Admins get fullinformation about the channel: +``` -> *x* info #anychan -X- Channel #anychan is in applications list at stage: -X- *** PENDING SUPPORTERS CONFIRMATION *** @@ -224,36 +258,44 @@ Admins get fullinformation about the channel: -X- Description: Channel for nobody -X- Application posted on: Sun Jun 17 10:01:55 2012 -X- Supporters: johndoe/johndoe (0), NoBody (0) +``` Where johndoe/johndoe (0) means username/nick (joincount) If user has supported channel with YES, it will appear with bold letters -If the nick is currently on the channel it will appear with bold letters, if not, in plain, if not logged in then skipped. -If a user set it's support to NO, the username will appear with bold upper, and it will appear the decision. +If the nick is currently on the channel it will appear with bold letters, +if not, in plain, if not logged in then skipped. +If a user set it's support to NO, the username will appear with bold upper, +and it will appear the decision. -Applicant and supporters don't get the joincount. +Applicant and supporters don't get the joincount. Non-supporters get's information Only about Status, Applicant and Description: +``` -X- Channel #anychan is in applications list at stage: -X- *** PENDING SUPPORTERS CONFIRMATION *** -X- Applicant: Seven - last seen: 0 days, 01:56:49 ago -X- Description: Channel for nobody +``` ============================================================================= * Officials with *1+ can set nopurge for their user form IRC ----------------------------------------------------------------------------- +``` -> *x* set nopurge on -X- Your NOPURGE setting is now ON - +``` ============================================================================= - * Manual commands for channel ACCEPT/REJECT from IRC + * Manual commands for channel ACCEPT/REJECT from IRC ----------------------------------------------------------------------------- - +``` -> *x* reject #anychan For some reason rejected -channels.homenetwork.org:#coder-com- [X] Admin (Admin) has rejected #anychan from Seven -X- Rejected channel #anychan +``` +``` -> *x* info #anychan -X- Channel #anychan is in applications list at stage: -X- *** REJECTED *** @@ -263,15 +305,18 @@ Non-supporters get's information Only about Status, Applicant and Description: -X- Application posted on: Sun Jun 17 11:28:30 2012 -X- Decision by CService Admin: For some reason rejected -X- Supporters: johndoe/johndoe (0), NoBody (0) - +``` +``` -> *x* accept #anychan For some reason Still Accept -channels.homenetwork.org:#coder-com- [X] Admin (Admin) has accepted #anychan to Seven -X- Accepted channel #anychan +``` -The from-IRC accept is superior realtive to web-accept, because it's no needed any sychronization time betweeen gnuworld and web, -the channel chache is refreshed instantaneously, +R appear, X can be asked to join immediately. +The from-IRC accept is superior to the web-accept one because it doesn't need +any sychronization time between gnuworld and web, the channel cache is +refreshed instantaneously, +R appears, X can be asked to join immediately. - -X- Your reason must be 2 - 300 charcters long. + -X- Your reason must be 2 - 300 characters long. =============================================================================  * Completed HELLO command with verification answer requirement ----------------------------------------------------------------------------- @@ -283,86 +328,101 @@ the channel chache is refreshed instantaneously, +R appear, X can be asked to jo -X- 2: What's your dog's(or cat's) name ? -X- 3: What's your father's birth date ? - -X- Your verification answer must be 4 - 300 charcters long. + -X- Your verification answer must be 4 - 300 characters long. =============================================================================  * Channel REGISTER and HELLO commands take into account NOREG/LOCKED's ----------------------------------------------------------------------------- - +``` -> *x* hello duckyjoe duckyjoe_2001@yahoo.com duckyjoe_2001@yahoo.com 2 Rexy -X- Invalid username (NOREG) -X- Usernames matching *ducky* are disallowed for the following reason: -X- Ducks are not allowed here - +``` +``` -> *x* hello duckijoe duckyjoe_2001@yahoo.com duckyjoe_2001@yahoo.com 2 Rexy -X- Invalid email address (NOREG) -X- Email addresses matching *ducky* are disallowed for the following reason: -X- Ducks are not allowed here - +``` +``` -> *x* hello duckyjoe duckyjoe_2001@yahoo.com duckyjoe_2001@yahoo.com 2 Rexy -X- Invalid username (LOCKED) -X- Usernames matching *ducky* are disallowed for the following reason: -X- Ducks must stay out from here - +``` *** Also for locked verification answer *** -In cservice_config.h i'v separated 2 config line: - +In cservice_config.h i've separated 2 config line: +``` #define ALLOW_HELLO ==> enable HELLO command only for admins #define ALLOW_USERS_HELLO ==> enable HELLO command for admins and users - +``` Note: If HELLO is not enabled for admins, than also will not be for users. -Note2: Admins with access level above level::hello defined in mod.cservice/levels.h can bypass NOREG/LOCKED's, etc. +Note2: Admins with access level above level::hello defined in +mod.cservice/levels.h can bypass NOREG/LOCKED's, etc. -Tha same story for REGISTER command. (cheking for NOREG/LOCKED email, username, verification answer -+ target user must be logged in at least once on IRC +Tha same story for REGISTER command. (cheking for NOREG/LOCKED email, + username, verification answer + target user must be logged in at least + once on IRC -Note: Admins with access level above level::immune::registercmd defined in levels.h can bypass NOREG/LOCKED's, etc. +Note: Admins with access level above level::immune::registercmd defined + in levels.h can bypass NOREG/LOCKED's, etc. =============================================================================  * POWER user flag, enables almighty admins ----------------------------------------------------------------------------- /msg X set POWER [targetuser] ON|OFF -Many networks asked for a possbility of 'special' admins, with absolute administrative power, to be able to set another 1000 admin, -remove, etc. -Userid 1 always has the capability to set itself as POWER, other users can get only from an another POWER-ed user. -The POWER flag is visible in user info only to an another POWER-ed admin, for normal admins is not listed. +Many networks asked for a possbility of 'special' admins, with absolute +administrative power, to be able to set another 1000 admin, remove, etc. +Userid 1 always has the capability to set itself as POWER, other users can get +only from an another POWER-ed user. +The POWER flag is visible in user info only to an another POWER-ed admin, +for normal admins is not listed. ============================================================================= - * SPECIAL channel flag is used for prevention of setting normal accesses above 499 + * SPECIAL channel flag is used for prevention of setting normal accesses + above 499 ----------------------------------------------------------------------------- -Logic dictate to not to allow to set accesses above 500, except for some special cases, those with SPECIAL channel flag: - +Logic dictates to not to allow to set accesses above 500, except for some +special cases, those with SPECIAL channel flag: +``` -> *x* adduser #cservice Seven 501 -X- Access levels on regular channels cannot exceed 499 (except SPECIAL) -> *x* adduser #cservice Seven 499 -X- Added user Seven to #cservice with access level 499 -> *x* modinfo #cservice access Seven 501 -X- Access levels on regular channels cannot exceed 499 (except SPECIAL) - +``` ============================================================================= - * Expiration of users for more than 60 days are automatical from the gnuworld's internal timer + * Expiration of users for more than 60 days are automatical from the + gnuworld's internal timer ----------------------------------------------------------------------------- -In mod.cservice/ in cservice.h/cservice.cc it is declared a new timer looking after users expiration. -This can be fine tuned within cservice.example.conf - -"users_expire_days" - +In mod.cservice/ in cservice.h/cservice.cc it is declared a new timer looking +after users expiration. +This can be fine tuned within cservice.example.conf +``` +"users_expire_days" +``` config line. -For this, and for the channel expiration it is valid the - +For this, and for the channel expiration it is valid the +``` "hour_seconds" and "day_seconds" config lines. - -The "users_db_idle" is the time interval in hours to check the users for the lastseen value. +``` +The "users_db_idle" is the time interval in hours to check the users for the +lastseen value. ============================================================================= -* Expiration of channels within gnuworld, with setting the proper MIA, LOCKED, DESC, URL's +* Expiration of channels within gnuworld, with setting the proper + MIA, LOCKED, DESC, URL's ----------------------------------------------------------------------------- -It is well known the steps of channel expiration, this does the same in automatic way. +It is well known the steps of channel expiration, this does the same +in automatic way. In cservice.example.conf there are config lines for this +``` # # Frequncy for check database for for channels for missing managers(in hours) # cannot be 0, default 3 will be used @@ -410,16 +470,21 @@ MIA_URL = Only 400+ Ops # MIA_end_desc = Manager has logged in. This was the last warning for failure to login +``` + +If the manager has logged in in the MIA period, a CAUTION channel flag will be + set (LOCKED,MIA will be removed), +that will cause an immediate channel purge next time when the manager fails + to log in in time. -If the manager has logged in in the MIA period, a CAUTION channel flag will be set (LOCKED,MIA will be removed), -what will cause an immediate channel purge next time when the manager fails to log in in time. ============================================================================= * Automode VOICE/OP are Not allowed in any kind below the required access levels. ----------------------------------------------------------------------------- -Everyone knows that automode voice/op can be set starting with 1 access. This is an issue to fix, +Everyone knows that automode voice/op can be set starting with 1 access. +This is an issue to fix, So: - +``` -> *x* modinfo #coder-com access Seven 24 -X- Modified Seven's access level on channel #coder-com to 24 -> *x* modinfo #coder-com automode seven op @@ -440,6 +505,7 @@ So: -X- Modified Seven's access level on channel #coder-com to 100 -> *x* modinfo #coder-com automode seven op -X- Set AUTOMODE to OP for Seven on channel #coder-com +``` In addition if channel has a userflag VOICE/OP, when the access level is modified to the required level, it will get the automode, if the access is modified below, it will be lost, set to NONE. @@ -450,8 +516,10 @@ if the access is modified below, it will be lost, set to NONE. -X- SYNTAX: RENAME +``` -> *x* rename seven George -X- Successfully renamed username Seven to George +``` It is required an admin access level level::rename in mod.cservice/levels.h @@ -460,18 +528,20 @@ It is required an admin access level level::rename in mod.cservice/levels.h ----------------------------------------------------------------------------- Noforce channel flag prevents admins to force themselves on a channel. +``` -> *x* set #cservice noforce on -X- NOFORCE for #cservice is ON -X- Channel #cservice has 2 users (2 operators) - -X- Mode is: +tnR + -X- Mode is: +tnR -X- I'm currently in this channel. -X- MassDeopPro: 3 - -X- Flags set: NOFORCE AUTOJOIN - -X- Auth: + -X- Flags set: NOFORCE AUTOJOIN + -X- Auth: -> *x* force #cservice -X- The NOFORCE flag is set on #cservice +``` Requires an adminlevel level::set::noforce ============================================================================= @@ -513,9 +583,9 @@ If a username is provided, then will delete it. ----------------------------------------------------------------------------- * On Channel join (bursting channels) X looks after NOOP and NOVOICE channel flag, and deop/devoice everyone. * Ban nicklength is now 50 instead of maximum of 15, ident legth is 25 instead of 12. - * Channel description length is now can be 128 charcters long, url is 75 charcters long. + * Channel description length is now can be 128 characters long, url is 75 characters long. Don't forget to adjust ircu's values too if needed. * On user suspension on a channel, all logged clients corresponding the suspended account will be deopped instantaneously. - * On global user suspension, all clients corresponding to logged user, on all channels where is opped will be deopped instantaneously. - + * On global user suspension, all clients corresponding to logged user, on all channels where is opped will be deopped instantaneously. + From 1bb676daed01181a2d6384f037c53fa3a09480fa Mon Sep 17 00:00:00 2001 From: Madalin Tache Date: Sat, 5 Nov 2016 13:52:14 +0200 Subject: [PATCH 2/3] typos fixing (replacing charcters and characteres with characters) --- doc/language_table.sql | 4 +- mod.cservice/ACCEPTCommand.cc | 86 +++++++++++++++---------------- mod.cservice/HELLOCommand.cc | 50 +++++++++--------- mod.cservice/REGISTERCommand.cc | 10 ++-- mod.cservice/REJECTCommand.cc | 90 ++++++++++++++++----------------- mod.cservice/SUSPENDCommand.cc | 8 +-- 6 files changed, 124 insertions(+), 124 deletions(-) diff --git a/doc/language_table.sql b/doc/language_table.sql index 5129f3b..4117f1b 100644 --- a/doc/language_table.sql +++ b/doc/language_table.sql @@ -190,7 +190,7 @@ COPY "translations" FROM stdin; 1 179 The NOFORCE flag is set on %s 31337 0 1 180 Target user %s on channel %s has insufficient access for an automode VOICE 31337 0 1 181 Target user %s on channel %s has insufficient access for an automode OP 31337 0 -1 182 Your reason must be %i - %i charcters long. 31337 0 +1 182 Your reason must be %i - %i characters long. 31337 0 1 183 Reason: %s 31337 0 1 184 UNSUSPENDED - %s 31337 0 1 185 You have %i note(s). To read them type /msg %s notes read all 31337 0 @@ -588,7 +588,7 @@ COPY "translations" FROM stdin; 6 18 Eu n\E3o estou neste canal! 31337 0 6 19 Escala inv\E1lida de n\EDvelban. Escala v\E1lida \E9 1-%i. 31337 0 6 20 Dura\E7\E3o de ban inv\E1lida. Sua dura\E7\E3o de ban aplicada pode ser de no m\E1ximo %d horas. 31337 0 -6 21 Motivo do ban n\E3o exceder 128 characteres 31337 0 +6 21 Motivo do ban n\E3o exceder 128 characters 31337 0 6 22 O ban especificado j\E1 est\E1 na banlist! 31337 0 6 23 O ban %s j\E1 est\E1 coberto por %s 31337 0 6 24 N\EDvel m\EDnimo inv\E1lido. 31337 0 diff --git a/mod.cservice/ACCEPTCommand.cc b/mod.cservice/ACCEPTCommand.cc index d04c874..c2147a0 100644 --- a/mod.cservice/ACCEPTCommand.cc +++ b/mod.cservice/ACCEPTCommand.cc @@ -4,7 +4,7 @@ * 27/04/2012 - Gergo Focze * Initial Version. * - * Channel accept command from IRC + * Channel accept command from IRC * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -89,7 +89,7 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) string("%s is already registered with me.")).c_str(), st[1].c_str()); return false; - } + } /* Check the user has sufficient access for this command.. */ if (level < level::accept) { @@ -103,7 +103,7 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) decision = st.assemble(2); if (decision.size() > 300) { - bot->Notice(theClient,"Decision cannot exceed 300 charcters."); + bot->Notice(theClient,"Decision cannot exceed 300 characters."); return false; } unsigned int lastdays = (unsigned int)bot->currentTime() - ((unsigned int)bot->daySeconds*5); @@ -121,13 +121,13 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) { bot->logDebugMessage("Error on ACCEPT: channel is not UnClaimed"); #ifdef LOG_SQL //elog << "sqlQuery> " << theQuery.str().c_str() << endl; - elog << "ACCEPT.pending.status query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "ACCEPT.pending.status query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif return false; - } else if (bot->SQLDb->Tuples() == 0) - { + } else if (bot->SQLDb->Tuples() == 0) + { bot->Notice(theClient,"Channel %s is not in my applications list",st[1].c_str()); return false; } @@ -147,17 +147,17 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) //<< escapeSQLChars(string_lower(st[1])) //<< "'" << " WHERE id = " - << chanId + << chanId << ends; if (!bot->SQLDb->Exec(reclaimQuery)) - { + { bot->logDebugMessage("Error on ACCEPT.UpdateReclaim query"); #ifdef LOG_SQL elog << "sqlQuery> " << reclaimQuery.str().c_str() << endl; #endif - return false; - } + return false; + } /********** Update pending status ***********/ theQuery.str(""); theQuery << "UPDATE pending SET status=3,last_updated=now()::abstime::int4,decision_ts=now()::abstime::int4,reviewed='Y',decision='" @@ -167,33 +167,33 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) <<" WHERE channel_id=" << chanId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on ACCEPT.UpdatePending query"); #ifdef LOG_SQL - elog << "ACCEPT.UpdatePending query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "ACCEPT.UpdatePending query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } + return false; + } /********** Manager ID query ***********/ theQuery.str(""); theQuery << "SELECT manager_id FROM pending WHERE channel_id=" << chanId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on ACCEPT.Manager_ID query"); #ifdef LOG_SQL - elog << "ACCEPT.Manager_ID query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "ACCEPT.Manager_ID query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } - if (bot->SQLDb->Tuples() == 0) - { + return false; + } + if (bot->SQLDb->Tuples() == 0) + { bot->logDebugMessage("Result NOT Found ACCEPT.Manager_ID query"); return false; } @@ -203,33 +203,33 @@ bool ACCEPTCommand::Exec( iClient* theClient, const string& Message ) theQuery << "UPDATE users_lastseen SET last_updated=now()::abstime::int4,last_seen=now()::abstime::int4 WHERE user_id=" << mngrId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on ACCEPT.UsersLastseen last_updated"); #ifdef LOG_SQL - elog << "ACCEPT.UsersLastseen last_updated> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "ACCEPT.UsersLastseen last_updated> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } + return false; + } /********** Manager username query ***********/ theQuery.str(""); theQuery << "SELECT user_name FROM users WHERE id=" << mngrId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on ACCEPT.Manager UserName Query"); #ifdef LOG_SQL - elog << "ACCEPT.Manager UserName Query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "ACCEPT.Manager UserName Query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } + return false; + } mngrUserName = bot->SQLDb->GetValue(0,0); - //sqlUser* tmpUser = bot->getUserRecord(mngrUserName); + //sqlUser* tmpUser = bot->getUserRecord(mngrUserName); /* * Create the new channel and insert it into the cache. * If the channel exists on IRC, grab the creation timestamp diff --git a/mod.cservice/HELLOCommand.cc b/mod.cservice/HELLOCommand.cc index c16f527..fea007d 100644 --- a/mod.cservice/HELLOCommand.cc +++ b/mod.cservice/HELLOCommand.cc @@ -61,7 +61,7 @@ if( st.size() < 6 ) return true; } -const char validChars[] +const char validChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; /* @@ -80,7 +80,7 @@ if (itr != bot->helloIPList.end()) bot->Notice(theClient, "Sorry, an account has " "already been registered from this IP within " "the last %i hours. " - "Please wait and try again, or contact cservice.", + "Please wait and try again, or contact cservice.", bot->helloBlockPeriod / 3600); return false; @@ -95,7 +95,7 @@ if(newUser) } /* - * Check the username contains valid characters/correct + * Check the username contains valid characters/correct length. */ if ( (st[1].size() < 2) || (st[1].size() > 12) ) @@ -154,7 +154,7 @@ if( string::npos == st[2].find_first_of('@') ) } /* - * Check if they've at least vaugly attempted to specify a + * Check if they've at least vaugly attempted to specify a * proper domain structure * and we have the right number of @'s. */ @@ -179,20 +179,20 @@ if (admLevel < level::hello) * Check this email address doesn't already exist in the database! */ stringstream theQuery; -theQuery << "SELECT email FROM users WHERE email IS NOT NULL" +theQuery << "SELECT email FROM users WHERE email IS NOT NULL" << ends; if (!bot->SQLDb->Exec(theQuery, true)) { bot->logDebugMessage("Error on HELLO.EmailQuery"); #ifdef LOG_SQL //elog << "sqlQuery> " << theQuery.str().c_str() << endl; - elog << "Hello.EmailQuery> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "Hello.EmailQuery> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif return false; -} else if (bot->SQLDb->Tuples() != 0) -{ - for (unsigned int i = 0 ; i < bot->SQLDb->Tuples(); i++) +} else if (bot->SQLDb->Tuples() != 0) +{ + for (unsigned int i = 0 ; i < bot->SQLDb->Tuples(); i++) if (!match(bot->SQLDb->GetValue(i,0),st[2])) { bot->Notice(theClient,"There is already an account registered with that email address."); @@ -204,7 +204,7 @@ if (!bot->SQLDb->Exec(theQuery, true)) } //admLevel unsigned short verifID = atoi(st[4].c_str()); -if ((verifID < 1) || (verifID > 3)) +if ((verifID < 1) || (verifID > 3)) { bot->Notice(theClient,"Valid verification answer numbers are: 1 to 3"); bot->Notice(theClient,"1: What's your mother's maiden name ?"); @@ -216,7 +216,7 @@ if ((verifID < 1) || (verifID > 3)) string verifAnswer = st.assemble(5); if ((verifAnswer.size() < 4) || (verifAnswer.size() > 300)) { - bot->Notice(theClient,"Your verification answer must be 4 - 300 charcters long."); + bot->Notice(theClient,"Your verification answer must be 4 - 300 characters long."); return false; } @@ -226,31 +226,31 @@ if ((verifAnswer.size() < 4) || (verifAnswer.size() > 300)) { if (admLevel < level::hello) { stringstream theQuery; -theQuery << "SELECT user_name,email,type,reason FROM noreg WHERE email IS NOT NULL OR user_name IS NOT NULL" +theQuery << "SELECT user_name,email,type,reason FROM noreg WHERE email IS NOT NULL OR user_name IS NOT NULL" << ends; if (!bot->SQLDb->Exec(theQuery, true)) { bot->logDebugMessage("Error on HELLO.NoregEmailQuery"); #ifdef LOG_SQL //elog << "sqlQuery> " << theQuery.str().c_str() << endl; - elog << "Hello.NoregEmailQuery> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "Hello.NoregEmailQuery> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif return false; -} else if (bot->SQLDb->Tuples() != 0) -{ +} else if (bot->SQLDb->Tuples() != 0) +{ unsigned short type; string user_name,email; - string reason; - for (unsigned int i = 0 ; i < bot->SQLDb->Tuples(); i++) + string reason; + for (unsigned int i = 0 ; i < bot->SQLDb->Tuples(); i++) { user_name = bot->SQLDb->GetValue(i,0); email = bot->SQLDb->GetValue(i,1); type = atoi(bot->SQLDb->GetValue(i,2)); reason = bot->SQLDb->GetValue(i,3); - if ((user_name.size() > 0) && (user_name != "*")) + if ((user_name.size() > 0) && (user_name != "*")) { - if ((type < 6) && (!match(user_name,st[1]))) + if ((type < 6) && (!match(user_name,st[1]))) { if (type < 4) bot->Notice(theClient,"Invalid username (NOREG)"); if (type == 4) bot->Notice(theClient,"Invalid username (FRAUD)"); //this is set automatically when for a user is set the F_FRAUD flag on the webinterface @@ -258,8 +258,8 @@ if (!bot->SQLDb->Exec(theQuery, true)) bot->Notice(theClient,"Usernames matching %s are disallowed for the following reason:",user_name.c_str()); bot->Notice(theClient,reason.c_str()); return false; - } - if (type == 6) + } + if (type == 6) { //* This should be the matchcase - TODO: need to find a solution */ if (user_name[0] == '!') user_name.erase(0,1); if (!match(user_name,verifAnswer)) diff --git a/mod.cservice/REGISTERCommand.cc b/mod.cservice/REGISTERCommand.cc index 4d7abce..d9ee2e0 100644 --- a/mod.cservice/REGISTERCommand.cc +++ b/mod.cservice/REGISTERCommand.cc @@ -377,19 +377,19 @@ bool REGISTERCommand::Exec( iClient* theClient, const string& Message ) << endl ; #endif return false; - } + } else { //Also here we need to find out the new channels's id chanId = bot->getPendingChanId(st[1]); //bot->logDebugMessage("Successfully inserted new channel %s with id = %i", st[1].c_str(), chanId); } } - + sqlIncompleteChannel* newApp = new (std::nothrow) sqlIncompleteChannel(bot->SQLDb); assert(newApp != 0); bot->incompleteChanRegs.insert(cservice::incompleteChanRegsType::value_type(theUser->getID(),newApp)); - + newApp->chanName = st[1]; newApp->chanId = chanId; if (!newApp->commitNewPending(theUser->getID(), chanId)) @@ -438,7 +438,7 @@ bool REGISTERCommand::Exec( iClient* theClient, const string& Message ) string mngrName = st.assemble(3); if ((mngrName.size() < 2) || (mngrName.size() > 80)) { - bot->Notice(theClient,"Your realname must be 2 - 80 charcters long. Try again"); + bot->Notice(theClient,"Your realname must be 2 - 80 characters long. Try again"); return true; } chanApp->RealName = mngrName; @@ -462,7 +462,7 @@ bool REGISTERCommand::Exec( iClient* theClient, const string& Message ) string desc = st.assemble(3); if ((desc.size() < 2) || (desc.size() > 300)) { - bot->Notice(theClient,"Your description must be 2 - 300 charcters long. Try again"); + bot->Notice(theClient,"Your description must be 2 - 300 characters long. Try again"); return true; } chanApp->Description = desc; diff --git a/mod.cservice/REJECTCommand.cc b/mod.cservice/REJECTCommand.cc index 742304a..57afbc7 100644 --- a/mod.cservice/REJECTCommand.cc +++ b/mod.cservice/REJECTCommand.cc @@ -4,7 +4,7 @@ * 07/05/2012 - Gergo Focze * Initial Version. * - * Channel reject command from IRC + * Channel reject command from IRC * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -89,7 +89,7 @@ bool REJECTCommand::Exec( iClient* theClient, const string& Message ) string("%s is already registered with me.")).c_str(), st[1].c_str()); return false; - } + } if (level < level::reject) { @@ -103,7 +103,7 @@ bool REJECTCommand::Exec( iClient* theClient, const string& Message ) decision = st.assemble(2); if (decision.size() > 300) { - bot->Notice(theClient,"Decision cannot exceed 300 charcters."); + bot->Notice(theClient,"Decision cannot exceed 300 characters."); return false; } decision = "by CService Admin
" + decision; @@ -118,24 +118,24 @@ bool REJECTCommand::Exec( iClient* theClient, const string& Message ) << lastdays << "))" << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on REJECT.pending.status query"); #ifdef LOG_SQL - elog << "REJECT.pending.status query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "REJECT.pending.status query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } - if (bot->SQLDb->Tuples() == 0) + return false; + } + if (bot->SQLDb->Tuples() == 0) { bot->Notice(theClient,"Channel %s is not in my applications list",st[1].c_str()); return false; - } + } chanId = atoi(bot->SQLDb->GetValue(0,0)); unsigned short status = atoi(bot->SQLDb->GetValue(0,1)); - if (status == 9) + if (status == 9) { bot->Notice(theClient,"Channel %s is already rejected.",st[1].c_str()); return false; } @@ -144,7 +144,7 @@ bool REJECTCommand::Exec( iClient* theClient, const string& Message ) bot->Notice(theClient,"Channel %s is not in my applications list",st[1].c_str()); return false; } - if ((status > 3) and (status < 8)) return false; + if ((status > 3) and (status < 8)) return false; //if ((status == 0) or (status == 1) or (status == 2) or (status == 8)) /********** Update pending status ***********/ theQuery.str(""); @@ -156,68 +156,68 @@ bool REJECTCommand::Exec( iClient* theClient, const string& Message ) << chanId //<< " AND (status='0' OR status='1' OR status='2' OR status='8')" //AND created_ts=' << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on REJECT.UpdatePending query"); #ifdef LOG_SQL - elog << "REJECT.UpdatePending query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "REJECT.UpdatePending query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; + return false; } /********** Manager ID query ***********/ theQuery.str(""); theQuery << "SELECT manager_id FROM pending WHERE channel_id=" << chanId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on REJECT.Manager_ID query"); #ifdef LOG_SQL - elog << "REJECT.Manager_ID query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "REJECT.Manager_ID query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } - if (bot->SQLDb->Tuples() == 0) - { + return false; + } + if (bot->SQLDb->Tuples() == 0) + { bot->logDebugMessage("Result NOT Found REJECT.Manager_ID query"); return false; } - unsigned int mngrId = atoi(bot->SQLDb->GetValue(0,0)); + unsigned int mngrId = atoi(bot->SQLDb->GetValue(0,0)); /********** Update users LastSeen last_updated ***********/ theQuery.str(""); theQuery << "UPDATE users_lastseen SET last_updated=now()::abstime::int4,last_seen=now()::abstime::int4 WHERE user_id=" << mngrId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on REJECT.UsersLastseen last_updated"); #ifdef LOG_SQL - elog << "REJECT.UsersLastseen last_updated> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "REJECT.UsersLastseen last_updated> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } + return false; + } /********** Manager username query ***********/ theQuery.str(""); theQuery << "SELECT user_name FROM users WHERE id=" << mngrId << ends; - if( !bot->SQLDb->Exec(theQuery, true ) ) - { + if( !bot->SQLDb->Exec(theQuery, true ) ) + { bot->logDebugMessage("Error on REJECT.Manager UserName Query"); #ifdef LOG_SQL - elog << "REJECT.Manager UserName Query> SQL Error: " - << bot->SQLDb->ErrorMessage() - << endl ; + elog << "REJECT.Manager UserName Query> SQL Error: " + << bot->SQLDb->ErrorMessage() + << endl ; #endif - return false; - } - mngrUserName = bot->SQLDb->GetValue(0,0); + return false; + } + mngrUserName = bot->SQLDb->GetValue(0,0); bot->logAdminMessage("%s (%s) has rejected %s from %s", theClient->getNickName().c_str(), theUser->getUserName().c_str(), st[1].c_str(), mngrUserName.c_str()); bot->Notice(theClient,"Rejected channel %s",st[1].c_str()); diff --git a/mod.cservice/SUSPENDCommand.cc b/mod.cservice/SUSPENDCommand.cc index c4e7105..b25f2a4 100644 --- a/mod.cservice/SUSPENDCommand.cc +++ b/mod.cservice/SUSPENDCommand.cc @@ -277,7 +277,7 @@ if( 0 == finalDuration ) } if ((suspReason.size() < 2) || (suspReason.size() > 300)) { - //bot->Notice(theClient,"Your reason must be 2 - 300 charcters long."); + //bot->Notice(theClient,"Your reason must be 2 - 300 characters long."); bot->Notice(theClient, bot->getResponse(theUser,language::reason_must).c_str(),2,300); return false; } @@ -305,7 +305,7 @@ if( 0 == finalDuration ) language::susp_cancelled, string("SUSPENSION for %s is cancelled")).c_str(), Target->getUserName().c_str()); - if (Target != theUser) + if (Target != theUser) bot->NoteAllAuthedClients(Target, bot->getResponse(Target,language::acc_unsusp).c_str(), theChan->getName().c_str()); return true; @@ -324,7 +324,7 @@ if (aLevel->getSuspendExpire() > bot->currentTime()) if ((suspReason.size() < 2) || (suspReason.size() > 300)) { - //bot->Notice(theClient,"Your reason must be 2 - 300 charcters long."); + //bot->Notice(theClient,"Your reason must be 2 - 300 characters long."); bot->Notice(theClient, bot->getResponse(theUser,language::reason_must).c_str(),2,300); return false; } @@ -353,7 +353,7 @@ bot->Notice(theClient, string("SUSPENSION for %s will expire in %s")).c_str(), Target->getUserName().c_str(), prettyDuration(bot->currentTime() - finalDuration ).c_str()); - if (Target != theUser) + if (Target != theUser) bot->NoteAllAuthedClients(Target, bot->getResponse(Target,language::acc_susp).c_str(), theChan->getName().c_str()); if ((theUser->getFlag(sqlUser::F_POWER)) && (Target == theUser)) From d8b17f2abce151bf03670c8f1182e4b1f2fff75e Mon Sep 17 00:00:00 2001 From: Madalin Tache Date: Sat, 5 Nov 2016 14:06:20 +0200 Subject: [PATCH 3/3] missed a few typos. --- README-NEW-Features.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README-NEW-Features.txt b/README-NEW-Features.txt index cb2a597..a02ab9f 100644 --- a/README-NEW-Features.txt +++ b/README-NEW-Features.txt @@ -581,10 +581,12 @@ If a username is provided, then will delete it. ============================================================================= * Other minor enhancements ----------------------------------------------------------------------------- - * On Channel join (bursting channels) X looks after NOOP and NOVOICE channel flag, and deop/devoice everyone. - * Ban nicklength is now 50 instead of maximum of 15, ident legth is 25 instead of 12. - * Channel description length is now can be 128 characters long, url is 75 characters long. - Don't forget to adjust ircu's values too if needed. + * On Channel join (bursting channels) X looks after NOOP and NOVOICE channel + flag, and deops/devoices everyone. + * Ban nicklength is now 50 instead of maximum of 15, ident length is now + 25 instead of 12. + * Channel description length is now 128 characters long, url is 75 characters long. + Don't forget to adjust ircu's values too if needed. (TOPICLEN) * On user suspension on a channel, all logged clients corresponding the suspended account will be deopped instantaneously. * On global user suspension, all clients corresponding to logged user, on all channels where is opped will be deopped instantaneously.