Commit Graph

1946 Commits

Author SHA1 Message Date
psychon dd8dabdfd1 WebMods: Calculate the module's web path correctly
Until now, the code checked for <moddir>/www/<mod name> and just used
./modules/www/<mod name> if the other dir didn't exist.

Now we calculate the correct path from the module's shared object's path, which
is the correct thing to do.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1967 726aef4b-f618-498e-8847-2d620e286838
2010-05-03 13:49:45 +00:00
psychon 5631a20499 Some more fun with tabs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1966 726aef4b-f618-498e-8847-2d620e286838
2010-05-02 08:36:57 +00:00
psychon 00d0a1f01a Some more tabs and cleanup
There was some code in FileUtils.h which was added in r232 (in 2005) to znc.
It was already commented out back then which means it is commented out for
5 years already. I'm 99% sure we can safely remove that. :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1965 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 20:36:42 +00:00
psychon 586ed9802e Some more tabs gone
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1964 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 20:26:30 +00:00
psychon eee34d359b Change a bunch of tabs into spaces
At the beginning of lines, one uses tabs for indenting. In the middle of the
line, you use spaces. If you want two different lines to line up with each
other, you start them with the same number of tabs and use spaces for the rest
of the indenting in the "other" line.

Really, that's how one does it!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1963 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 20:15:01 +00:00
cflakes 729299eb67 Refuse harder and print a debug warning in case some bad code
tries to write invalid lines to the config file.
Patch by DGandalf, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1962 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 18:47:52 +00:00
cflakes 6fbba375b8 We now trim all leading and trailing spaces from parameter values passed
into webadmin/webmods. This makes sense in almost every case, be it that
users accidentally hit the space bar or try to outsmart ZNC by entering
nothing but spaces into a textbox.
By doing the latter, it was possible to trick ZNC into not starting up
again. Thanks to Redirect_ for bringing this to our attention. Another
commit that will fix the underlying problem while writing to the config
file will follow.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1961 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 18:36:05 +00:00
psychon cc6e59eacf Add and use CListener::AcceptType
This enum let's one control what kind of connections a listener will allow.
HTTP requests to an IRC-only port and IRC requests to a HTTP-only port will be
booted off.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1960 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 14:33:15 +00:00
cflakes f1285bb52e Removed an unnecessary admin check from the new traffic page.
Sorry for not noticing this earlier :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1959 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 12:07:23 +00:00
cflakes 895f077084 Added a "Traffic Info" page to webadmin. 99% of the patch have been done
by BrianC, so thanks again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1958 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 12:04:44 +00:00
psychon 8698349134 Add an alias for discon_kick
discon_kick is now called disconkick, so load that one instead when we see a
config line with "LoadModule = discon_kick".

Idea by BrianC.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1957 726aef4b-f618-498e-8847-2d620e286838
2010-05-01 11:36:42 +00:00
psychon 0a9d2391dd MOTD: Use ExpandString()
Thanks to Un1matr1x for the idea.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1956 726aef4b-f618-498e-8847-2d620e286838
2010-04-30 18:15:50 +00:00
psychon 94afb82089 Don't use "ip:port" but "ip port" for display purposes
With ipv6 addresses, ip:port just looks wrong.

