Commit Graph

89 Commits

Author SHA1 Message Date
psychon
607bb4e1ce Make webadmin handle HTTP requests to the IRC port
This can be disable with -noircport in webadmin's arguments


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1368 726aef4b-f618-498e-8847-2d620e286838
2009-02-03 19:08:15 +00:00
psychon
235b10c200 Use that new define everywhere
Now there are no uses of DEBUG_ONLY() left :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1349 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 16:51:54 +00:00
psychon
2efea2157a webadmin: reload global modules whose settings were changed
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1331 726aef4b-f618-498e-8847-2d620e286838
2009-01-14 15:17:30 +00:00
psychon
a3169af5bd Add CUtils::SaltedHash() for doing salted hashes and do some cleanup
The stuff in CUtils::GetHashPass() and CUtils::GetSaltedHashPass() shouldn't
hurt, since we don't do such stuff in other places for passwords either.

This should improve the readability of the code a lot.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1324 726aef4b-f618-498e-8847-2d620e286838
2009-01-08 15:57:32 +00:00
psychon
08ad0291ea Happy New Year 2009 everyone!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1317 726aef4b-f618-498e-8847-2d620e286838
2009-01-01 12:22:21 +00:00
psychon
08088be7d6 Add traffic tracking support to CSocket
Now every module that uses CSocket automatically gets its generated traffic
counted. Those which use Csock directly should be shot and burried anyway ;)

This adds CModule::IsGlobal().


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1283 726aef4b-f618-498e-8847-2d620e286838
2008-12-06 19:56:38 +00:00
psychon
e85ed684ea Some member vars of CWebAdminMod should really be local vars to OnLoad()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1265 726aef4b-f618-498e-8847-2d620e286838
2008-10-28 17:21:53 +00:00
psychon
680127165a Improve webadmin's error messages
I just got this: (binding to ::1 on an ipv4-only build)
Module [webadmin] aborted: Could not bind to port 8080: No such file or directory
Module [webadmin] aborted: Could not bind to port 8080: Success


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1259 726aef4b-f618-498e-8847-2d620e286838
2008-10-23 15:20:09 +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
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
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
kroimon
d1b3c2b94d Removed AutoCycle from core
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1191 726aef4b-f618-498e-8847-2d620e286838
2008-09-07 11:23:57 +00:00
psychon
85a70a418c Add JoinTries and MaxJoins config options to webadmin
This also changes the layout of the default skin a little, because it was
a little messed up. I still don't like the result, but meh, send patches!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1187 726aef4b-f618-498e-8847-2d620e286838
2008-09-03 14:28:18 +00:00
psychon
00fcf767a7 Keep the traffic stats more up-to-date (/msg *status traffic)
This now also adds the traffic caused by webadmin, schat and dcc bouncing
to the stats.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1183 726aef4b-f618-498e-8847-2d620e286838
2008-08-31 07:21:21 +00:00
psychon
da8c892d4f Add a config option 'MaxJoins' to limit the number of joins ZNC does at once
This should hopefully fix a couple of 'Excess flood' problems we were having.

Thanks to SilverLeo for finally writing this :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1177 726aef4b-f618-498e-8847-2d620e286838
2008-08-29 15:06:08 +00:00
psychon
03e34ac6e6 Remove KeepNick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1151 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:34:11 +00:00
psychon
1c2c52651a Make webadmin generate salted passwords, too
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1139 726aef4b-f618-498e-8847-2d620e286838
2008-07-20 15:06:33 +00:00
psychon
10210e4619 Don't throw any exceptions in CModules::LoadModule() on version mismatch
This also removes all the code catching those exceptions. There was nothing
which justified these exceptions and removing them doesn't hurt.

ByeBye CException::EX_BadModVersion


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838
2008-07-17 12:01:44 +00:00
psychon
a5dcb3ff77 webadmin: Use the new CZNC::AuthUser() API
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1116 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:36:26 +00:00
psychon
7965a12bd0 Fix a privilege escalation bug in webadmin if auth modules are used
auth modules = imapauth and saslauth

Some code in CWebAdminSock::OnLogin() is skipped if a module handles auth
and thus m_pUser stays NULL. Most checks for admin rights only check for
m_pUser being NULL and thus any user WHO ALREADY HAS A VALID LOGIN can edit
other users if they know their user name.
(=Change the password of an admin and log in using this info)

