25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00
Commit Graph

2109 Commits

Author SHA1 Message Date
Andreas Köhler
614f13714c Use c2s state data as user and server in ejabberd_c2s:is_privacy_allow
is_privacy_allow is only used in ejabberd_c2s:handle_info/3 to determine
for a few presence types whether the packet is allowed to be forwarded
to the user's client. This only makes sense if To#jid.user and
To#jid.server match StateData#state.user and StateData#state.server.

Also, add the atom in as parameter to a new argument Dir of
is_privacy_allow and extract from that function
privacy_check_packet(StateData, From, To, Packet, Dir) which runs the
privavcy check without converting allow/deny to true/false.
2010-11-10 15:41:05 +01:00
Andreas Köhler
642b18edcb Correct error responses of forbidden offline last activity queries
According to XEP-0012 Last Activity, the server must return iq errors
with forbidden instead of not-allowed.

Fixes problem 1 of EJAB-1158.
2010-11-10 15:41:03 +01:00
Christophe Romain
03239c662e populate pubsub#roster_groups_allowed in node configuration options (thanks to Karim Gemayel)(EJAB-1344) 2010-11-10 15:14:16 +01:00
Christophe Romain
fbb84c8256 fix bad plugin order issue injected in previous patch (EJAB-1286) 2010-11-09 14:36:04 +01:00
Andreas Köhler
e710ac51eb Correct privacy check direction in mod_last (EJAB-1339)
The change for EJAB-1271 to change the direction of the privacy check
from out to in violates the idea that the check should imitate a
subscription state check of from. Rather correct the order of the From
and To parameters.
2010-11-09 13:57:01 +01:00
Andreas Köhler
6ce29e7ecb Change max restart strategy of ejabberd_odbc_sup to handle some SQL timeouts. 2010-11-08 18:42:37 +01:00
Badlop
e84d853bc3 Improve the IQ error stanzas to provide an explanation (EJAB-1262) 2010-11-08 12:01:14 +01:00
Christophe Romain
5e0f2b8560 avoid node_call to break transaction (thanks to Karim Gemayel)(EJAB-1286) 2010-11-08 11:18:33 +01:00
Andreas Köhler
01b6cd3aba Re-raise exceptions caught in gen_mod:start_module/3 (EJAB-1335)
Modules configured by the administrator normally should not be treated
as optional, so a exception (error, exit, throw) to start them should not
be caught and logged only.