Found by KiNgMaR, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1955 726aef4b-f618-498e-8847-2d620e286838
2010-04-30 10:50:33 +00:00
cflakes 9d9c9b78b2 Properly fixed the last commit. Stupid CTemplate. Stupid me.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1954 726aef4b-f618-498e-8847-2d620e286838
2010-04-29 20:00:03 +00:00
cflakes c475d6ec10 Fixed a possible segfault with empty loops in CTemplate introduced AND identified by BrianC.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1953 726aef4b-f618-498e-8847-2d620e286838
2010-04-29 19:53:03 +00:00
cflakes ee78daedd8 disconkick module: Only send a kick to channels that the client is actually joined to,
avoid massive kick spam when re-connecting repeatedly and rapidly fails.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1952 726aef4b-f618-498e-8847-2d620e286838
2010-04-29 10:31:47 +00:00
cflakes 21eeacad6a Fix revision 1949... the SORT thing obviously needs to go into <?LOOP?> and not <?IF?> OH HAI BRIAN
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1951 726aef4b-f618-498e-8847-2d620e286838
2010-04-28 23:16:00 +00:00
cflakes b165d66a36 Added some more flags to the "summary" that configure prints at the end.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1950 726aef4b-f618-498e-8847-2d620e286838
2010-04-28 23:01:18 +00:00
cflakes 65f3478469 Another patch by BrianC, building upon the previous revision,
this uses the new sort feature to sort channel tables in stickychan's
and webadmin's channel tables and webadmin's user table, also the module
names in the menu. Hooray!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1949 726aef4b-f618-498e-8847-2d620e286838
2010-04-28 22:00:26 +00:00
cflakes db8872523a Added the ability to sort template loop data based on a key.
e.g. <? LOOP name SORTASC=key ?> or <? LOOP name SORTDESC=key ?>

Patch by BrianC, thanks again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1948 726aef4b-f618-498e-8847-2d620e286838
2010-04-28 21:34:09 +00:00
cflakes af15b96fb3 Added the necessary checks for (lib)iconv in order to enable
the charset module from extra to do its thing. This has been
a pain in the ass and I'd like to thank psychon who made most
of the autofoo happen and BrianC for finding out that BSD sucks
and for testing! Yay!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1947 726aef4b-f618-498e-8847-2d620e286838
2010-04-27 15:40:24 +00:00
psychon 0c00623a09 Outsmart autoconf
When checking for libperl, evil little autoconf thought we intent to use perl
everywhere (HAHA, no!) so it went forward and added -lperl to $LIBS. Despite
this being a bad idea in general (come on, it's perl!), this also made
subsequent checks fail because the linker didn't find libperl (we reverted back
LDFLAGS to an older value after checking for perl and so the path to libperl got
lost).

Fix this by outsmarting autoconf. Let's wait for the autofail to strike back!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1946 726aef4b-f618-498e-8847-2d620e286838
2010-04-27 15:30:50 +00:00
cflakes a9c983da25 WebMods: Moved some shared/common CSS things into a global.css file that all skins (should) embed.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1945 726aef4b-f618-498e-8847-2d620e286838
2010-04-26 16:39:11 +00:00
cflakes 7d450509ed Fixed some weird code in webadmin.cpp that prevented
module arguments from showing up with the new GetParam().


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1944 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 21:58:56 +00:00
cflakes adf6dbd75f BrianC totally pimped the del_user page.
"Yo ZNC, we heard you like deleting users so we put a delete button in your
delete user page so you can delete while you delete."


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1943 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 21:49:07 +00:00
cflakes 8ab18c358a Add the cool charset module to "extra". It normalizes character sets,
so if your client sends e.g. ISO-8859-1, and users on your IRC server
want UTF-8, this module can help you.
Or, the other way around, if users on your IRC server send messages
with weird charsets that your client doesn't understand, this module
can convert them to UTF-8 or something for you (as long as you know
the names of the source charsets, at least).
More explanation will be added to the wiki shortly.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1942 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 21:45:13 +00:00
cflakes ba0a25ce46 Fixed lastseen template to reflect the new user deletion confirmation page.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1941 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 20:43:23 +00:00
cflakes b7601d3119 Fixed GetParam call in the notes module.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1940 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 20:37:24 +00:00
cflakes ccad15f8f9 Make del_user page look nicer.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1939 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 20:36:42 +00:00
cflakes 0aacfdf83c Adjusted the GetParam calls in webadmin.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1938 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 20:33:03 +00:00
psychon 0b6a69d1d4 Webadmin: Use a dedicated page for confirming user deletes
The old Javascript way didn't work when one had javascript disabled.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1937 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 14:46:45 +00:00
cflakes 316277132a WebMods: Fix cookie check and menu entry variables to use the new GetParam methods.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1936 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 14:45:22 +00:00
psychon 0a99a9f404 HTTPSock: Split up parameter access
Every function on CHTTPSock which works with request parameters now has a new
flag bool bPost which decides whether only POST or GET parameters should be
used.

