Commit Graph

1243 Commits

Author SHA1 Message Date
psychon
aca6783f6f Use relative instead of absolute URLs in webadmin
This should make it possible to use webadmin together with apache's mod_proxy.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1253 726aef4b-f618-498e-8847-2d620e286838
2008-10-17 16:27:18 +00:00
psychon
f8462bffdd Fix webadmin to work with symlinks in the skins directory.
If dir is a symlink to a directory dir/.. is not the same as . which broke
webadmin.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1252 726aef4b-f618-498e-8847-2d620e286838
2008-10-16 18:11:18 +00:00
psychon
9c4a5a1d90 Some tweaking and cleaning up to configure.in
- Make it clear to autoconf that we are C++ only. It now no longer checks for a
  C compiler which might save time on some boxes.
- Honour CPPFLAGS.
- Remove some unused vars from AC_SUBST.
- Add includes to CXXFLAGS instead of using $INCLUDES for this.
- Use autoconf macros instead of 'echo' for the 'checking for perl' message.
- Fix all warnings from 'autoconf -W all'.
- Use AC_CONFIG_SRCDIR for helping configure find the source dir.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1251 726aef4b-f618-498e-8847-2d620e286838
2008-10-15 18:36:08 +00:00
psychon
133c8fcb8a nickserv: Auto-save passwords when they are set and remove the 'show' command
Passwords should be secret, so don't display them to everyone who asks.
The auto-save is there to make owine happy. ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1250 726aef4b-f618-498e-8847-2d620e286838
2008-10-14 17:28:10 +00:00
psychon
2216c93e40 Catch 'throw UNLOAD' in the OnBoot module hook
Before this ZNC died because of an uncaught exception :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1249 726aef4b-f618-498e-8847-2d620e286838
2008-10-13 18:53:43 +00:00
psychon
90ecce7880 Make httpsock (and thus webadmin) support client side caching of static files
If such a file is served (e.g. webadmin images) an ETag header is now generated.
When the browser needs the file again it sends the ETag back to us in an
If-None-Match header and the file isn't transfered again if the ETag still
matches. This should greatly reduce webadmin's traffic usage.

This also updates HTTPSock to sometimes generate a HTTP/1.1 reply
(ETag was added in HTTP/1.1).

This was successfully tested with Firefox 2 & 3 and IE7.
Konqueror failed badly (No If-None-Match header generated).

Thanks to flakes for having the idea, writing the patch and testing it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1248 726aef4b-f618-498e-8847-2d620e286838
2008-10-12 15:49:03 +00:00
kroimon
2db68c519b Rewritten and enhanced module simple_away.
* Added proper 'help' command
* Module now only sets back if it really have set you away
* Case-insensitive commands
* 'reason' command now shows both raw and expanded away reason
* some structural and syntactical cleanup

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1247 726aef4b-f618-498e-8847-2d620e286838
2008-10-12 12:09:35 +00:00
psychon
4bd90ab9df Make --makeconf check for znc.pem and generate it if it's missing
This patch is based on ideas and an actual patch from
the-me aka Patrick Matthäi. Thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1246 726aef4b-f618-498e-8847-2d620e286838
2008-10-11 15:43:30 +00:00
psychon
0a4e4a10a6 Use the new CString constructor in various places to make them more readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1245 726aef4b-f618-498e-8847-2d620e286838
2008-10-10 17:58:36 +00:00
kroimon
88a993a63a Add recognition for 'y' and 'n' to CUtils::GetBoolInput.
Only 'yes'/'no' was possible before.
This commit also fixes a possible stack overflow because of recursion.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1244 726aef4b-f618-498e-8847-2d620e286838
2008-10-10 15:45:20 +00:00
psychon
f6efc88868 Add some new constructors to CString
One of these converts bools into "true" / "false". Isn't that really useful?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1243 726aef4b-f618-498e-8847-2d620e286838
2008-10-09 17:11:06 +00:00
psychon
47099a9d88 perform: Clean up the style a little and make this look like the rest of znc
Patch by SilverLeo, thanks. :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1242 726aef4b-f618-498e-8847-2d620e286838
2008-10-08 16:04:08 +00:00
psychon
2573b6408e Mark some global vars as const and static and some static local vars as const
This way the compiler puts those vars in .rodata instead of .data and everyone
happy. (Plus we have one symbol less exported)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1241 726aef4b-f618-498e-8847-2d620e286838
2008-10-07 13:45:34 +00:00
psychon
92a718e3a6 Use CSocket in webadmin instead of directly using Csock
This gets rid of some code duplication for managing the sockets.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1240 726aef4b-f618-498e-8847-2d620e286838
2008-10-04 20:55:50 +00:00
psychon
4aa01bcb71 Fix modperl to properly compile with perl 5.10.0
Thanks to bigpresh and kroimon for reporting this and testing the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1239 726aef4b-f618-498e-8847-2d620e286838
2008-10-03 18:07:22 +00:00
psychon
f81177b102 Fix stickychan to work with disabled channels (e.g. after a kick)
This kinda turns stickychan into kickrejoin... well, so what?