This patch re-raises a caught exception instead of ignoring the
exception and inserting the module's opts on success. That way
gen_mod:get_module_opt/4 should work while calling Module:start/2.
2010-11-07 00:47:53 +01:00
Badlop
2ebfd4090a Fix register 2010-11-06 21:53:18 +01:00
Evgeniy Khramtsov
e4a1eb4370 Take care of xml:lang attribute in unauthenticated stanzas as well 2010-11-06 21:53:16 +01:00
Evgeniy Khramtsov
e3afec9465 Disable LRU caching algorithm for LDAP shared rosters 2010-11-06 21:53:14 +01:00
Evgeniy Khramtsov
29fbe6d8e1 Do not store long language tag to avoid possible DoS/flood attacks 2010-11-06 21:53:13 +01:00
Evgeniy Khramtsov
5c3611fe32 LDAP shared roster support (thanks to Realloc and Marcin Owsiany) 2010-11-06 21:53:11 +01:00
Badlop
4a1d8c2cd2 New ip_access option restricts which IPs can register (thanks to Alexey Shchepin)(EJAB-915) 2010-11-05 19:33:20 +01:00
Badlop
b9c6f6e627 Disable mod_register_web in default config because by default captcha is disabled 2010-11-05 19:33:10 +01:00
Badlop
d456578b3c Added mod_register_web: web page for account registration (EJAB-471) 2010-11-05 18:21:59 +01:00
Badlop
659d546897 Fix warnings detected by Dialyzer 2010-11-04 01:00:18 +01:00
Jonas Ådahl
bacecae3dd Fixes a leak of ejabberd_receiver processes.
When a (non-frontend) socket module without any custom receiver fails to
start, the newly created ejabberd_receiver process needs to be properly
closed.
2010-11-03 17:10:46 +01:00
Badlop
5168f68946 Don't add Pid to Captcha record when it's requested by c2s instead of muc 2010-11-03 14:05:27 +01:00
Badlop
9a32615122 Handle incoherence of argument type in calls to remove_user 2010-11-03 13:24:40 +01:00
Badlop
48dcc5180a Additional fixes for previous captcha commits related to exmpp 2010-11-03 12:44:11 +01:00
Badlop
32868e534e Include a Required xml element in the captcha field 2010-11-03 12:44:04 +01:00
Evgeniy Khramtsov
773c54f912 Add top-level instructions for x:data incompatible clients 2010-11-03 12:44:03 +01:00
Badlop
82e8048a8a Changes in registration form to workaround client problems (EJAB-1262)
Changes included:
* Remove var in fixed field because Gajim and Tkabber display it to user
* Add workaround for Psi's overlap fields
* Add var=url attribute, required by Psi to display the field
* Provide the image URL as a copy-able form field
2010-11-03 12:44:02 +01:00
Badlop
633b467a22 Workaround for Psi's wrong Type in form submission 2010-11-03 12:44:01 +01:00
Badlop
b0ae3d14aa Add CAPTCHA example configurations to cfg (EJAB-1262)(EJAB-1326) 2010-11-03 12:44:00 +01:00
Evgeniy Khramtsov
2d8bfb1a15 Provide image url in registration form when captcha is enabled 2010-11-03 12:43:59 +01:00
Evgeniy Khramtsov
30366dbe98 Add password entropy check (EJAB-1326) 2010-11-03 12:43:58 +01:00
Evgeniy Khramtsov
55bd17d6f5 Rename option captcha to captcha_protected for consistency 2010-11-03 12:43:57 +01:00
Badlop
f310292da4 CAPTCHA IBR support (EJAB-1262)(thanks to Evgeniy Khramtsov) 2010-11-03 12:43:55 +01:00
Badlop
81546f3270 Fix crash in ejabberd_c2s when blacklist hook returned true (thanks to Jonas Ådahl)
Cause of the crash jlib:ip_to_list/1 only supports IP tuples using the
form {N1,N2,N3,N4} which is not the case when IPv6 is enabled.
2010-11-02 14:04:10 +01:00
Badlop
91dee14ad6 Fix errors in EDoc comments 2010-10-28 18:23:02 +02:00
Badlop
231d44ffa3 Handle binary data from SockMod:recv in ejabberd_http:recv_data/3 (thanks to Andreas Köhler)(EJAB-1331) 2010-10-27 21:21:15 +02:00
Andreas Köhler
70c247d357 Ignore Length argument to tls:recv/[23] (EJAB-1327)
The Length argument cannot be used for gen_tcp:recv/3, because the
compressed size does not equal the desired uncompressed one.
2010-10-26 19:33:56 +02:00
Andreas Köhler
1579bf2d18 Re-use the TLSSock argument in tls:send/2 (EJAB-1327) 2010-10-26 19:33:53 +02:00
Christophe Romain
378b8a60c6 add function specification, convert string() to binary(), fix pubsub.hrl (thanks to Karim Gemayel) 2010-10-19 17:08:59 +02:00
Peter Lemenkov
70cdcfcae1 Change directory before any operation to one readable by INSTALLUSER (EJAB-1322)
This is required in order to suppress error messages like
"File operation error: eacces" when ejabberd was started from directory,
which is not readable by INSTALLUSER (/root, for example). See rhbz #564686:

https://bugzilla.redhat.com/564686

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2010-10-19 01:16:15 +02:00
Badlop
a473935782 Fix bug in mod_pubsub in_subscription return value 2010-10-19 00:28:24 +02:00
Badlop
16f0873488 Fix bug when routing error stanza 2010-10-16 22:51:51 +02:00
Badlop
17b4aaa1f7 When privacy list denies local user's outgoing stanza, try to return error (EJAB-1320)
See:
http://xmpp.org/extensions/xep-0016.html#example-51
Example 51. Error: contact is blocked
2010-10-16 22:51:50 +02:00
Badlop
eddbad2c76 Check privacy of outgoing Message stanzas (EJAB-1320) 2010-10-16 22:51:48 +02:00
Badlop
2e932dd85c Add support to ejabberd_ctl to handle anonymous command arguments 2010-10-16 00:48:03 +02:00
Badlop
3bc7127743 Rename aclocal.m4 to acinclude.m4 (thanks to Andreas Köhler)
Also fixed minor typos, added the compiled aclocal.m4 to gitignore,
and documented how to build the script 'configure'.

Related documentation:
http://www.gnu.org/software/hello/manual/automake/Local-Macros.html#Local-Macros
http://www.gnu.org/software/hello/manual/automake/Invoking-aclocal.html#Invoking-aclocal
2010-10-15 16:24:17 +02:00
Badlop
d6a69dbca5 Fix errors detected by Dialyzer 2010-10-15 13:11:14 +02:00
Badlop
864b0ec149 Document ejabberd_loglevel using EDoc (EJAB-225) 2010-10-15 13:10:56 +02:00
Badlop
abdbb347eb Rename ejabberd_loglevel:get/0 to get_default, and add a more general get (EJAB-225)
API change: ejabberd_loglevel:get/0 renamed to ejabberd_loglevel:get_default/0
2010-10-15 13:10:53 +02:00
Andreas Köhler
651ee5eb19 Fix unused variable warning in ejabberd_loglevel 2010-10-15 13:10:43 +02:00
Andreas Köhler
e1f5fb798c Add set_custom/2, clear_custom/0 and clear_custom/1 to ejabberd_loglevel 2010-10-15 13:10:42 +02:00
Andreas Köhler
81555d8def Add support for changing the loglevels for given modules (EJAB-225)
ejabberd_loglevel:set/1 now understands more input formats:

