Commit Graph

33 Commits

Author SHA1 Message Date
psychon
99f1efc843 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
f2d7ae1a08 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
cb5206b230 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
bed30e9eb6 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
b1da11f102 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
psychon
fffa0f7d36 Remove the spamminess of --debug a little
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1836 726aef4b-f618-498e-8847-2d620e286838
2010-03-16 09:53:58 +00:00
prozacx
415754dd16 Removed some debug comments and a debug print
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1802 726aef4b-f618-498e-8847-2d620e286838
2010-03-03 01:47:26 +00:00
psychon
f72e2f8abd Remove --disable-modules
ZNC without modules is like rain without being inside,
you really don't want that!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1794 726aef4b-f618-498e-8847-2d620e286838
2010-02-25 12:29:40 +00:00
prozacx
ad92c58c42 Initial commit of webmods - still lots of work to be done
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1784 726aef4b-f618-498e-8847-2d620e286838
2010-02-22 07:40:22 +00:00
psychon
1d88f564dc Fix a bunch of style suggestions from cppcheck[1]
Thanks to DarthGandalf for this patch. You must be bored. :P

[1] cppcheck.sf.net


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1776 726aef4b-f618-498e-8847-2d620e286838
2010-02-19 16:21:07 +00:00
psychon
702faeeed5 Revert r1738-1742
This broke webadmin, changed CString::Token()'s behavior possibly breaking a lot
of stuff just before a release and added an unused config entry.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1748 726aef4b-f618-498e-8847-2d620e286838
2010-02-08 13:49:44 +00:00
prozacx
d2881ee9d1 Fixed a bug introduced in r1740 where template files weren't being found
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1741 726aef4b-f618-498e-8847-2d620e286838
2010-02-07 04:53:06 +00:00
prozacx
ece0218b07 Added ability to set paths to include-only which will not be used for the root file but only the INC'd ones
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1740 726aef4b-f618-498e-8847-2d620e286838
2010-02-07 03:57:55 +00:00
silverleo
07d7477dec It's 2010, where's my hoverboard?
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1693 726aef4b-f618-498e-8847-2d620e286838
2010-01-06 09:37:05 +00:00
psychon
c7583c4946 Fix a low impact directory traversal bug
A common pattern for checking directories in ZNC is the following:

	sAbsolutePath = CDir::ChangeDir(sAllowedPath, sFile);
	if (sAbsolutePath.Left(sAllowedPath.length()) != sAllowedPath)
		Error;

But there is a problem: If sAllowedPath doesn't end with a slash, we are
vulnerable to an attack. If e.g. sAllowedPath = "/foo/bar", then
sFile = "../bartender" would result in sAbsolutePath = "/foo/bartender". Since
this path does begin with sAllowedPath, the code allowed it.

There shouldn't be any places where this can be exploited currently, but it is
still a security bug (path traversal).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1569 726aef4b-f618-498e-8847-2d620e286838
2009-07-21 18:36:33 +00:00
psychon
31b5df8b73 CTempalte: Fix a minor error in a debug message
Patch by KiNgMaR, thanks


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1545 726aef4b-f618-498e-8847-2d620e286838
2009-06-19 15:34:59 +00:00
prozacx
c4a6f39b53 Pulled in CString changes from my common repository to help facilitate the upcoming webmods changes
Changes include...

- CString -
Addition of LCString typedef to list<CString>

Added four more args to CString::Token()...
	bool bAllowEmpty = false        <-- This default of false is NOT backward compatible but seems way more intuitive
	const CString& sLeft = ""
	const CString& sRight = ""
	bool bTrimQuotes = true

Added CString::OptionSplit()
Added CString::QuoteSplit()

Added two new args to CString::Split()...
	bool bTrimQuotes = true,
	bool bTrimWhiteSpace = false

- CTemplate -
Added new class CTemplateTagHandler to provide capability to add custom tags and vars
Added var name pointer dereferencing in the form of <? VAR Name=*other_var ?> (use ** to start with a literal star)
Added a list of paths that can be used to look for a given filename in multiple locations
Added CTemplate::PrependPath()
Added CTemplate::AppendPath()
Added CTemplate::RemovePath()
Added CTemplate::ClearPath()
Added CTemplate::PrintString() for filling a CString& instead of a stream
Added <? LT ?> which outputs a literal "<?"
Added <? GT ?> which outputs a literal "?>"
Added <? SETBLOCK ?> and <? ENDSETBLOCK ?> for setting a variable's value to the contents between the tags
Added <? EXPAND ?> for expanding a filename to a path using the settable list of paths
Added <? BREAK ?> and <? CONTINUE ?> inner loop tags
Added <? EXIT ?> tag to stop processing
Added <? DEBUG ?> tag for printing to DEBUG()
Added REVERSE keyword to the <? LOOP ?> tag



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1537 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 05:48:12 +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
6345ce12fa Make O_RDONLY the default mode when opening files through CFile
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1336 726aef4b-f618-498e-8847-2d620e286838
2009-01-19 15:55:41 +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
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
1f9e4f9601 Save some space for --disable-modules by not compiling template and http socks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@927 726aef4b-f618-498e-8847-2d620e286838
2008-01-18 22:46:40 +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
b490b12058 Fix some gcc 4.3 warnings
These are mostly string casts, handling function's return value and some
weird warning about missing spaces on empty while loops.

These were reported by and fixed with Marcus Rueckert <darix@opensu.se>.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@904 726aef4b-f618-498e-8847-2d620e286838
2007-12-20 18:31:48 +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
prozacx
6dcacaa79e Added contact info
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@752 726aef4b-f618-498e-8847-2d620e286838
2006-09-13 07:39:48 +00:00
prozacx
0720669c81 Added template options
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@717 726aef4b-f618-498e-8847-2d620e286838
2006-03-26 20:45:54 +00:00
prozacx
ebaceebd8b Added an extra debug print
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@712 726aef4b-f618-498e-8847-2d620e286838
2006-03-25 10:10:39 +00:00
prozacx
a9e60b43c5 Migrated away from CString::ToString() in favor of explicit constructors
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@669 726aef4b-f618-498e-8847-2d620e286838
2006-02-25 09:43:35 +00:00
prozacx
1fe82b66fb Fail if unable to open an included template
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@646 726aef4b-f618-498e-8847-2d620e286838
2006-02-12 00:18:52 +00:00
prozacx
4cb6e9151b Added debug prints
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@621 726aef4b-f618-498e-8847-2d620e286838
2006-02-08 08:42:48 +00:00
prozacx
ecf431f246 Added CTemplate support which included upgrading String.cpp/h and FileUtils.cpp/h and fixing some issues
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@603 726aef4b-f618-498e-8847-2d620e286838
2006-02-05 05:01:53 +00:00