This breaks everything which tries to access GET parameters, but once this is
fixed we should be pretty safe against CSRF.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1935 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 14:09:23 +00:00
cflakes 70d8919835 WebMods: Delete obsolete login.tpl template. The login form has been
on / and /help and so on for some months.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1934 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 13:52:19 +00:00
cflakes da954bb4a6 WebMods: Following the last commit, this adds the CSRF check token
to existing action="post" forms. Right now, we don't have much of a
real protection against CSRF yet, but psychon is working on making
that happen :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1933 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 13:35:06 +00:00
psychon 16a55d09df Webmods: Only accept POST requests with a secret parameter
This is a first step against CSRF. Thanks to flakes for the idea.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1932 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 13:04:51 +00:00
psychon cdf97a5b91 Webmods: Only accept "/login"
Nothing uses a "/login/bla"-style URI and thus we shouldn't have to check for it


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1931 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 12:52:03 +00:00
psychon 00b67361cb Update to latest Csocket
This adds Csock::ConvertAddress() which produces printable addresses. We use
this function in CZNCSock to strip away 4in6 prefixes (e.g. ::ffff:127.0.0.1).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1930 726aef4b-f618-498e-8847-2d620e286838
2010-04-25 11:17:42 +00:00
psychon 5018851fdd Move some common pid file code into new InitPidFile()
Patch by reed, thanks again. :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1929 726aef4b-f618-498e-8847-2d620e286838
2010-04-24 08:34:33 +00:00
psychon 1148cd9a29 Look, an invisible pink unicorn!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1928 726aef4b-f618-498e-8847-2d620e286838
2010-04-23 16:38:03 +00:00
psychon 6dc5d7e0a9 Add ./configure --enable-run-from-source
Unless this flag is used, znc will no longer look for modules in ./modules/
because this might be exploitable by lucky attackers.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1927 726aef4b-f618-498e-8847-2d620e286838
2010-04-23 16:27:21 +00:00
cflakes fd2677611a Add support for an optional user-specified quit message to the DISCONNECT command that would be used instead of the message specified in the config file.
Patch by reed! Thanks!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1926 726aef4b-f618-498e-8847-2d620e286838
2010-04-23 09:09:07 +00:00
psychon 6824e3e269 Move the HTTP/IRC switching to CIncomingConnection
This new class waits for the first line from the client and checks if it's an
HTTP request and then passes the connection on to the irc or http code.

Before this, the IRC parser handled this as a special case which wasn't as
nice-looking as this is. :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1925 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 18:20:12 +00:00
psychon ab849bb922 Move CListener and CRealListener into their own files
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1924 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 16:52:30 +00:00
psychon fe7fb71fa1 Move discon_kick, blockuser and lastseen out of extra/
discon_kick is renamed to disconkick, seems more consistent with the other
modules.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1923 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 15:52:50 +00:00
psychon 3025196759 Move imapauth and email to extra/, remove webchat
webchat will come back later in more shiny and with more blinky-blink!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1922 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 15:36:50 +00:00
cflakes 8131ec6dd4 Cleanup: Remove unused/dead "WebLogoutCounters" code from User.h.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1921 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 14:58:00 +00:00
cflakes 2993b6ad2e Remove some superfluous WebRequiresLogin and WebRequiresAdmin implementations from modules. Thanks to psychon for noticing.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1920 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 14:56:44 +00:00
cflakes 4d51601552 Move the dangerous shell module to "extra".
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1919 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 14:46:14 +00:00
cflakes b2817cf9bc Web-enabled the stickychan module. You can now stick+unstick channels from the web.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1918 726aef4b-f618-498e-8847-2d620e286838
2010-04-15 14:10:56 +00:00