set(Param) -> {module, ejabberd_logger}
    Param = Level | {Level, CustomLevels}
    CustomLevels = [CustomLevel]
    CustomLevel = {Module, Level}
    Module = atom()
    Level = integer() | atom()

set(Level) is equivalent to set({Level, []}), so it clears all module
level customizations. log_src/2 adds additional function heads for those
_msg function and module combinations that need non-default behavior,
i.e. add or filter logging.

ejabberd_loglevel:get/0 only returns the default log level. To retrieve
the complete setting use ejabberd_logger:get/0 instead.
2010-10-15 13:10:40 +02:00
Andreas Köhler
cc76869da5 Use warning_msg event type for warning log level. 2010-10-15 13:10:39 +02:00
Andreas Köhler
6523258b53 Add warning message and report handlers to ejabberd_logger_h.erl. 2010-10-15 13:10:38 +02:00
Andreas Köhler
1cbe821145 Improve ejabberd_logger code generation
Split the monolithic function ejabberd_loglevel:ejabberd_logger_src/1
into separate functions returning deep lists.

log_src/2 now returns the code for any of *_msg/4. Its parameters are
the current loglevel (integer()) and a loglevel specification
(#loglevel{}), with added information in #loglevel:

- function: The api function enabled by this level, may be no_log
- event_type: The type of the event sent to the error_logger
- msg_prefix: One character used in the message (one of "DIWEC")

If the current loglevel is too low for logging, the api function is
optimized at compile time.
2010-10-15 13:10:36 +02:00
Andreas Köhler
61d8bf9440 Use records for encoding static loglevel information. 2010-10-15 13:10:34 +02:00
Badlop
d1f5fb4aa9 Speed up ejabberd_s2s:is_service/2, allow_host/2 (thanks to Andreas Köhler)(EJAB-1319)
Iterating through the list of possible parent domains of a given domain
and comparing with the list of hosts or routes is almost always faster
than doing it the other way around. It naturally returns the shortest or
longest parent domain satisfying a predicate, whereas the possibly long
list compared with would need to be sorted by length first.
2010-10-14 21:14:46 +02:00
Christophe Romain
a73d451576 make http-bind restartable (thanks to Andreas Köhler)(EJAB-1318) 2010-10-13 10:55:35 +02:00
Pablo Polvorin
ce9ce8293b Merge branch 'master' of git+ssh://git@gitorious.process-one.net/ejabberd/mainline 2010-10-12 10:57:07 -03:00
Badlop
82a8dc7b3a Cosmetic code changes to support emacs indentation 2010-10-07 17:38:18 +02:00
Badlop
404b9a4a11 Minor fix in http_bind detected by Dialyzer 2010-10-07 00:16:24 +02:00
Badlop
f4f2f46f50 Dirty fixes for Dialyzer warnings in mod_privacy 2010-10-07 00:14:28 +02:00
Badlop
6c74c67069 Fix Captcha library and MUC use for exmpp 2010-10-06 13:05:21 +02:00
Badlop
645ddcb749 Fix unused variables 2010-10-05 15:48:11 +02:00
Evgeniy Khramtsov
8647ca5f0b use one_queue IQ discipline by default 2010-10-05 21:32:47 +10:00
Christophe Romain
ee861e650d fix dializer warnings (thanks to Karim Gemayel) 2010-10-04 17:41:59 +02:00
Badlop
349c44fcc0 Fix Edoc errors (thanks to Karim Gemayel) 2010-09-30 13:44:16 +02:00
Christophe Romain
78b8307a1f fix dializer warnings (thanks to Karim Gemayel) 2010-09-30 12:06:40 +02:00
Christophe Romain
7c580bbeed Merge branch 'master' of git+ssh://gitorious.process-one.net/ejabberd/mainline 2010-09-29 11:48:40 +02:00
Christophe Romain
6b7d73dcd5 fix dializer errors, improve documentation (thanks to Karim Gemayel)(EJAB-1260) 2010-09-29 11:48:19 +02:00
Badlop
c57f726ecb Fix some Dialyzer warnings 2010-09-28 16:06:37 +02:00
Badlop
56b66ab64f Dialyzer fixes. Ensure all_table_hosts/1 returns only a list of binaries 2010-09-28 16:06:35 +02:00
Badlop
403690a498 Only install the guide.html files when it was compiled (EJAB-1311) 2010-09-28 16:06:32 +02:00
Christophe Romain
f7dc4df784 Allow use with binary() Host from exmpp (thanks to Karim Gemayel) 2010-09-28 10:06:16 +02:00
Badlop
819dbdbf59 Move the extract_translations code to the tools dir (EJAB-1311) 2010-09-27 13:39:15 +02:00
Badlop
73c992c5af Delete compiled files from git; they are included in source package (EJAB-1311) 2010-09-27 13:31:50 +02:00
Badlop
a46f02a136 Fix typo in type 2010-09-22 00:14:47 +02:00
Badlop
62b3b31b8d Allow webadmins to change roster of user (EJAB-72) 2010-09-21 17:05:50 +02:00
Evgeniy Khramtsov
d4480c1361 fixes default value for cache_life_time 2010-09-21 04:32:42 +10:00
Christophe Romain
2e75faefae improve type specification 2010-09-20 16:54:37 +02:00
Badlop
9bde1dc9af Add missing needdb, use bare jid to get roster; now group and subs blocking works again (thanks to Andreas Köhler) 2010-09-17 21:06:30 +02:00
Andreas Köhler
afac34de88 Discard unmatched INFO messages in ejabberd services.
This patch will stop services terminating with function clause messages,
but doesn't affect the message queue at all.
2010-09-17 19:28:35 +02:00
Christophe Romain
1cbfdce457 remove garbage configuration 2010-09-16 14:52:30 +02:00
Badlop
cb953f949f Fix problems reported by Dialyzer 2010-09-15 20:04:35 +02:00
Christophe Romain
52deb16676 apply modification for the exmpp #jid{} record update 2010-09-15 12:16:03 +02:00
Badlop
89a98be605 Display priority, login time, pid and pid info in webadmin (EJAB-1300) 2010-09-13 17:49:55 +02:00
Badlop
813022aec1 Support timezone West of UTC (thanks to Edwin Fine)(EJAB-1301) 2010-09-13 12:07:35 +02:00
Pablo Polvorin
0d5f20cae1 Include roster pack patch from Geoff
Patch was already applied to 2.x branch, but not yet ported to master.
2010-09-10 15:32:19 -03:00
Christophe Romain
4b5b98b465 clean nodeid/nidx variables names (thanks to Karim)(EJAB-1000) 2010-09-10 19:45:28 +02:00
Evgeniy Khramtsov
556892aebf cache lifetime should be converted in microseconds 2010-09-08 02:37:01 +10:00
Evgeniy Khramtsov
7a3aa8f97d Implemented dirty (non-atomic) functions; added copyright notice 2010-08-31 18:07:24 +10:00
Evgeniy Khramtsov
1bd43bbd2d implemented backend-independed key-value cacheing table; applied to mod_caps.erl first 2010-08-30 14:32:48 +10:00
Pablo Polvorin
77d5eabd00 Update rosteritem table definition for mysql (gen_storage)
Previous definition do not work with gen_storage.
gen_storage creates the table when they don't exists, but if
they exists it simple uses that definition.

Note that the column values also had changed in gen_storage,
so instead of "B" for a bidirectional subscription, it must be
"both".  Keep this in mind when loading data into the DB
2010-08-27 14:17:04 -03:00
Badlop
9050aa1de0 Support exmpp's jid record, and require next exmpp release (EXMPP-41) 2010-08-27 15:36:29 +02:00
Evgeniy Khramtsov
445691bab1 fixes ampersand escaping (EJAB-1258) 2010-08-19 20:37:28 +10:00
Andreas Köhler
d6722e353f Fix mod_offline:remove_old_messages/1. 2010-08-18 13:22:38 +02:00
Andreas Köhler
b2d96d0753 Fix gen_storage:matchrules_transform_conditions/2 for =/=, and, andalso, or and orelse. 2010-08-18 13:22:37 +02:00
Andreas Köhler
7f1759ab0a Fix a ?DEBUG call in ejabberd_auth. 2010-08-18 13:22:34 +02:00
Badlop
3cb128963c Fix ejabberd_auth:get_vh_registered_users/2 (thanks to Andreas Köhler) 2010-08-18 13:22:30 +02:00
Badlop
555a3113a1 Fix EDoc error 2010-08-16 12:02:45 +02:00
Badlop
dffb9cdaf9 Fix Dialyzer reports 2010-08-13 17:41:05 +02:00
Badlop
6e65f0694e New API to update host config on the fly (thanks to Juan Pablo Carlino)
Adds ejabberd_hosts:update_host_conf/2 to update a host with a new
configuration on the fly. Typically this is useful to enable / disable
specific modules for a given host without restarting the whole app.
Also fixes a problem with mod_disco, after config refreshing to include
global services if there are not locally available.
2010-08-11 23:31:30 +02:00