Thanks to Julian for reporting this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1238 726aef4b-f618-498e-8847-2d620e286838
2008-10-03 12:53:39 +00:00
psychon
497697dd3b Fix a crash bug when modperl was loaded on some arches
PERL_SYS_INIT3 was added to modperl in r1155-1158 to fix modperl on arches like
hppa. This added an invalid cast which caused a segfault.

If you have:
  const char *pArgv[];
Then pArgv will point to the same memory location as &pArgv. This pointer was
then casted to (char ***) which is one level of pointers too much for this
pointer.

Thanks to an anonymous reporter who pointed out the crash.
Thanks to pippijin for helping me understand the C++ magic.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1237 726aef4b-f618-498e-8847-2d620e286838
2008-10-02 16:26:09 +00:00
psychon
92bb399253 Fix cached perms when a chan is left
If you were kicked from a channel and rejoined, you lost all your permissions
(op, voice...), but ZNC still cached the old one you had internally. This
wasn't noticed before, because this caches is not used much.
This was found via autoop which thought it had op in a channel and so tried to
give op to others.

Call chain is like this:
Receive KICK message -> pChan->SetIsOn(false) -> pChan->Reset()
CChan::Reset() now properly clears the cache.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1236 726aef4b-f618-498e-8847-2d620e286838
2008-10-02 15:21:06 +00:00
psychon
02e4d35085 Clean up modules/Makefile.in for modperl
The HAVE_PERL define isn't used anymore and we had some compiler flags for
modperl mentioned multiple times. Plus IMHO this looks better now ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1235 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 18:07:25 +00:00
kroimon
5237a24747 Use CString::Equals() everywhere.
* (CString::CaseCmp() == 0) became CString::Equals()
* (CString::CaseCmp() != 0) became !CString::Equals()
* replaced some occurrences of strn?casecmp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1234 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 15:15:59 +00:00
psychon
18ce52e32d Limit the maximal read buffer space that is used for every socket
CSocket caches the data read from a socket and then looks for lines in there.
If there is no line end, this buffer can grow quite large. This patch now
closes sockets if they get a huge read buffer.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1233 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 14:43:51 +00:00
kroimon
f40b3e78d7 Added CString::Equals()
This new function can be used to replace the old (CaseCmp() == 0) statements.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1232 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 12:58:34 +00:00
kroimon
195681d7d7 Added length argument to CString::StrCmp() like in CString::CaseCmp()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1231 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 12:57:10 +00:00
psychon
273d72c605 Add a Clear() function to CTable and make the base class protected
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1230 726aef4b-f618-498e-8847-2d620e286838
2008-09-29 14:46:06 +00:00
psychon
3014ae5dcb Remove CSocket::m_sLabel since it isn't really used at all
It doesn't really make much sense either, because Csock already has contains
a socket name member which can be used for this. This is exactly what this
patch does.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1229 726aef4b-f618-498e-8847-2d620e286838
2008-09-29 13:34:42 +00:00
kroimon
051e1f81d8 Enhanced the /znc command to optionally accept commands.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1228 726aef4b-f618-498e-8847-2d620e286838
2008-09-29 13:33:15 +00:00
kroimon
8c2fc5180e Removed redundant checks for m_pUser in CClient::UserCommand()
One check in line 19 should be enough.
See also rev 1220.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1227 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 19:46:12 +00:00
kroimon
b757a318f1 Introduced CString::TrimPrefix() and CString::CaseCmp() for parsing targets.
Dropped all occurences of strncasecmp() and
simplified the detection of messages targeting modules.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1226 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 19:30:20 +00:00
psychon
583b91f719 Update to latest Csocket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1225 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 17:17:46 +00:00
kroimon
e693acaa66 Added CString::TrimPrefix() and CString::TrimSuffix()
These functions remove prefix/suffix strings if possible.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1224 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 16:59:28 +00:00
psychon
038961359e Print warnings in CTable if you feed it with unknown columns
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1223 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 16:55:27 +00:00
psychon
fd92e65b70 Add CClient::PutStatus(const CTable&) and use it everywhere
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1222 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 12:05:49 +00:00
kroimon
d6c34d2441 Fixed the CALLMOD macro in Client.cpp
Simple copy&paste error

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1221 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 11:53:30 +00:00
kroimon
cc00aa23c2 Removed thousands of redundant checks for m_pUser in CClient::ReadLine().
We already checked for it on line 144 which should be enough.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1220 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 01:03:06 +00:00
kroimon
3b8134c3b0 Another whitespace/tab mixup fix.
Hopefully the last one...
Again, no functional changes in this commit.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1219 726aef4b-f618-498e-8847-2d620e286838
2008-09-27 14:42:34 +00:00
kroimon
1eaac2835b Renamed UseHiddenHost to UseCloakedHost to ensure consistency.
Thanks to fred for noticing this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1218 726aef4b-f618-498e-8847-2d620e286838
2008-09-27 12:24:01 +00:00
kroimon
946add25c2 Added the Q module which allows the user to auth with QuakeNet's Q bot.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1217 726aef4b-f618-498e-8847-2d620e286838
2008-09-27 09:52:00 +00:00
kroimon
c5ce187e0f Added descriptive lines to the LISTMODS and LISTAVAILMODS commands.
Also did a few minor style changes.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1216 726aef4b-f618-498e-8847-2d620e286838
2008-09-26 12:52:07 +00:00
kroimon
6766b32e1b Fixed some trailing whitespace / tab mixups and adjusted MD5.cpp to our coding guidelines.
This commit includes absolutely no changes in functionality, only pure cleanup.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1215 726aef4b-f618-498e-8847-2d620e286838
2008-09-26 12:51:36 +00:00
psychon
83dc2d9bd3 Set the client's nick name to our IRC nick when it connects to ZNC
The assumption here is that clients parse raw 001 to get their actual nick.
This worked before because nothing relied on CClient's idea of the users' nick.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1214 726aef4b-f618-498e-8847-2d620e286838
2008-09-21 12:54:10 +00:00
psychon
0e403e318e Small optimization to starting the connect user timer
Now the connect user timer is only started when the user which was disconnected
from IRC wants to reconnect, not always.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1213 726aef4b-f618-498e-8847-2d620e286838
2008-09-21 12:51:43 +00:00
psychon
9e68cd3558 Fix compilation with gcc 4.3.1 is ssl is disabled
The gcc devs cleaned up their includes again. Some openssl header pulled in the
needed includes, too, but this obviously doesn't help if ssl is disabled.