One of the major excpeptions are the templates which use m_bAdmin instead of
m_pUser for checking the privieleges, thus users still see the normal pages
and this bug stayed unnoticed for a while.

This patch now moves the code that sets m_pUser to some code which is executed
in both cases, when an auth module is in effect and when one isn't.
(Well, technically this isn't a move, but code duplication, but executing this
 twice won't hurt and one of the follow-up patches cleans this up.)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1113 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:30:35 +00:00
psychon
5e0c652b9a Add the remote ip to the info CAuthBase got
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1112 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:24:38 +00:00
psychon
1bb1206472 Webadmin: Add support for timezone offset
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1079 726aef4b-f618-498e-8847-2d620e286838
2008-05-30 14:09:41 +00:00
psychon
13ddd325f9 Webadmin: Don't reset all channel settings submitting a user page
In r1058 the behaviour of CUser::Clone() was changed. It now also handles the
channel settings. This change breaks webadmin, because it doesn't properly
set up the channels it feeds to CUser::Clone()

This commit 'fixes' this by adding an extra parameter to CUser::Clone() which
makes it revert to the old behaviour. Webadmin uses this parameter.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1074 726aef4b-f618-498e-8847-2d620e286838
2008-05-26 15:02:09 +00:00
psychon
8c24ebb641 Webadmin: Remove the special rule for CVS and ignore .svn instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1043 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 13:45:16 +00:00
psychon
8cf12e8931 Clean up FileUtils.h
This removes some commented out functions and it also
removes CFir::Exists() since CFile::IsDir() does exactly
the same job (and it uses fewer syscalls for that).



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1042 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 13:32:34 +00:00
psychon
f74ab87e19 And fix a shitload of trailing whitespaces and space / tab mixups in ZNC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@959 726aef4b-f618-498e-8847-2d620e286838
2008-02-16 12:52:11 +00:00
psychon
bcb0306393 Don't allow users to change their user name through spoofed webadmin requests
Since adding and editing users is handled pretty much the same way in webadmin,
you could change your user name when you sent a POST requests with some
arbitrary user field:

 echo "user=newuser&submitted=1" | \
 lynx -post_data -auth=user:pass http://localhost:55455/edituser

This was spotted by SilverLeo who seems to spend quite some time trying to make
ZNC break, which is a good thing. Thanks!

Oh and btw, the last commit (delete the pid file) is from SilverLeo.
I forgot to mention him in the commit msg. Sorry.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@949 726aef4b-f618-498e-8847-2d620e286838
2008-02-10 10:18:54 +00:00
psychon
fc172bff6e Fix a NULL pointer dereference in the 'add user' page of webadmin
This was just recently introduced in rev 935 "Display user's vhost if it's
not in the global vhost list".

Thanks to icu and Kuja for reporting.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@937 726aef4b-f618-498e-8847-2d620e286838
2008-01-28 16:28:10 +00:00
psychon
9f19e82cf5 Webadmin: Display user's vhost too if it's not in the global vhost list
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@935 726aef4b-f618-498e-8847-2d620e286838
2008-01-20 16:50:53 +00:00
psychon
5370a54012 Add DenySetVHost patch from Veit Wahlich aka cru
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@925 726aef4b-f618-498e-8847-2d620e286838
2008-01-18 22:18:36 +00:00
psychon
e72c445694 Clean up includes
All the headers are now self-contained (g++ Header.h -o /dev/null).

Some system headers where moved to the .cpp they are actually needed in,
some of our own headers are includes less. (Especially MD5.h)

Headers are sorted alphabetically while in e.g. FileUtils.cpp FileUtils.h
is the first file included.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@915 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:31:16 +00:00
psychon
eeec633e30 Update copyright header for 2008
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@910 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:13:07 +00:00
psychon
1360effd31 This covers the code changes for the datadir move (which is now finished)
Based on darix' patch I wrote this. Modperl's changes were not tested since I
didn't find someone who could test it. Well...

Ah and btw it regenerates configure


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@902 726aef4b-f618-498e-8847-2d620e286838
2007-12-12 21:15:44 +00:00
psychon
ba27405483 Make webadmin use the GLOBALMODCONSTRUCTOR macro
Why didn't it do this already anyway?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@900 726aef4b-f618-498e-8847-2d620e286838
2007-12-12 20:57:47 +00:00
psychon
6609143820 Let webadmin use the user's defaults
Now webadmin uses what you have in your <User> section for DefModes,
BufferCount, AutoCycle and KeepBuffer when you create a new user.

Thanks to SilverLeo for noticing and writing this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@886 726aef4b-f618-498e-8847-2d620e286838
2007-12-02 09:19:24 +00:00
psychon
ee350ab744 Change second argument to module in OnLoad() from sErrorMsg to sMessage.
This message is always displayed when the module returns (well, screw webadmin)
and this way a module can notify the user if it loaded but something unexpected
happened.

As you might guess, no one uses this ATM :)

