Commit Graph

432 Commits

Author SHA1 Message Date
Alexey Sokolov 9de990715b More translateable strings (fix #1354) 2018-04-03 22:31:20 +01:00
Alexey Sokolov 1e08e5c702 Move gtest's printer for CString to a place visible to all tests 2018-04-02 12:17:14 +01:00
Alexey Sokolov 10c98e01a8 Why did I make this public? 2018-04-01 12:23:16 +01:00
Alexey Sokolov 1e23a36e1d More translateable strings (#1354) 2018-04-01 12:06:29 +01:00
Alexey Sokolov 1eceb5a5c7 More translateable strings (#1354) 2018-04-01 00:35:51 +01:00
Alexey Sokolov 6ca2d5caa0 More translateable strings, #1354 2018-03-25 22:57:05 +01:00
Alexey Sokolov a8d2df3852 Add PutIRC(CMessage) and PutIRCRaw()
Close #1193
2018-03-11 16:44:49 +00:00
Alexey Sokolov 8da45322f0 Fix CClient::PutClient comment, add CClient::PutClientRaw 2018-03-11 15:54:20 +00:00
Alexey Sokolov 658a6e6f90 Lie to modules less: make OnUserRaw strings raw 2018-02-18 22:14:18 +00:00
Alexey Sokolov 5cdbe33eaf Add GetText()/SetText() methods to more CMessage types.
They are aliases for existing methods, to simplify code reuse.
2018-02-11 14:10:11 +00:00
Alexey Sokolov a2470b3dd3 Make chan modes and permissions to be char instead of unsigned char.
Deprecate old module hooks which accept mode as unsigned char.

SWIG handles unsigned char as int, but char as a string.
Before this commit, usage of HasPerm from perl modules required this:
either $chan->HasPerm(ord('@')) or $chan->HasPerm(ord($ZNC::CChan::Op)).
Now ord() is not necessary, and these calls work too:
$chan->HasPerm('@') and $chan->HasPerm($ZNC::CChan::Op).

Fix #1486
2018-02-10 15:55:55 +00:00
Falk Seidel d647eaabc0 Welcome to 2018
The same procedure as last year, Miss Sophie?
The same procedure as every year, James.

[skip ci]
2018-01-19 19:38:58 +00:00
Fox Wilson 42939c998f Add "AuthOnlyViaModule" global/user setting
Setting AuthOnlyViaModule on a user causes CheckPass to never return true,
causing all authentication attempts using the configured password to fail, both
on IRC connections and for webadmin. This is useful in situations where an
external module (cyrusauth, certauth, imapauth) handles authentication. Setting
the global AuthOnlyViaModule option causes similar behavior across every
user. If AuthOnlyViaModule is set to true globally, it cannot be overridden
per-user.

Close #1474
Close #331
2017-12-22 14:23:17 +00:00
Vladimir Panteleev 15b1f8d8fa Change format syntax to a simple custom %f/%#f scheme 2017-12-10 09:45:58 +00:00
Vladimir Panteleev 03c4c0b165 Use and propagate microsecond-precision timestamps to FormatTime
This enables sub-second precision timestamp formatting for logs and
clients without server-time.
2017-10-26 00:00:51 +00:00
Vladimir Panteleev 901a21e91b Utils: Add FormatTime overload taking timeval
This overload also supports additional format sequences for formatting
the sub-second part of timeval.
2017-10-26 00:00:50 +00:00
Jos Ahrens f006e31fed debugging: Add Filter method to hide filter sensitive data 2017-10-02 14:09:45 +02:00
Alexey Sokolov f885699d1a Make list of languages installed discoverable at runtime.
Stop hardcoding Russian in webadmin.
Limit the setting in controlpanel to the known languages, because
untrusted language code might lead to some interesting vulnerabilities.
2017-08-19 18:09:12 +01:00
Alexey Sokolov 289e066e67 Fix build of ZNC 1.7 branch on GCC 7.
Patch by bjoe2k4.

Close #1420
2017-06-22 23:20:34 +01:00
Eli Young 6d0ec644d0 Support custom message tags
This provides a way for modules to register message tags and updates the
core to send tags to clients if the relevant capabilities are enabled.
2017-05-08 18:01:46 -07:00
Eli Young 823ac07240 Add OnSendToIRCMessage and OnSendToClientMessage
This also alters PutClient such that the CMessage variant handles
sending messages, rather than the CString variant. As a side bonus, this
gives callers better information on whether the message was sent to the
client. Additionally, it eliminates the need for a hook to let modules
set the tags sent to a client, as that can now be done inside
OnSendToClientMessage.
2017-04-18 15:43:16 -07:00
Eli Young b46702ec3b Fix OnUserQuitMessage documentation 2017-04-10 14:45:00 -07:00
Phansa a0a3479d2f Adding liscene information 2017-03-12 20:39:58 -04:00
Phansa 3189ce7f8a Welcome to 2017
Welcome to 2017

temp

temp2
2017-03-12 20:34:26 -04:00
Alexey Sokolov 88d1e27cc6 Fix CMake build:
* VERSION_EXTRA is now supported
* znc-buildmod uses the correct ZNC library instead of one in /usr/share
2017-02-28 23:01:09 +00:00
Alexey Sokolov 80c24b335d Update a comment 2017-02-25 12:13:24 +00:00
Alexey Sokolov a44aa0c699 Revert tables to how they were in 1.4
See #914
2017-02-24 23:49:18 +00:00
Alexey Sokolov 2fcde9f2e1 Fix a couple of issues pointed out by https://scan.coverity.com/ 2016-12-26 17:22:09 +00:00
Alexey Sokolov b666931883 Add an option to change ping timeout time.
Fix #979
2016-12-26 15:49:26 +00:00
Alexey Sokolov d9c1da8a68 Make it possible to translate arguments in help text of module commands
Ref #1354
2016-12-25 21:11:02 +00:00
Alexey Sokolov a1e1591ba5 Add another layer of indirection for translation
To make supporting old modules easier

Ref #1354
2016-12-25 20:31:17 +00:00
Alexey Sokolov c803a85e13 Rename new On...Message modules callbacks to be more consistent.
OnPrivMessage -> OnPrivTextMessage
OnChanMessage -> OnChanTextMessage

Fix #1191
2016-12-25 15:48:29 +00:00
Alexey Sokolov 6fbab7b44c Add CIDR support to TrustedProxy setting
Fix #1219
2016-12-25 13:00:02 +00:00
Alexey Sokolov 13049e5fc3 Refactor the way how modules are loaded.
Make version checks more strict.

This finishes attempt to preserve ABI between patch versions. That
didn't work well, and the people who could make it work, left the
project already.

Close #1255
Close #1274
Close #172
2016-12-22 20:49:01 +00:00
Alexey Sokolov 5c524df298 Merge branch '1.6.x' 2016-11-20 18:09:55 +00:00
Alexey Sokolov 6366430870 Fix deletion of users which are connecting.
Close #1342
2016-11-20 17:56:26 +00:00
Latchezar Tzvetkoff a9a7f17910 Allow modules to override CSRF protection.
Useful for Web APIs and all other kinds of things.

API changes:
	- Added public CHTTPSock::GetURI() method
	- Added public CModule::ValidateWebRequestCSRFCheck() method
	- Made CWebSock::GetCSRFCheck() method public so it can be accessed
	  from CModule
	- Added public CWebSock::ValidateCSRFCheck() method

Other changes:
	- Added a Sample Web API module (modules/samplewebapi.cpp) and a
	  simple web form with no CSRF check.

Implements feature request #1180.
2016-10-05 09:29:40 +01:00
Alexey Sokolov 222ae86fcc Fix newest additions to keepnick module and write the test for it.
Fix the documentation.

See #1324 and #1325
2016-10-05 09:21:21 +01:00
Jos Ahrens b6ffaa6527 Message.h: Add a comment briefly explaining how to use the class, and what exactly a message is. 2016-10-02 00:21:58 +01:00
Alexey Sokolov cc653efb6b Rename translation methods to be not one letter.
It fixes several warnings, when the name was shadowed by a local "p".
2016-09-12 00:01:45 +01:00
Alexey Sokolov 85984ee4be Merge pull request #1277 from xnrand/master
Add network-specific settings for cert validation
2016-08-20 12:08:41 +01:00
Alexey Sokolov aff7e25043 Fix cygwin build
(cherry picked from commit f1ef8c79db)
2016-08-13 09:55:00 +01:00
Alexey Sokolov f1ef8c79db Fix cygwin build 2016-07-20 00:19:19 +01:00
Tor Arne Vestbø 4d5724eb0a Add OnPrivBufferStarting/Ending signals, similar to Chan buffers
Allows hooking into query buffer playback before and after all the
lines of the query buffer are replayed. The EModRet return value
has no effect at the moment, but may be used in the future to e.g.
prevent playback. The Chan version of these signals use EModRet to
skip emitting the status message, but not the whole playback.
2016-07-13 15:15:56 +02:00
Tor Arne Vestbø 02bfb9eaf5 Centralize logic to get current server time
A few different implementations of computing the current time were
spread out through the code base, most of them using gettimeofday().

This centralizes the logic in CUtil::GetTime() for easier maintenance,
and also allows all call sites to get the benefit of the clock_gettime()
code path on systems that support it.
2016-07-06 01:16:15 +02:00
xnrand 409ed4b6bc Add network-specific config for cert validation
Added the following two network-specific configuration options that can
be changed via controlpanel or webadmin:

* TrustAllCerts: Will trust ALL certificates when enabled, effectively
  disabling TLS certificate validation.
  Default value: false
* TrustPKI: Whether or not to trust PKI-valid certificates. Setting this
  to false will make znc trust only trusted certificates added by the
  user.
  Default value: true

With default values, behavior is exactly the same as before.

This is based on the work of Roelf Wichertjes. See YourBNC/znc@5c747598.

See znc/znc#866.
2016-05-20 01:17:26 +02:00
Adam 6bde0fc270 Add config write delay setting 2016-03-26 13:34:02 -04:00
Alexey Sokolov 8893b90e3a Modules web subpages should have translateable titles 2016-02-24 21:31:38 +00:00
Alexey Sokolov e5ff36eb8e Revert version to 1.6.x after release of 1.6.3 2016-02-23 21:37:38 +00:00
Alexey Sokolov b49a92b1e6 ZNC 1.6.3-rc1 2016-02-08 21:18:12 +00:00