Thanks to sebastinas for reporting and to fred and the-me for testing.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1212 726aef4b-f618-498e-8847-2d620e286838
2008-09-21 08:02:15 +00:00
kroimon
f1e6a41d83 Ignore messages to ourself when being disconnected from IRC.
This suppresses "Your message to [yournick] got lost,..." messages when lagbars try to send notices to their own nick but ZNC is disconnected from IRC.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1211 726aef4b-f618-498e-8847-2d620e286838
2008-09-20 16:00:26 +00:00
psychon
120c1cedf2 Import the dark-clouds webadmin skin bigpresh made. Thanks :)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1210 726aef4b-f618-498e-8847-2d620e286838
2008-09-19 17:24:38 +00:00
psychon
cad1ee5367 Keepnick: Dont forward nick change errors which we generated ourselves
This blocks 433 replies from the irc server if the keepnick module tries
to change our nick. This way the user isn't flooded with those errors.
Oh and the actual logic is a little more complicated than this...

This patch is inspired and implemented by SilverLeo. Thanks :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1209 726aef4b-f618-498e-8847-2d620e286838
2008-09-18 19:58:53 +00:00
psychon
d4cd83fdf3 autoconf and m4 both suck (autoconf choked on some comma and messed up badly after that)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1208 726aef4b-f618-498e-8847-2d620e286838
2008-09-18 18:16:49 +00:00
psychon
3866bdd9f7 Revert rev 1204
Well... Not a complete revert, the error messages are improved for our friendly
debian users who cant find -dev packages by themselves. -.-

It turns out that on some arches (namely sparc64) libssl depends on libcrypto,
but doesn't link to it. This means that order is important when checking for
these libs. (Currently the check for libssl fails due to unresolved symbols)

Thanks to fred for reporting this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1207 726aef4b-f618-498e-8847-2d620e286838
2008-09-18 17:52:10 +00:00
psychon
29dab181df Add --disable-optimization flag to configure to remove -O2
PS: This also kills -fomit-frame-pointer. If GCC doesn't add it on itself,
    we don't do it either.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1206 726aef4b-f618-498e-8847-2d620e286838
2008-09-16 13:33:19 +00:00
psychon
debe3ec335 Makefile: Make all output files depend on the Makefile itself
If you now rerun ./configure (e.g. for a different --prefix), everything
will be recompiled.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1205 726aef4b-f618-498e-8847-2d620e286838
2008-09-14 17:57:15 +00:00
psychon
69a429bca0 Reorder some openssl library checks in configure
Now libssl is checked before libcrypto. The idea behind this is that an error
message about missing libssl is easier to understand and fix than one saying
libcrypto is missing.
Hopefully people can now find the right dev package to install without
asking us.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1204 726aef4b-f618-498e-8847-2d620e286838
2008-09-14 14:07:14 +00:00