Proposal comes from prozac


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@855 726aef4b-f618-498e-8847-2d620e286838
2007-10-28 17:57:07 +00:00
psychon
5993255ac3 Fix some ICC warnings found by Kuja
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@846 726aef4b-f618-498e-8847-2d620e286838
2007-09-27 21:00:08 +00:00
psychon
a09a7e79f6 Switch to the copyright headers the GPLv2 wants us to have
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@843 726aef4b-f618-498e-8847-2d620e286838
2007-09-21 18:55:33 +00:00
psychon
3ce22e5d45 small webadmin fixup
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@804 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:48:22 +00:00
psychon
a3b405bd07 sync from my branch rev 983 and 993:
- module api change, if module fails to load it can give back an useful error message
- give a message when client doesnt supply a password when connecting
- some minor cleanup


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@803 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:42:00 +00:00
psychon
d82eb75d1c merge rev 962;965;972-975:
- increased select timeout to 0.5 secs (this should save CPU time)
- added real-life ISpoof example to the example znc.conf
- make away module ignore message from the user (fixes antiidle together with away)
- show error message when webadmin cant bind to a port (improved later)
- fix /me, it was turned into a CTCP
- remove an extra space


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@802 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:35:17 +00:00
psychon
1fa9187be6 Revs 945-948;952-953:
- add timezone offset if server is in another timezone than the client
- add prependTimestamp
- add version number to configure.in
- write connect delay back into znc.conf


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@801 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:29:39 +00:00
psychon
f601db2cd8 merge with rev 932 psychon branch:
- module call for /me's
- timestamps for playback and query buffer
- WALLOP stuff / fix
- properly join channels _after_ namesx or uhnames were set up
- dont screw up raws on reconnect when you ran /lusers
- change default quit msg and version reply to CZNC::GetTag(false)
- change CZNC::GetTag() to point to sf.net
- kind of an rewrite for partyline, added fixed channels (this doesnt work on irssi,
		did it ever work?)
- add the timestamp support to webadmin too
- add ConnectDelay config option to avoid being killed because we connected too fast
- make znc handle usermodes correctly


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@799 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:13:17 +00:00
prozacx
0a62274975 Committing patches from crox/psychon
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@790 726aef4b-f618-498e-8847-2d620e286838
2007-03-12 06:26:54 +00:00
prozacx
70aafdee8f Moved awaynick functionality into modules/awaynick.cpp module
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@775 726aef4b-f618-498e-8847-2d620e286838
2006-09-17 22:57:28 +00:00
prozacx
e06ca0d672 Added contact info
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@753 726aef4b-f618-498e-8847-2d620e286838
2006-09-13 07:48:28 +00:00
prozacx
68f3521099 Use the error reporting and return code from CZNC::AddUser()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@726 726aef4b-f618-498e-8847-2d620e286838
2006-04-29 19:40:14 +00:00
prozacx
e0d3cfa5db Return true if authed immediately by module
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@695 726aef4b-f618-498e-8847-2d620e286838
2006-03-16 10:02:15 +00:00
prozacx
50b998a566 Added support for auth modules
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@692 726aef4b-f618-498e-8847-2d620e286838
2006-03-16 01:20:12 +00:00
prozacx
ebd57d65c7 Fill in the VHostLoop for both editing and new users
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@683 726aef4b-f618-498e-8847-2d620e286838
2006-03-12 22:22:31 +00:00