Compare commits
159 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 283d441d27 | |||
| 7d8d8f77da | |||
| 1b0ea74818 | |||
| d87336e12e | |||
| 32805c3ba1 | |||
| 19966a7353 | |||
| be99c4b0eb | |||
| da893f4293 | |||
| 6e04bcbbf8 | |||
| 053f45ab39 | |||
| 3e12700e11 | |||
| 048b1a5db3 | |||
| 012a0529a8 | |||
| 553b402d03 | |||
| efaf182d54 | |||
| 2c5b0fb896 | |||
| 04ff0c2f6f | |||
| b32793efcf | |||
| ee02b0b57f | |||
| 5141edd757 | |||
| c0cc236196 | |||
| 3a3a89007a | |||
| 919914d8ac | |||
| d153b773a3 | |||
| 252a08e037 | |||
| 9539a50c33 | |||
| 2bcee1f85d | |||
| 2890c01979 | |||
| cd1eddde1a | |||
| a61b838ad9 | |||
| bba71d464e | |||
| 6f71558e18 | |||
| feb0bceb41 | |||
| 6349ff898f | |||
| 197246bad8 | |||
| cc9990fcaa | |||
| bd553be6cd | |||
| 84bc6844b9 | |||
| efb6615cfd | |||
| db8eeb78e5 | |||
| 693e32aecf | |||
| 34d93528ae | |||
| 8ef0fe6b56 | |||
| ba258b0a3e | |||
| 3dd58372fe | |||
| 2042a7ab27 | |||
| 26cf780476 | |||
| a2b8263a20 | |||
| e950adc0ef | |||
| 184251b162 | |||
| 1effe2be49 | |||
| 8a12914fd6 | |||
| a4ee23edfe | |||
| 7224ec8cb4 | |||
| 096825fc55 | |||
| c9aef303a2 | |||
| 3ced58c239 | |||
| 404c2dc0e5 | |||
| 2a0823f423 | |||
| 995941b593 | |||
| 2493bb99d4 | |||
| e0fdf9a4e9 | |||
| 55b586e51c | |||
| 0b217097dd | |||
| d5df314295 | |||
| 28c34a844a | |||
| 3c88ab49f0 | |||
| b338dd671f | |||
| 2cda62dceb | |||
| 5d6fe1a055 | |||
| 7ecbc0cd89 | |||
| 2f4db862f4 | |||
| 11f68cf7fd | |||
| 5a05eb8d62 | |||
| 79a0a44505 | |||
| 54842e7585 | |||
| 76b19660e3 | |||
| 68ecc1f082 | |||
| 9147a1d2dd | |||
| 469f1c43a6 | |||
| 9dd66c241c | |||
| f5e489c764 | |||
| 31b00c25c8 | |||
| 4f1fe31627 | |||
| d22154a2d4 | |||
| 751a8fbd37 | |||
| 971165cb88 | |||
| 6ea15171f7 | |||
| 782ee63266 | |||
| d9f3c87899 | |||
| 2d5fdbab64 | |||
| f841acb21f | |||
| 71e87aef6e | |||
| df21b2d48c | |||
| 35f520e3d9 | |||
| 318823fe68 | |||
| 102281194f | |||
| 6768a21d36 | |||
| 895e104b6a | |||
| c6090dd8ca | |||
| 293676d2a6 | |||
| 4ebaf3efa0 | |||
| 82e8b16a39 | |||
| fc2ea76a45 | |||
| ae939c5f80 | |||
| 745106c83d | |||
| 546bb02153 | |||
| 663f6f76a7 | |||
| b1ca88a5eb | |||
| cdcc3a2520 | |||
| 3c90d7c2b9 | |||
| bc18e89d61 | |||
| e956ca4fe3 | |||
| 53c994825c | |||
| 085d979037 | |||
| 49b02c0a9f | |||
| d8405b694e | |||
| 95bd9068f7 | |||
| 407d3b77b7 | |||
| 3dfcc4c4d3 | |||
| 1de6329c41 | |||
| 8047ff0617 | |||
| 8032533f26 | |||
| 00c3bc2450 | |||
| c76a009238 | |||
| 8012133539 | |||
| 1e56a614f9 | |||
| 971c9ce5a5 | |||
| 7abfd51534 | |||
| 7e86698606 | |||
| 45ccda9961 | |||
| 2c9d424330 | |||
| 541f381145 | |||
| a7cd412a76 | |||
| ab310255d7 | |||
| d9241c9e75 | |||
| bc8294990a | |||
| 25d8e53735 | |||
| f59c0c9eb2 | |||
| aaae1339e1 | |||
| 38d218c129 | |||
| c67eaeb534 | |||
| 8a140dd509 | |||
| 6924b4c3e8 | |||
| 73f40db258 | |||
| 56740871f1 | |||
| 6c9eb98792 | |||
| 50b133f6a2 | |||
| fef60fe1d3 | |||
| 31940f16c7 | |||
| 45c1bad6d8 | |||
| 6916d7b552 | |||
| 39e93fcbbf | |||
| 7461cb5f72 | |||
| 8e069daa61 | |||
| 8041c033a9 | |||
| ca8c659804 | |||
| a96cf33df3 | |||
| d75577fa34 |
@@ -1,3 +1,789 @@
|
||||
2009-01-13 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/release_notes_2.0.3.txt: Minor changes
|
||||
|
||||
2009-01-13 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/tls/Makefile.win32: Windows compilation support.
|
||||
* src/tls/tls_drv.c: Likewise.
|
||||
* src/tls/stdint.h: Likewise.
|
||||
|
||||
* doc/guide.tex: Update Erlang version in Windows compilation
|
||||
documentation.
|
||||
|
||||
2009-01-13 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/pl.po: Fix typo (thanks to Apag0r)(EJAB-844)
|
||||
|
||||
2009-01-12 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Update copyright date 2008 to 2009 (EJAB-842)
|
||||
* doc/guide.html: Likewise
|
||||
* src/*/*.erl: Likewise
|
||||
* src/*/*.erl: Remove unneeded blankspaces in license text
|
||||
|
||||
2009-01-11 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: fix owners cache and fix unsubscribe
|
||||
permissions (thanks to Andy Skelton)(EJAB-840)
|
||||
* src/mod_pubsub/node_default.erl: Likewise
|
||||
|
||||
* src/mod_pubsub/node_default.erl: prevent unauthorized entity to gain
|
||||
none-affiliation for given entity (EJAB-840)
|
||||
|
||||
2009-01-10 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/node_default.erl: fix unsubscription of full jid
|
||||
subscribed node (thanks to Andy Skelton)(EJAB-839)
|
||||
|
||||
2009-01-09 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/release_notes_2.0.3.txt: New file for new release
|
||||
|
||||
* doc/guide.tex: Improve explanation of backup commands (EJAB-832)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
* src/web/ejabberd_web_admin.erl: New appearance of WebAdmin logo,
|
||||
fixed logo-fill.
|
||||
|
||||
* src/mod_configure.erl: Fix access check for vhost configuration
|
||||
|
||||
2009-01-08 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: completely support subscription using
|
||||
full JID (EJAB-701)
|
||||
* src/mod_pubsub/node_default.erl: Likewise
|
||||
|
||||
* src/mod_pubsub/node_default.erl: any entity can retrieve item when
|
||||
node access model is "open" (thanks to Myers Carpenter)(EJAB-836)
|
||||
|
||||
2009-01-08 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/ejabberd_listener.erl: Define send timeout option to avoid
|
||||
blocking on socket send (EJAB-746).
|
||||
* src/ejabberd_s2s_out.erl: Likewise.
|
||||
|
||||
2009-01-06 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/ru.msg: Fix typo (thanks to Dominges)
|
||||
|
||||
2009-01-05 Alexey Shchepin <alexey@process-one.net>
|
||||
|
||||
* src/tls/tls_drv.c: Added a flag to avoid certificate validation
|
||||
* src/tls/tls.erl: Likewise
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
|
||||
2009-01-03 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/*.erl: Fix EDoc comments
|
||||
|
||||
2009-01-03 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: deliver notification depending on
|
||||
presence-based-delivery configuration (EJAB-827). notification code
|
||||
rewrite.
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: code cleanning, minor bugfixes
|
||||
* src/mod_pubsub/node_default.erl: Likewise
|
||||
* src/mod_pubsub/node_pep.erl: Likewise
|
||||
* src/mod_pubsub/pubsub.hrl: Likewise
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: prevent subscribing with full jid,
|
||||
waiting for full jid support (EJAB-701)
|
||||
|
||||
2008-12-29 Alexey Shchepin <alexey@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Bugfix in "from" attribute checking
|
||||
|
||||
2008-12-28 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Add resource to the from packet attribute
|
||||
if missing (EJAB-812).
|
||||
|
||||
2008-12-24 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/aclocal.m4: Fixes in configure script: fix
|
||||
disable-ejabberd_zlib and disable-pam; in case of problems, PAM
|
||||
verification aborts with error instead of warning. (EJAB-787)
|
||||
* src/configure.ac: Likewise
|
||||
* src/configure: Likewise
|
||||
|
||||
2008-12-23 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/acl.erl: New ACL: shared_group (thanks to Maxim Ryazanov)
|
||||
* doc/guide.tex: Likewise
|
||||
|
||||
* src/mod_shared_roster.erl: Push new group members when
|
||||
registered or manually added to group: EJAB-730 EJAB-731 EJAB-732
|
||||
EJAB-767 EJAB-794. When user is added to group, push it to other
|
||||
members, and other members to it. When user is removed from group,
|
||||
push deletion to other members, and other members to it. When user
|
||||
is registered, push him to members of group @all@. When user is
|
||||
deleted, push deletion to members of group @all@. Document several
|
||||
functions in mod_shared_roster.
|
||||
|
||||
* src/ejabberd_auth.erl: Rename hook user_registered to
|
||||
register_user, for name consistency with the widely used hook
|
||||
remove_user. Run hook register_user in ejabberd_auth, so it's run
|
||||
when account is created with any method. Run hook remove_user in
|
||||
ejabberd_auth, so it's run when account is deleted with any
|
||||
method.
|
||||
* src/ejabberd_auth_internal.erl: Likewise
|
||||
* src/ejabberd_auth_ldap.erl: Likewise
|
||||
* src/ejabberd_auth_odbc.erl: Likewise
|
||||
* src/ejabberd_auth_pam.erl: Likewise
|
||||
* src/mod_register.erl: Likewise
|
||||
|
||||
2008-12-23 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Improve handling of PEP sent to
|
||||
external contacts (EJAB-825)
|
||||
* src/mod_caps.erl: Likewise
|
||||
|
||||
2008-12-23 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/cyrsasl_digest.erl: Check digest-uri in SASL digest
|
||||
authentication (thanks to Paul Guyot)(EJAB-569)
|
||||
|
||||
* src/odbc/odbc_queries.erl: Fix removal of private_storage of an
|
||||
account when the account is removed
|
||||
|
||||
* src/mod_privacy.erl: Remove privacy lists of an account when the
|
||||
account is removed (EJAB-720)
|
||||
* src/mod_privacy_odbc.erl: Likewise
|
||||
|
||||
2008-12-19 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Fix send_last_published_item issue
|
||||
when running on clustered table (thanks to Vincent Barat)(EJAB-793)
|
||||
|
||||
2008-12-16 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Fix update pubsub tables from
|
||||
ejabberd 1.x to 2.x (EJAB-817)
|
||||
|
||||
* doc/guide.tex: Fix capitalization of some section titles
|
||||
|
||||
* doc/guide.tex: Mention as optional Requirements: mysql, pgsql
|
||||
and pam
|
||||
|
||||
* src/ejabberd_ctl.erl: Command reopen-log must also rotate
|
||||
sasl.log (thanks to Alexander Tsvyashchenko)(EJAB-711)
|
||||
* src/ejabberd_logger_h.erl: Export the function rotate_log/1
|
||||
* doc/guide.tex: Improve explanation of log files rotation
|
||||
|
||||
* doc/guide.tex: Improve explanation of watchdog admins
|
||||
option: only useful for developers (EJAB-816)
|
||||
* src/ejabberd.cfg.example: Likewise
|
||||
|
||||
* doc/guide.tex: Say 'higher' instead of 'newer' in requirements
|
||||
* README: Likewise
|
||||
|
||||
* doc/guide.tex: Simplify example mod_muc configuration
|
||||
|
||||
2008-12-08 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Reduce memory consumption due to caps handling
|
||||
* src/mod_pubsub/mod_pubsub.erl: Likewise
|
||||
* src/mod_caps.erl: Likewise
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: ignore unknown configuration fields
|
||||
(EJAB-762) (thanks to Jack Moffitt)
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: fix node authorization bug (EJAB-798)
|
||||
(thanks to Brian Cully)
|
||||
|
||||
* src/mod_pubsub/pubsub.hrl: remove unused pubsub_presence record
|
||||
|
||||
* src/mod_pubsub/node_default.erl: remove pubsub_state record when
|
||||
unsubscribing node without affiliation (EJAB-776)
|
||||
|
||||
2008-12-08 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Enforce client stanza from attribute
|
||||
(EJAB-812).
|
||||
* src/jlib.erl: Likewise.
|
||||
|
||||
2008-12-01 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: New subsection Database Connection
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-12-01 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/ejabberd_frontend_socket.erl: Hibernate ejabberd_receiver and
|
||||
ejabberd_frontend_socket processes after timeout. Backported from
|
||||
Aleksey's patch (r1680)
|
||||
* src/ejabberd_frontend_socket.erl: Likewise
|
||||
|
||||
* src/tls/tls_drv.c: Don't create a SSL context on every connection
|
||||
and disable SSLv2 on outgoing connections (EJAB-781). Backported from
|
||||
Aleksey's patch (r1675)
|
||||
|
||||
2008-11-26 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_irc/mod_irc.erl: Announce disco#info (thanks to Spike)
|
||||
* src/mod_muc/mod_muc.erl: Announce disco#info disco#items
|
||||
* src/mod_proxy65/mod_proxy65_service.erl: No announce disco#items
|
||||
* src/mod_pubsub/mod_pubsub.erl: Announce disco#info disco#items
|
||||
* src/mod_vcard.erl: Announce disco#info
|
||||
|
||||
* src/gen_mod.erl: First store module options in ETS and Mnesia,
|
||||
then start the module. In case of failure, remove options from
|
||||
ETS. Until now the module was started before the options were
|
||||
stored in database, and some modules started incorrectly because
|
||||
they couldn't access the options from database; for instance
|
||||
mod_muc_room required this for reading max_users option.
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: Include the value of max_users
|
||||
service option and the current max_users room option in the list
|
||||
of allowed room limit values.
|
||||
|
||||
2008-10-17 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/node_pep.erl: Fix get_node_affiliations resultset to
|
||||
owner (Thanks to Michal Schmidt)
|
||||
|
||||
2008-11-12 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Improve legibility of mod_irc example config
|
||||
|
||||
2008-11-08 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/ejabberd_s2s_out.erl: exports the DNS resolution
|
||||
function.
|
||||
|
||||
2008-10-27 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_app.erl: Open ejabberd.log before parsing
|
||||
ejabberd.cfg and translation files (EJAB-777)
|
||||
|
||||
2008-10-17 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: fix badarg issue on get_roster_info
|
||||
when allowed roster groups is not defined
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: fix remove_user not unsubscribing
|
||||
user (EJAB-684)
|
||||
|
||||
* src/mod_pubsub/node_default.erl: does not write item when max_items
|
||||
set to 0 (solves EJAB-768)
|
||||
|
||||
2008-10-13 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/odbc/ejabberd_odbc.erl: log MySQL driver messages.
|
||||
|
||||
2008-10-07 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/mod_roster_odbc.erl: fix MySQL multiple requests issue.
|
||||
|
||||
2008-10-06 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.html: Regenerated
|
||||
|
||||
* doc/guide.tex: Fix a problem in SVN merge from trunk
|
||||
|
||||
2008-10-06 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/ejabberd_rdbms.erl: fix SQL database reconnection
|
||||
issues (EJAB-764) and add odbc_start_interval configuration
|
||||
directive (default to 30 seconds).
|
||||
* src/odbc/ejabberd_odbc.erl: likewise.
|
||||
* src/odbc/ejabberd_odbc_sup.erl: likewise.
|
||||
* doc/guide.tex: likewise.
|
||||
|
||||
2008-10-03 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/odbc/odbc_queries.erl: Fix syntax error on update_roster_sql query.
|
||||
|
||||
2008-10-03 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/odbc/odbc_queries.erl: Fix empty query that fails on MySQL (merged from trunk).
|
||||
|
||||
2008-10-01 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/mod_shared_roster.erl: Correct roster push when changing
|
||||
a shared roster entry name (EJAB-738).
|
||||
|
||||
2008-09-30 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/*/Makefile.win32: Provide explicit beam filenames because
|
||||
nmake does not accept wildcards (thanks to Attila
|
||||
Vangel)(EJAB-543)
|
||||
|
||||
2008-09-29 Badlop <badlop@process-one.net>
|
||||
|
||||
* contrib/ejabberd-modules.repo: Include 2.0.x branches
|
||||
|
||||
2008-09-22 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/mod_configure.erl: Fix adhoc commands reply types for
|
||||
"get-online-users-num" and "get-registered-users-num" (EJAB-756).
|
||||
|
||||
2008-09-15 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Fix explanation of mod_muc's anonymous
|
||||
option. Make clear that an ejabberd_service can only serve a
|
||||
single external component. Provide Mnesia directory when setting
|
||||
clustering (thanks to Matthew Reilly)
|
||||
|
||||
2008-09-02 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Fix mod_proxy configuration example
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-08-27 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: send last published events now supports
|
||||
PEP events from unavailable users nodes (EJAB-698)
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
|
||||
2008-08-26 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/release_notes_2.0.2.txt: Update for final release
|
||||
|
||||
* doc/guide.tex: Windows binary installer requires MSVC++ 5
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-08-26 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: get_items bugfix (EJAB-716)
|
||||
|
||||
2008-08-25 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_privacy_odbc.erl: Prevent case_clause error when
|
||||
ejabber_odbc:sql_query returns {error, Reason}
|
||||
* src/mod_vcard_odbc.erl: Likewise
|
||||
* src/mod_last_odbc.erl: Likewise
|
||||
* src/mod_offline_odbc.erl: Likewise
|
||||
|
||||
2008-08-25 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_check.erl: Detect correctly MSSQL and ODBC
|
||||
configuration (EJAB-710)
|
||||
|
||||
2008-08-24 Geoff Cant <gcant@process-one.net>
|
||||
|
||||
* src/mod_mud/mod_muc_room.erl: is_visitor/2 fix - use get_role
|
||||
not get_affiliation
|
||||
|
||||
2008-08-22 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_router.erl: Fix call to mnesia match_object
|
||||
|
||||
2008-08-21 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Fix names of chatroom to room, user to occupant
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-08-18 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_register.erl: Change password using mod_register always
|
||||
returns success regardless of real result (EJAB-723)
|
||||
* src/ejabberd_auth.erl: Likewise
|
||||
* src/ejabberd_auth_external.erl: Likewise
|
||||
* src/ejabberd_auth_internal.erl: Likewise
|
||||
* src/ejabberd_auth_odbc.erl: Likewise
|
||||
|
||||
2008-08-16 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/sv.msg: Fixed formatting typos
|
||||
|
||||
* src/gen_mod.erl: Export stop_module_keep_config/2 (EJAB-706)
|
||||
|
||||
2008-08-13 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Explain that LDAP is read-only storage (thanks to
|
||||
Evgeniy Khramtsov)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-08-10 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/eo.msg: Updated (thanks to Andreas van Cranenburgh)
|
||||
* src/msgs/nl.msg: Updated (thanks to Andreas van Cranenburgh)
|
||||
* src/msgs/sk.msg: Updated (thanks to Marek Becka)
|
||||
* src/msgs/sv.msg: Updated (thanks to Thore Alstromer and Heysan)
|
||||
|
||||
2008-08-09 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_service.erl: Fix XEP-0114 compliance: define xmlns
|
||||
in header of error response; include in response the JID of served
|
||||
component not server (thanks to Sergei Golovan)(EJAB-717)
|
||||
|
||||
2008-08-01 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/release_notes_2.0.2.txt: Added for ejabberd 2.0.2-beta1
|
||||
|
||||
* src/web/ejabberd_http.erl: Temporary solution for check of
|
||||
packet size when HTTPS (EJAB-611)(EJAB-507)(EJAB-574)
|
||||
|
||||
2008-07-31 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Update Process-one name to ProcessOne (EJAB-708)
|
||||
* doc/guide.html: Likewise
|
||||
* doc/api/overview.edoc: Likewise
|
||||
* src/*/*.erl: Likewise
|
||||
* src/*/*.hrl: Likewise
|
||||
* src/*/*.c: Likewise
|
||||
* src/odbc/*.sql: Likewise
|
||||
|
||||
2008-07-30 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: Support Reasons for all
|
||||
affiliation and role changes (EJAB-306)
|
||||
|
||||
* src/gen_mod.erl: When ejabberd is kindly stopped, don't forget
|
||||
modules configuration (EJAB-706)
|
||||
* src/ejabberd_app.erl: Likewise
|
||||
|
||||
* src/msgs/uk.msg: Fix: each string in a single line
|
||||
* src/msgs/wa.msg: Likewise
|
||||
|
||||
* src/msgs/es.msg: Fix typo
|
||||
* src/msgs/gl.msg: Likewise
|
||||
* src/msgs/pt-br.msg: Likewise
|
||||
|
||||
* src/msgs/zh.msg: Fix some translations (thanks to Zhan Caibao)
|
||||
|
||||
2008-07-29 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/ca.msg: Updated (thanks to Badlop)
|
||||
* src/msgs/cs.msg: Updated (thanks to Lukas Poliuvk)
|
||||
* src/msgs/de.msg: Updated (thanks to Nikolaus Polak)
|
||||
* src/msgs/es.msg: Updated (thanks to Badlop)
|
||||
* src/msgs/fr.msg: Updated (thanks to Christophe Romain)
|
||||
* src/msgs/it.msg: Updated (thanks to Luca Brivio)
|
||||
* src/msgs/ja.msg: Updated (thanks to Tsukasa Hamano)
|
||||
* src/msgs/no.msg: Updated (thanks to Stian B. Barmen)
|
||||
* src/msgs/pl.msg: Updated (thanks to Zbyszek Zolkiewski)
|
||||
* src/msgs/pt-br.msg: Updated (thanks to Otavio Fernandes)
|
||||
* src/msgs/ru.msg: Updated (thanks to Evgeniy Khramtsov)
|
||||
* src/msgs/tr.msg: Updated (thanks to Doruk Fisek)
|
||||
* src/msgs/uk.msg: Updated (thanks to Ruslan Rakhmanin)
|
||||
* src/msgs/wa.msg: Updated (thanks to Pablo Saratxaga)
|
||||
* src/msgs/zh.msg: Updated (thanks to Shelley Shyan)
|
||||
|
||||
2008-07-28 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Document how to get error message when ejabberd
|
||||
crash dumps at start (EJAB-660)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: Add 'description' to the
|
||||
mod_muc_room config record; it will be used in ejabberd 2.1.x
|
||||
branch (EJAB-670)
|
||||
|
||||
2008-07-25 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Speedup startup with many pubsub
|
||||
nodes (EJAB-669)
|
||||
* src/mod_pubsub/nodetree_default.erl: Likewise
|
||||
|
||||
2008-07-24 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Include example PAM configuration file
|
||||
ejabberd.pam (thanks to Evgeniy Khramtsov)(EJAB-704)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
* src/mod_proxy65/mod_proxy65_lib.erl: Send protocol compliant
|
||||
SOCKS5 reply; this breaks support of uncompliant Psi<0.10 (thanks
|
||||
to Felix Geyer)(EJAB-632)
|
||||
* src/mod_proxy65/mod_proxy65_stream.erl: Likewise
|
||||
|
||||
* src/mod_register.erl: When a registration is blocked due to IP
|
||||
limitation, return description in error stanza (EJAB-692)
|
||||
|
||||
2008-07-24 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Allow owner to subscribe/get its own
|
||||
node (EJAB-705)
|
||||
|
||||
2008-07-24 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/Makefile.in: Support for parallel compilation with 'make -j'
|
||||
in multi core CPUs: fix compilation dependencies; compile
|
||||
behaviors before other source code (EJAB-697)(thanks to Jonathan
|
||||
Schleifer)
|
||||
* src/mod_pubsub/Makefile.in: Likewise
|
||||
* src/eldap/Makefile.in: Likewise
|
||||
|
||||
* doc/guide.tex: Document room options allow_visitor_nickchange
|
||||
and allow_visitor_status (EJAB-624)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-07-23 Geoff Cant <geoff.cant@process-one.net>
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: new room options,
|
||||
allow_visitor_presence and allow_visitor_nickchange to
|
||||
block/enable visitors to broadcast presence updates to the room
|
||||
(EJAB-624).
|
||||
* src/mod_muc/mod_muc_room.erl: renaming allow_visitor_presence to
|
||||
allow_visitor_status and altering effect (when false) to remove
|
||||
custom status tags in presence broadcasts to muc rooms by
|
||||
visitors.
|
||||
|
||||
2008-07-23 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: remove_user hook removes
|
||||
subscriptions (EJAB-684), send the last published and not the
|
||||
first published item (EJAB-675), remove the pubsub/nodes tree,
|
||||
subscribing to a node sends only last items (EJAB-700)
|
||||
* src/mod_pubsub/node_pep.erl: added acl and jid match on node
|
||||
creation permission (EJAB-663)
|
||||
* src/mod_pubsub/node_default.erl: fix node creation permission
|
||||
issue for service
|
||||
|
||||
2008-07-22 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_config.erl: If syntax mistake in config file, show
|
||||
specific error message (EJAB-616)
|
||||
|
||||
2008-07-17 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: Fix to allow a server admin to add
|
||||
himself as owner of a room (EJAB-687)
|
||||
|
||||
* src/Makefile.in: ejabberctl doesn't use the erl found by the
|
||||
configure script (EJAB-676)
|
||||
* src/ejabberdctl.template: Likewise
|
||||
|
||||
2008-07-17 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/web/Makefile.in: use -DSSL39 if compiling with R12
|
||||
|
||||
2008-07-16 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Put auth_module in Info always (EJAB-549)
|
||||
|
||||
2008-07-16 Alexey Shchepin <alexey@process-one.net>
|
||||
|
||||
* src/web/ejabberd_http_poll.erl: Report connection's IP address
|
||||
|
||||
* src/ejabberd_c2s.erl: Rolled back the previous IP getting patch
|
||||
* src/ejabberd_sm.erl: Likewise
|
||||
* src/ejabberd_receiver.erl: Likewise
|
||||
* src/web/ejabberd_http_poll.erl: Likewise
|
||||
|
||||
2008-07-16 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Improve explanation of option 'hosts' in
|
||||
ejabberd_service
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-07-12 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/configure.ac: Improve legibility
|
||||
* src/aclocal.m4: Likewise
|
||||
* src/configure: Likewise
|
||||
|
||||
* src/ejabberdctl.template: Remove garbage variable. Document node
|
||||
option
|
||||
|
||||
* doc/guide.tex: Add references to sections.
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-07-11 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Document how to insert a newline character in
|
||||
welcome_message (EJAB-501)
|
||||
* src/ejabberd.cfg.example: Likewise
|
||||
|
||||
2008-07-11 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Backport C2S blacklist support from trunk
|
||||
was (EJAB-625).
|
||||
* src/mod_ip_blacklist.erl: Likewise
|
||||
* src/jlib.erl: Added IP format tuple to string function
|
||||
* src/ejabberd_socket.erl: Properly handled c2s start failure (happen
|
||||
for blacklisted IP).
|
||||
|
||||
2008-07-10 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/configure.ac: Don't check for erlang header file (EJAB-232)
|
||||
* src/configure: Likewise
|
||||
|
||||
2008-07-09 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/configure.ac: Check for erlang header files (EJAB-232)
|
||||
* src/configure: Likewise
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Fix compilator warnings
|
||||
|
||||
* src/mod_muc/mod_muc_log.erl: Fix XHTML compliance: ensure some
|
||||
language is set, include ID attribute in each message, add
|
||||
microseconds to ensure unique value (EJAB-497)
|
||||
|
||||
* src/ejabberd_config.erl (load_file): error message on sasl.log
|
||||
is not flattened (EJAB-616)
|
||||
|
||||
* doc/guide.tex: mod_muc_log XMPP URI supports the updated version
|
||||
RFC 5122 (EJAB-631)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-07-08 Badlop <badlop@process-one.net>
|
||||
|
||||
* tools/ejabberdctl: Work also when 'which' is unavailable
|
||||
|
||||
2008-07-08 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/web/ejabberd_http_poll.erl: improve ip fetching patch
|
||||
|
||||
2008-07-07 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/Makefile.in: Spool, config and log dirs: writtable by owner,
|
||||
readable by group, nothing by others (EJAB-686)
|
||||
* doc/guide.tex: New section Securing sensible files
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
* doc/guide.tex: Solaris Makefile install: use ginstall (thanks to
|
||||
Jonathan Auer)(EJAB-649)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-07-03 Jerome Sautret <jerome.sautret@process-one.net>
|
||||
|
||||
* src/mod_privacy_odbc.erl: Support for privacy lists in MySQL
|
||||
(thanks to Igor Goryachev)(EJAB-538)
|
||||
|
||||
2008-07-03 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Fix permission control on item
|
||||
retrieve (EJAB-453)
|
||||
* src/mod_pubsub/node_dispatch.erl: Likewise
|
||||
* src/mod_pubsub/node_buddy.erl: Likewise
|
||||
* src/mod_pubsub/node_private.erl: Likewise
|
||||
* src/mod_pubsub/node_public.erl: Likewise
|
||||
* src/mod_pubsub/node_default.erl: Likewise
|
||||
* src/mod_pubsub/node_pep.erl: Likewise
|
||||
* src/mod_pubsub/node_club.erl: Likewise
|
||||
* src/mod_pubsub/gen_pubsub_node.erl: Likewise
|
||||
* src/mod_pubsub/node.template: Likewise
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: Allow subscriber to request specific
|
||||
items by ItemID; Allow to retrieve pubsub#title configuration (thanks
|
||||
to Kevin Crosbie); Fix forbidden result on setting
|
||||
affiliation/subscription
|
||||
|
||||
* src/ejabberd_local.erl: prevent iq_response table overload
|
||||
(EJAB-608)
|
||||
* src/mod_caps.erl: Likewise
|
||||
|
||||
* src/web/ejabberd_http.erl: Retrieve correct IP from http connection
|
||||
* src/web/ejabberd_http_poll.erl: Likewise
|
||||
* src/ejabberd_receiver.erl: Likewise
|
||||
* src/ejabberd_sm.erl: Likewise
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
|
||||
* src/web/ejabberd_http_poll.erl: Fixed HTTP headers when a
|
||||
requested session doesn't exist (backport from trunk r1223)
|
||||
|
||||
2008-06-29 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_ctl.erl: Web Admin and Ad-hoc admin: dump only
|
||||
persistent tables (EJAB-678)
|
||||
|
||||
* src/mod_pubsub/node_pep.erl: Complain if mod_caps disabled and
|
||||
mod_pubsub has PEP plugin enabled (EJAB-677)
|
||||
|
||||
2008-06-21 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Explain that S2S outgoing first tries IPv4 and if
|
||||
that fails then tries IPv6
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-06-18 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd.app: The ejabberd version number is defined in the
|
||||
OTP application resource file, in the key 'vsn' (EJAB-657)
|
||||
* src/ejabberd.hrl: The macro VERSION now consults the ejabberd
|
||||
application key vsn
|
||||
* src/configure.erl: Load the ejabberd application description
|
||||
* doc/Makefile: Read ejabberd version from ejabberd.app vsn
|
||||
* doc/api/Makefile: Likewise
|
||||
|
||||
2008-06-18 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: get_default bugfix (EJAB-656)
|
||||
|
||||
2008-06-13 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd.cfg.example: Add registration_timeout (EJAB-653)
|
||||
|
||||
* doc/guide.tex: Table of listener modules converted to
|
||||
description. Table of modules overview simplified, and module
|
||||
names link to their sections. Document
|
||||
ldap_local_filter (EJAB-179). Title in HTML is shorter.
|
||||
Update several external URIs.
|
||||
|
||||
* doc/guide.html: Regenerated with all the latest changes
|
||||
|
||||
2008-06-12 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Permanent reference URL for sections (EJAB-651).
|
||||
Changes in CSS: verbatim text is indented and has grey background;
|
||||
descriptions are indented; table borders are softer. Fix
|
||||
indentation of verbatim text.
|
||||
|
||||
2008-06-08 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Small fixes (thanks to Christoph Anton Mitterer)
|
||||
* doc/introduction.tex: Likewise
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-06-05 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.tex: Document ejabberdctl status code (EJAB-633)
|
||||
* doc/guide.html: Likewise
|
||||
|
||||
2008-06-04 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/pl.msg: Bugfix in arguments of translated string that
|
||||
could crash the room (thanks to Anastasia Gornostaeva)
|
||||
|
||||
2008-05-31 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/web/ejabberd_web.erl (make_xhtml/2): Allow to include
|
||||
elements in the HTTP header
|
||||
|
||||
* src/odbc/odbc_queries.erl (del_user_return_password): Return
|
||||
password (thanks to Oleg Palij)
|
||||
|
||||
2008-05-22 Badlop <badlop@process-one.net>
|
||||
|
||||
* README: R12 support: remove compilation warning (EJAB-630)
|
||||
|
||||
2008-05-19 Badlop <badlop@process-one.net>
|
||||
|
||||
* doc/guide.html: Updated
|
||||
* doc/dev.html: Likewise
|
||||
* doc/features.html: Likewise
|
||||
* doc/version.tex: Likewise
|
||||
|
||||
* src/ejabberd.hrl: Version is 2.0.x
|
||||
|
||||
* src/configure.ac: R12 support: remove compilation
|
||||
warning (EJAB-630)
|
||||
* src/configure: Likewise
|
||||
* doc/guide.tex: Likewise
|
||||
|
||||
* doc/guide.tex: Describe how to disable registration
|
||||
limitation (EJAB-614)
|
||||
|
||||
2008-05-16 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/ejabberd_receiver.erl: Don't activate a socket untill its
|
||||
receiver process is controlling it (Thanks to Aleksey)
|
||||
|
||||
* src/ejabberd_s2s_out.erl: Change FSMTIMEOUT to 30s
|
||||
|
||||
2008-05-12 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/mod_muc/mod_muc_room.erl: Return Forbidden error message
|
||||
when user sends private message in a room that disallows
|
||||
it (EJAB-595)
|
||||
|
||||
* src/web/ejabberd_http.erl (parse_auth): Allow password that
|
||||
include colon character (EJAB-622)
|
||||
|
||||
2008-04-30 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_caps.erl: XEP-0115 patch (EJAB-618)
|
||||
@@ -132,7 +918,7 @@
|
||||
* doc/webadmmainru.png: Likewise
|
||||
|
||||
* doc/disco.png: Removed because not used
|
||||
|
||||
|
||||
* doc/guide.tex: Fix Latex reference to webadmin section. Update
|
||||
explanation of screenshots. Update xmpp addresses of Mickael
|
||||
Remond and Sander Devrieze.
|
||||
@@ -227,7 +1013,7 @@
|
||||
|
||||
* src/eldap.erl: Faster LDAP reconnection (Thanks to Christophe
|
||||
Romain) (EJAB-581)
|
||||
|
||||
|
||||
2008-03-17 Mickael Remond <mremond@process-one.net>
|
||||
|
||||
* src/ejabberd_s2s.erl: Only trigger s2s_connect_hook on
|
||||
@@ -313,7 +1099,7 @@
|
||||
configuration sanity checks (EJAB-533)
|
||||
* src/src/ejabberd_app.erl: Likewise
|
||||
* src/ejabberd_app.erl: Likewise
|
||||
|
||||
|
||||
2008-02-26 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/msgs/it.msg: Updated (thanks to Smart2128)
|
||||
@@ -354,7 +1140,7 @@
|
||||
* src/msgs/no.msg: Updated (thanks to Stian B. Barmen)
|
||||
* src/msgs/pt-br.msg: Updated (thanks to Otavio Fernandes)
|
||||
* src/msgs/uk.msg: Updated (thanks to Stoune and Ruslan Rakhmanin)
|
||||
|
||||
|
||||
2008-02-19 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/odbc/ejabberd_odbc.erl: add pgsql driver monitoring
|
||||
@@ -501,7 +1287,7 @@
|
||||
* src/ejabberd.hrl: Likewise
|
||||
|
||||
* doc/introduction.tex: Updated to 22 languages
|
||||
|
||||
|
||||
* doc/Makefile: Ensure that Bash is used
|
||||
|
||||
* doc/guide.tex: Updated copyright dates to 2008.
|
||||
|
||||
@@ -9,9 +9,7 @@ To compile ejabberd you need:
|
||||
- GNU Make
|
||||
- GCC
|
||||
- libexpat 1.95 or higher
|
||||
- Erlang/OTP R10B-9 up to R11B-5. Erlang R12 releases are not yet
|
||||
officially supported, and are not recommended for production
|
||||
servers
|
||||
- Erlang/OTP R10B-9 or higher
|
||||
- OpenSSL 0.9.6 or higher, for STARTTLS, SASL and SSL
|
||||
encryption. Optional, highly recommended.
|
||||
- Zlib 1.2.3 or higher, for Stream Compression support
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
% List of ejabberd-modules to add for ejabberd packaging (source archive and installer)
|
||||
%
|
||||
% HTTP-binding:
|
||||
https://svn.process-one.net/ejabberd-modules/http_bind/tags/ejabberd-2.0.0
|
||||
https://svn.process-one.net/ejabberd-modules/mod_http_fileserver/tags/ejabberd-2.0.0
|
||||
https://svn.process-one.net/ejabberd-modules/http_bind/tags/ejabberd-2.0.3
|
||||
https://svn.process-one.net/ejabberd-modules/mod_http_fileserver/tags/ejabberd-2.0.3
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ release:
|
||||
@echo "Press any key to continue"
|
||||
@read foo
|
||||
@echo "% ejabberd version (automatically generated)." > version.tex
|
||||
@echo "\newcommand{\version}{"`sed '/VERSION/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.hrl`"}" >> version.tex
|
||||
@echo "\newcommand{\version}{"`sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.app`"}" >> version.tex
|
||||
@echo -n "% Contributed modules (automatically generated)." > contributed_modules.tex
|
||||
@echo -e "$(CONTRIBUTED_MODULES)" >> contributed_modules.tex
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
APPNAME = ejabberd
|
||||
VSN = SVN
|
||||
VSN = $(shell sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.app)
|
||||
|
||||
DOCDIR=.
|
||||
SRCDIR=../../src
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@author Mickael Remond <mickael.remond@process-one.net>
|
||||
[http://www.process-one.net/]
|
||||
@copyright 2007 Process-one
|
||||
@copyright 2007 ProcessOne
|
||||
@version {@vsn}, {@date} {@time}
|
||||
@title ejabberd Development API Documentation
|
||||
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Ejabberd 2.0.0 Developers Guide
|
||||
<TITLE>Ejabberd 2.0.3 Developers Guide
|
||||
</TITLE>
|
||||
|
||||
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
@@ -49,7 +49,7 @@ TD P{margin:0px;}
|
||||
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic dev.tex -->
|
||||
<!--CUT DEF section 1 --><P><A NAME="titlepage"></A>
|
||||
|
||||
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.0 Developers Guide</H1><H3 CLASS="titlerest">Alexey Shchepin<BR>
|
||||
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.3 Developers Guide</H1><H3 CLASS="titlerest">Alexey Shchepin<BR>
|
||||
<A HREF="mailto:alexey@sevcom.net"><TT>mailto:alexey@sevcom.net</TT></A><BR>
|
||||
<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT></A></H3></TD></TR>
|
||||
</TABLE><DIV CLASS="center">
|
||||
@@ -139,7 +139,7 @@ Support for virtual hosting.
|
||||
</LI><LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
|
||||
</LI><LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with support for clustering and HTML logging. </LI><LI CLASS="li-itemize">Users Directory based on users vCards.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-00163.html">Personal Eventing via Pubsub</A>.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</A>.
|
||||
</LI><LI CLASS="li-itemize">Support for web clients: <A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> and <A HREF="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</A> services.
|
||||
</LI><LI CLASS="li-itemize">IRC transport.
|
||||
</LI><LI CLASS="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Ejabberd 2.0.0 Feature Sheet
|
||||
<TITLE>Ejabberd 2.0.3 Feature Sheet
|
||||
</TITLE>
|
||||
|
||||
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
@@ -50,7 +50,7 @@ SPAN{width:20%; float:right; text-align:left; margin-left:auto;}
|
||||
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic features.tex -->
|
||||
<!--CUT DEF section 1 --><P><A NAME="titlepage"></A>
|
||||
|
||||
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.0 Feature Sheet</H1><H3 CLASS="titlerest">Sander Devrieze<BR>
|
||||
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.3 Feature Sheet</H1><H3 CLASS="titlerest">Sander Devrieze<BR>
|
||||
<A HREF="mailto:s.devrieze@pandora.be"><TT>mailto:s.devrieze@pandora.be</TT></A><BR>
|
||||
<A HREF="xmpp:sander@devrieze.dyndns.org"><TT>xmpp:sander@devrieze.dyndns.org</TT></A></H3></TD></TR>
|
||||
</TABLE><DIV CLASS="center">
|
||||
@@ -118,7 +118,7 @@ Support for virtual hosting.
|
||||
</LI><LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
|
||||
</LI><LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with support for clustering and HTML logging. </LI><LI CLASS="li-itemize">Users Directory based on users vCards.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-00163.html">Personal Eventing via Pubsub</A>.
|
||||
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</A>.
|
||||
</LI><LI CLASS="li-itemize">Support for web clients: <A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> and <A HREF="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</A> services.
|
||||
</LI><LI CLASS="li-itemize">IRC transport.
|
||||
</LI><LI CLASS="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
||||
|
||||
+1431
-1426
File diff suppressed because it is too large
Load Diff
+1375
-1217
File diff suppressed because it is too large
Load Diff
@@ -125,7 +125,7 @@ Moreover, \ejabberd{} comes with a wide range of other state-of-the-art features
|
||||
\item IPv6 support both for c2s and s2s connections.
|
||||
\item \txepref{0045}{Multi-User Chat} module with support for clustering and HTML logging. %%\improved{}
|
||||
\item Users Directory based on users vCards.
|
||||
\item \txepref{0060}{Publish-Subscribe} component with support for \txepref{00163}{Personal Eventing via Pubsub}.
|
||||
\item \txepref{0060}{Publish-Subscribe} component with support for \txepref{0163}{Personal Eventing via Pubsub}.
|
||||
\item Support for web clients: \txepref{0025}{HTTP Polling} and \txepref{0206}{HTTP Binding (BOSH)} services.
|
||||
\item IRC transport.
|
||||
\item Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
Release Notes
|
||||
ejabberd 2.0.1
|
||||
20 May 2008
|
||||
|
||||
ejabberd 2.0.1 is a bugfix release for ejabberd 2.0.x branch.
|
||||
|
||||
ejabberd 2.0.1 includes 10 improvements and 32 bugfixes.
|
||||
A complete list of changes can be retrieved from:
|
||||
http://redir.process-one.net/ejabberd-2.0.1
|
||||
|
||||
The new code can be downloaded from ejabberd download page:
|
||||
http://www.process-one.net/en/projects/ejabberd/
|
||||
|
||||
|
||||
Recent changes include:
|
||||
|
||||
- Erlang R12 support.
|
||||
- Better LDAP handling.
|
||||
- PubSub bugfixes.
|
||||
- Documentation improvements.
|
||||
- inband registration limitation per IP.
|
||||
- s2s improvements.
|
||||
|
||||
Bugs report
|
||||
|
||||
You can officially report bugs on Process-one support site:
|
||||
http://support.process-one.net/
|
||||
|
||||
END
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
Release Notes
|
||||
ejabberd 2.0.2
|
||||
28 August 2008
|
||||
|
||||
ejabberd 2.0.2 is the second bug fix release for ejabberd 2.0.x branch.
|
||||
|
||||
ejabberd 2.0.2 includes many bugfixes and a few improvements.
|
||||
A complete list of changes can be retrieved from:
|
||||
http://redir.process-one.net/ejabberd-2.0.2
|
||||
|
||||
The new code can be downloaded from ejabberd download page:
|
||||
http://www.process-one.net/en/ejabberd/
|
||||
|
||||
|
||||
Recent changes include:
|
||||
|
||||
- Anti-abuse feature: client blacklist support by IP.
|
||||
- Guide: new section Securing ejabberd; improved usability.
|
||||
- LDAP filter optimisation: ability to filter user in ejabberd and not LDAP.
|
||||
- MUC improvements: room options to restrict visitors; broadcast reasons.
|
||||
- Privacy rules: fix MySQL storage.
|
||||
- Pub/Sub and PEP: many improvements in implementation and protocol compliance.
|
||||
- Proxy65: send valid SOCKS5 reply (removed support for Psi < 0.10).
|
||||
- Web server embedded: better support for HTTPS.
|
||||
- Binary installers: SMP on Windows; don't remove config when uninstalling.
|
||||
|
||||
|
||||
Bug reports
|
||||
|
||||
You can officially report bugs on ProcessOne support site:
|
||||
http://support.process-one.net/
|
||||
|
||||
END
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
Release Notes
|
||||
ejabberd 2.0.3
|
||||
14 January 2009
|
||||
|
||||
ejabberd 2.0.3 is the third bugfix release for ejabberd 2.0.x branch.
|
||||
|
||||
ejabberd 2.0.3 includes several bugfixes and a few improvements.
|
||||
A complete list of changes can be retrieved from:
|
||||
http://redir.process-one.net/ejabberd-2.0.3
|
||||
|
||||
The new code can be downloaded from ejabberd download page:
|
||||
http://www.process-one.net/en/ejabberd/
|
||||
|
||||
|
||||
Recent changes include:
|
||||
|
||||
- Do not ask certificate for client (c2s)
|
||||
- Check digest-uri in SASL digest authentication
|
||||
- Use send timeout to avoid locking on gen_tcp:send
|
||||
- Fix ejabberd reconnection to database
|
||||
- HTTP-Bind: handle wrong order of packets
|
||||
- MUC: Improve traffic regulation management
|
||||
- PubSub: Several bugfixes and improvements for best coverage of XEP-0060 v1.12
|
||||
- Shared Roster Groups: push immediately membership changes
|
||||
- Rotate also sasl.log on "reopen-log" command
|
||||
- Binary Windows installer: better detect "Error running Post Install Script"
|
||||
|
||||
|
||||
Bug reports
|
||||
|
||||
You can officially report bugs on ProcessOne support site:
|
||||
http://support.process-one.net/
|
||||
|
||||
END
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
% ejabberd version (automatically generated).
|
||||
\newcommand{\version}{2.0.0}
|
||||
\newcommand{\version}{2.0.3}
|
||||
|
||||
+13
-5
@@ -51,13 +51,16 @@ exec_prefix = @exec_prefix@
|
||||
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @mod_proxy65@ @eldap@ @pam@ @web@ stringprep @tls@ @odbc@ @ejabberd_zlib@
|
||||
ERLSHLIBS = expat_erl.so
|
||||
ERLBEHAVS = cyrsasl.erl gen_mod.erl p1_fsm.erl
|
||||
SOURCES = $(ERLBEHAVS) $(wildcard *.erl)
|
||||
SOURCES_ALL = $(wildcard *.erl)
|
||||
SOURCES = $(filter-out $(ERLBEHAVS),$(SOURCES_ALL))
|
||||
ERLBEHAVBEAMS = $(ERLBEHAVS:.erl=.beam)
|
||||
BEAMS = $(SOURCES:.erl=.beam)
|
||||
|
||||
DESTDIR =
|
||||
|
||||
EJABBERDDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
|
||||
BEAMDIR = $(EJABBERDDIR)/ebin
|
||||
SPOOLDIR = $(EJABBERDDIR)/db
|
||||
PRIVDIR = $(EJABBERDDIR)/priv
|
||||
SODIR = $(PRIVDIR)/lib
|
||||
PBINDIR = $(PRIVDIR)/bin
|
||||
@@ -75,7 +78,11 @@ endif
|
||||
|
||||
all: $(ERLSHLIBS) compile-beam all-recursive
|
||||
|
||||
compile-beam: XmppAddr.hrl $(BEAMS)
|
||||
compile-beam: XmppAddr.hrl $(ERLBEHAVBEAMS) $(BEAMS)
|
||||
|
||||
$(BEAMS): $(ERLBEHAVBEAMS)
|
||||
|
||||
all-recursive: $(ERLBEHAVBEAMS)
|
||||
|
||||
%.beam: %.erl
|
||||
@ERLC@ -W $(ERLC_FLAGS) $<
|
||||
@@ -107,20 +114,21 @@ install: all
|
||||
install -m 644 *.beam $(BEAMDIR)
|
||||
rm -f $(BEAMDIR)/configure.beam
|
||||
install -m 644 *.app $(BEAMDIR)
|
||||
install -d -m 750 $(SPOOLDIR)
|
||||
install -d $(SODIR)
|
||||
install -d $(PBINDIR)
|
||||
install -m 644 *.so $(SODIR)
|
||||
$(INSTALL_EPAM)
|
||||
install -d $(MSGSDIR)
|
||||
install -m 644 msgs/*.msg $(MSGSDIR)
|
||||
install -d $(ETCDIR)
|
||||
install -d -m 750 $(ETCDIR)
|
||||
[ -f $(ETCDIR)/ejabberd.cfg ] && install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new || install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
|
||||
sed -e "s*@rootdir@*@prefix@*" ejabberdctl.template > ejabberdctl.example
|
||||
sed -e "s*@rootdir@*@prefix@*" -e "s*@erl@*@ERL@*" ejabberdctl.template > ejabberdctl.example
|
||||
[ -f $(ETCDIR)/ejabberdctl.cfg ] && install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new || install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
||||
install -b -m 644 inetrc $(ETCDIR)/inetrc
|
||||
install -d $(SBINDIR)
|
||||
install -m 755 ejabberdctl.example $(SBINDIR)/ejabberdctl
|
||||
install -d $(LOGDIR)
|
||||
install -d -m 750 $(LOGDIR)
|
||||
|
||||
uninstall: uninstall-binary
|
||||
|
||||
|
||||
+6
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 18 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -178,6 +178,10 @@ match_acl(ACL, JID, Host) ->
|
||||
((Host == global) andalso
|
||||
lists:member(Server, ?MYHOSTS)))
|
||||
andalso is_regexp_match(User, UR);
|
||||
{shared_group, G} ->
|
||||
mod_shared_roster:is_user_in_group({User, Server}, G, Host);
|
||||
{shared_group, G, H} ->
|
||||
mod_shared_roster:is_user_in_group({User, Server}, G, H);
|
||||
{user_regexp, UR, S} ->
|
||||
(S == Server) andalso
|
||||
is_regexp_match(User, UR);
|
||||
|
||||
Vendored
+17
-15
@@ -1,6 +1,6 @@
|
||||
AC_DEFUN(AM_WITH_EXPAT,
|
||||
[ AC_ARG_WITH(expat,
|
||||
[ --with-expat=PREFIX prefix where EXPAT is installed])
|
||||
[AC_HELP_STRING([--with-expat=PREFIX], [prefix where EXPAT is installed])])
|
||||
|
||||
EXPAT_CFLAGS=
|
||||
EXPAT_LIBS=
|
||||
@@ -15,7 +15,7 @@ AC_DEFUN(AM_WITH_EXPAT,
|
||||
[ expat_found=no ],
|
||||
"$EXPAT_LIBS")
|
||||
if test $expat_found = no; then
|
||||
AC_MSG_ERROR([Could not find the Expat library])
|
||||
AC_MSG_ERROR([Could not find development files of Expat library])
|
||||
fi
|
||||
expat_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $EXPAT_CFLAGS"
|
||||
@@ -34,8 +34,9 @@ AC_DEFUN(AM_WITH_EXPAT,
|
||||
|
||||
AC_DEFUN(AM_WITH_ZLIB,
|
||||
[ AC_ARG_WITH(zlib,
|
||||
[ --with-zlib=PREFIX prefix where zlib is installed])
|
||||
[AC_HELP_STRING([--with-zlib=PREFIX], [prefix where zlib is installed])])
|
||||
|
||||
if test x"$ejabberd_zlib" != x; then
|
||||
ZLIB_CFLAGS=
|
||||
ZLIB_LIBS=
|
||||
if test x"$with_zlib" != x; then
|
||||
@@ -49,7 +50,7 @@ AC_DEFUN(AM_WITH_ZLIB,
|
||||
[ zlib_found=no ],
|
||||
"$ZLIB_LIBS")
|
||||
if test $zlib_found = no; then
|
||||
AC_MSG_ERROR([Could not find the zlib library])
|
||||
AC_MSG_ERROR([Could not find development files of zlib library. Install them or disable `ejabberd_zlib' with: --disable-ejabberd_zlib])
|
||||
fi
|
||||
zlib_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
|
||||
@@ -57,19 +58,20 @@ AC_DEFUN(AM_WITH_ZLIB,
|
||||
CPPFLAGS="$CPPFLAGS $ZLIB_CFLAGS"
|
||||
AC_CHECK_HEADERS(zlib.h, , zlib_found=no)
|
||||
if test $zlib_found = no; then
|
||||
AC_MSG_ERROR([Could not find zlib.h])
|
||||
AC_MSG_ERROR([Could not find zlib.h. Install it or disable `ejabberd_zlib' with: --disable-ejabberd_zlib])
|
||||
fi
|
||||
CFLAGS="$zlib_save_CFLAGS"
|
||||
CPPFLAGS="$zlib_save_CPPFLAGS"
|
||||
|
||||
AC_SUBST(ZLIB_CFLAGS)
|
||||
AC_SUBST(ZLIB_LIBS)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_WITH_PAM,
|
||||
[ AC_ARG_WITH(pam,
|
||||
[ --with-pam=PREFIX prefix where PAM is installed])
|
||||
|
||||
[AC_HELP_STRING([--with-pam=PREFIX], [prefix where PAM is installed])])
|
||||
if test x"$pam" != x; then
|
||||
PAM_CFLAGS=
|
||||
PAM_LIBS=
|
||||
if test x"$with_pam" != x; then
|
||||
@@ -83,7 +85,7 @@ AC_DEFUN(AM_WITH_PAM,
|
||||
[ pam_found=no ],
|
||||
"$PAM_LIBS")
|
||||
if test $pam_found = no; then
|
||||
AC_MSG_WARN([Could not find the PAM library])
|
||||
AC_MSG_ERROR([Could not find development files of PAM library. Install them or disable `pam' with: --disable-pam])
|
||||
fi
|
||||
pam_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PAM_CFLAGS"
|
||||
@@ -91,18 +93,19 @@ AC_DEFUN(AM_WITH_PAM,
|
||||
CPPFLAGS="$CPPFLAGS $PAM_CFLAGS"
|
||||
AC_CHECK_HEADERS(security/pam_appl.h, , pam_found=no)
|
||||
if test $pam_found = no; then
|
||||
AC_MSG_WARN([Could not find security/pam_appl.h])
|
||||
AC_MSG_ERROR([Could not find security/pam_appl.h. Install it or disable `pam' with: --disable-pam])
|
||||
fi
|
||||
CFLAGS="$pam_save_CFLAGS"
|
||||
CPPFLAGS="$pam_save_CPPFLAGS"
|
||||
|
||||
AC_SUBST(PAM_CFLAGS)
|
||||
AC_SUBST(PAM_LIBS)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_WITH_ERLANG,
|
||||
[ AC_ARG_WITH(erlang,
|
||||
[ --with-erlang=PREFIX path to erlc and erl ])
|
||||
[AC_HELP_STRING([--with-erlang=PREFIX], [path to erlc and erl])])
|
||||
|
||||
AC_PATH_TOOL(ERLC, erlc, , $with_erlang:$with_erlang/bin:$PATH)
|
||||
AC_PATH_TOOL(ERL, erl, , $with_erlang:$with_erlang/bin:$PATH)
|
||||
@@ -195,14 +198,13 @@ _EOF
|
||||
AC_SUBST(ERL)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(AC_MOD_ENABLE,
|
||||
[
|
||||
$1=
|
||||
make_$1=
|
||||
AC_MSG_CHECKING([whether build $1])
|
||||
AC_ARG_ENABLE($1,
|
||||
[ --enable-$1 enable $1 (default: $2)],
|
||||
[AC_HELP_STRING([--enable-$1], [enable $1 (default: $2)])],
|
||||
[mr_enable_$1="$enableval"],
|
||||
[mr_enable_$1=$2])
|
||||
if test "$mr_enable_$1" = "yes"; then
|
||||
@@ -223,7 +225,7 @@ AC_DEFUN([AM_ICONV],
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable GNU libiconv installed).
|
||||
AC_ARG_WITH([libiconv-prefix],
|
||||
[ --with-libiconv-prefix=PREFIX prefix where libiconv is installed], [
|
||||
[AC_HELP_STRING([--with-libiconv-prefix=PREFIX], [prefix where libiconv is installed])], [
|
||||
for dir in `echo "$withval" | tr : ' '`; do
|
||||
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
|
||||
if test -d $dir/include; then CFLAGS="$CFLAGS -I$dir/include"; fi
|
||||
@@ -308,7 +310,7 @@ size_t iconv();
|
||||
dnl <openssl>
|
||||
AC_DEFUN(AM_WITH_OPENSSL,
|
||||
[ AC_ARG_WITH(openssl,
|
||||
[ --with-openssl=PREFIX prefix where OPENSSL is installed ])
|
||||
[AC_HELP_STRING([--with-openssl=PREFIX], [prefix where OPENSSL is installed])])
|
||||
unset SSL_LIBS;
|
||||
unset SSL_CFLAGS;
|
||||
have_openssl=no
|
||||
@@ -338,7 +340,7 @@ if test x"$tls" != x; then
|
||||
fi
|
||||
done
|
||||
if test x${have_openssl} != xyes; then
|
||||
AC_MSG_ERROR([openssl library cannot be found. Install openssl or disable `tls' module (--disable-tls).])
|
||||
AC_MSG_ERROR([Could not find development files of OpenSSL library. Install them or disable `tls' with: --disable-tls])
|
||||
fi
|
||||
AC_SUBST(SSL_LIBS)
|
||||
AC_SUBST(SSL_CFLAGS)
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Oct 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
Vendored
+640
-631
File diff suppressed because it is too large
Load Diff
+18
-22
@@ -18,14 +18,13 @@ AM_WITH_ERLANG
|
||||
AM_ICONV
|
||||
#locating libexpat
|
||||
AM_WITH_EXPAT
|
||||
#locating zlib
|
||||
AM_WITH_ZLIB
|
||||
#locating PAM
|
||||
AM_WITH_PAM
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
# Check Erlang headers are installed
|
||||
#AC_CHECK_HEADER(erl_driver.h,,[AC_MSG_ERROR([cannot find Erlang header files])])
|
||||
|
||||
# Change default prefix
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
|
||||
@@ -33,19 +32,25 @@ AC_PREFIX_DEFAULT(/)
|
||||
AC_FUNC_MALLOC
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_MOD_ENABLE(mod_pubsub, yes)
|
||||
AC_MOD_ENABLE(mod_irc, yes)
|
||||
AC_MOD_ENABLE(mod_muc, yes)
|
||||
AC_MOD_ENABLE(mod_proxy65, yes)
|
||||
AC_MOD_ENABLE(mod_pubsub, yes)
|
||||
AC_MOD_ENABLE(eldap, yes)
|
||||
AC_MOD_ENABLE(pam, no)
|
||||
AC_MOD_ENABLE(web, yes)
|
||||
AC_MOD_ENABLE(tls, yes)
|
||||
AC_MOD_ENABLE(odbc, no)
|
||||
AC_MOD_ENABLE(tls, yes)
|
||||
AC_MOD_ENABLE(web, yes)
|
||||
|
||||
AC_MOD_ENABLE(ejabberd_zlib, yes)
|
||||
#locating zlib
|
||||
AM_WITH_ZLIB
|
||||
|
||||
AC_MOD_ENABLE(pam, no)
|
||||
#locating PAM
|
||||
AM_WITH_PAM
|
||||
|
||||
AC_ARG_ENABLE(hipe,
|
||||
[ --enable-hipe Compile natively with HiPE, not recommended (default: no)],
|
||||
[AC_HELP_STRING([--enable-hipe], [compile natively with HiPE, not recommended (default: no)])],
|
||||
[case "${enableval}" in
|
||||
yes) hipe=true ;;
|
||||
no) hipe=false ;;
|
||||
@@ -54,7 +59,7 @@ esac],[hipe=false])
|
||||
AC_SUBST(hipe)
|
||||
|
||||
AC_ARG_ENABLE(roster_gateway_workaround,
|
||||
[ --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions (default: no)],
|
||||
[AC_HELP_STRING([--enable-roster-gateway-workaround], [turn on workaround for processing gateway subscriptions (default: no)])],
|
||||
[case "${enableval}" in
|
||||
yes) roster_gateway_workaround=true ;;
|
||||
no) roster_gateway_workaround=false ;;
|
||||
@@ -63,7 +68,7 @@ esac],[roster_gateway_workaround=false])
|
||||
AC_SUBST(roster_gateway_workaround)
|
||||
|
||||
AC_ARG_ENABLE(mssql,
|
||||
[ --enable-mssql Use Microsoft SQL Server database (default: no, requires --enable-odbc)],
|
||||
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
|
||||
[case "${enableval}" in
|
||||
yes) db_type=mssql ;;
|
||||
no) db_type=generic ;;
|
||||
@@ -72,7 +77,7 @@ esac],[db_type=generic])
|
||||
AC_SUBST(db_type)
|
||||
|
||||
AC_ARG_ENABLE(transient_supervisors,
|
||||
[ --enable-transient_supervisors Use Erlang supervision for transient process (default: yes)],
|
||||
[AC_HELP_STRING([--enable-transient_supervisors], [use Erlang supervision for transient process (default: yes)])],
|
||||
[case "${enableval}" in
|
||||
yes) transient_supervisors=true ;;
|
||||
no) transient_supervisors=false ;;
|
||||
@@ -81,7 +86,7 @@ esac],[transient_supervisors=true])
|
||||
AC_SUBST(transient_supervisors)
|
||||
|
||||
AC_ARG_ENABLE(full_xml,
|
||||
[ --enable-full-xml Use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)],
|
||||
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
|
||||
[case "${enableval}" in
|
||||
yes) full_xml=true ;;
|
||||
no) full_xml=false ;;
|
||||
@@ -120,12 +125,3 @@ fi
|
||||
AC_CHECK_HEADER(krb5.h,,)
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
if test -n "$ERLANG_SSL39" ; then
|
||||
echo
|
||||
echo "**************** WARNING ! ********************"
|
||||
echo "ejabberd will be compiled with Erlang R12."
|
||||
echo "This version of Erlang is not supported"
|
||||
echo "and not recommended for production servers"
|
||||
echo "***********************************************"
|
||||
fi
|
||||
|
||||
+4
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -60,6 +60,8 @@ start() ->
|
||||
EVersion = "ERLANG_VERSION = " ++ erlang:system_info(version) ++ "\n",
|
||||
EIDirS = "EI_DIR = " ++ code:lib_dir("erl_interface") ++ "\n",
|
||||
RootDirS = "ERLANG_DIR = " ++ code:root_dir() ++ "\n",
|
||||
%% Load the ejabberd application description so that ?VERSION can read the vsn key
|
||||
application:load(ejabberd),
|
||||
Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n",
|
||||
ExpatDir = "EXPAT_DIR = c:\\sdk\\Expat-2.0.0\n",
|
||||
OpenSSLDir = "OPENSSL_DIR = c:\\sdk\\OpenSSL\n",
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Created : 23 Aug 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -17,7 +17,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+48
-22
@@ -18,7 +18,8 @@
|
||||
|
||||
-behaviour(cyrsasl).
|
||||
|
||||
-record(state, {step, nonce, username, authzid, get_password, auth_module}).
|
||||
-record(state, {step, nonce, username, authzid, get_password, auth_module,
|
||||
host}).
|
||||
|
||||
start(_Opts) ->
|
||||
cyrsasl:register_mechanism("DIGEST-MD5", ?MODULE, true).
|
||||
@@ -26,9 +27,10 @@ start(_Opts) ->
|
||||
stop() ->
|
||||
ok.
|
||||
|
||||
mech_new(_Host, GetPassword, _CheckPassword) ->
|
||||
mech_new(Host, GetPassword, _CheckPassword) ->
|
||||
{ok, #state{step = 1,
|
||||
nonce = randoms:get_string(),
|
||||
host = Host,
|
||||
get_password = GetPassword}}.
|
||||
|
||||
mech_step(#state{step = 1, nonce = Nonce} = State, _) ->
|
||||
@@ -41,27 +43,35 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) ->
|
||||
bad ->
|
||||
{error, "bad-protocol"};
|
||||
KeyVals ->
|
||||
DigestURI = xml:get_attr_s("digest-uri", KeyVals),
|
||||
UserName = xml:get_attr_s("username", KeyVals),
|
||||
AuthzId = xml:get_attr_s("authzid", KeyVals),
|
||||
case (State#state.get_password)(UserName) of
|
||||
{false, _} ->
|
||||
case is_digesturi_valid(DigestURI, State#state.host) of
|
||||
false ->
|
||||
?DEBUG("User login not authorized because digest-uri "
|
||||
"seems invalid: ~p", [DigestURI]),
|
||||
{error, "not-authorized", UserName};
|
||||
{Passwd, AuthModule} ->
|
||||
Response = response(KeyVals, UserName, Passwd,
|
||||
Nonce, AuthzId, "AUTHENTICATE"),
|
||||
case xml:get_attr_s("response", KeyVals) of
|
||||
Response ->
|
||||
RspAuth = response(KeyVals,
|
||||
UserName, Passwd,
|
||||
Nonce, AuthzId, ""),
|
||||
{continue,
|
||||
"rspauth=" ++ RspAuth,
|
||||
State#state{step = 5,
|
||||
auth_module = AuthModule,
|
||||
username = UserName,
|
||||
authzid = AuthzId}};
|
||||
_ ->
|
||||
{error, "not-authorized", UserName}
|
||||
true ->
|
||||
AuthzId = xml:get_attr_s("authzid", KeyVals),
|
||||
case (State#state.get_password)(UserName) of
|
||||
{false, _} ->
|
||||
{error, "not-authorized", UserName};
|
||||
{Passwd, AuthModule} ->
|
||||
Response = response(KeyVals, UserName, Passwd,
|
||||
Nonce, AuthzId, "AUTHENTICATE"),
|
||||
case xml:get_attr_s("response", KeyVals) of
|
||||
Response ->
|
||||
RspAuth = response(KeyVals,
|
||||
UserName, Passwd,
|
||||
Nonce, AuthzId, ""),
|
||||
{continue,
|
||||
"rspauth=" ++ RspAuth,
|
||||
State#state{step = 5,
|
||||
auth_module = AuthModule,
|
||||
username = UserName,
|
||||
authzid = AuthzId}};
|
||||
_ ->
|
||||
{error, "not-authorized", UserName}
|
||||
end
|
||||
end
|
||||
end
|
||||
end;
|
||||
@@ -75,7 +85,6 @@ mech_step(A, B) ->
|
||||
?DEBUG("SASL DIGEST: A ~p B ~p", [A,B]),
|
||||
{error, "bad-protocol"}.
|
||||
|
||||
|
||||
parse(S) ->
|
||||
parse1(S, "", []).
|
||||
|
||||
@@ -116,6 +125,23 @@ parse4([], Key, Val, Ts) ->
|
||||
parse1([], "", [{Key, lists:reverse(Val)} | Ts]).
|
||||
|
||||
|
||||
%% @doc Check if the digest-uri is valid.
|
||||
%% RFC-2831 allows to provide the IP address in Host,
|
||||
%% however ejabberd doesn't allow that.
|
||||
%% If the service (for example jabber.example.org)
|
||||
%% is provided by several hosts (being one of them server3.example.org),
|
||||
%% then digest-uri can be like xmpp/server3.example.org/jabber.example.org
|
||||
%% In that case, ejabberd only checks the service name, not the host.
|
||||
is_digesturi_valid(DigestURICase, JabberHost) ->
|
||||
DigestURI = stringprep:tolower(DigestURICase),
|
||||
case catch string:tokens(DigestURI, "/") of
|
||||
["xmpp", Host] when Host == JabberHost ->
|
||||
true;
|
||||
["xmpp", _Host, ServName] when ServName == JabberHost ->
|
||||
true;
|
||||
_ ->
|
||||
false
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
{application, ejabberd,
|
||||
[{description, "ejabberd"},
|
||||
{vsn, "2.0.0"},
|
||||
{vsn, "2.0.3"},
|
||||
{modules, [acl,
|
||||
adhoc,
|
||||
configure,
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
{loglevel, 4}.
|
||||
|
||||
%%
|
||||
%% watchdog_admins: If an ejabberd process consumes too much memory,
|
||||
%% send live notifications to those Jabber accounts.
|
||||
%% watchdog_admins: Only useful for developers: if an ejabberd process
|
||||
%% consumes a lot of memory, send live notifications to these Jabber
|
||||
%% accounts.
|
||||
%%
|
||||
%%{watchdog_admins, ["bob@example.com"]}.
|
||||
|
||||
@@ -383,12 +384,16 @@
|
||||
%% All users are allowed to use MUC service:
|
||||
{access, muc, [{allow, all}]}.
|
||||
|
||||
%% Everybody can create pubsub nodes
|
||||
{access, pubsub_createnode, [{allow, all}]}.
|
||||
|
||||
%% In-band registration allows registration of any possible username.
|
||||
%% To disable in-band registration, replace 'allow' with 'deny'.
|
||||
{access, register, [{allow, all}]}.
|
||||
|
||||
%% Everybody can create pubsub nodes
|
||||
{access, pubsub_createnode, [{allow, all}]}.
|
||||
%% By default frequency of account registrations from a the same IP
|
||||
%% is limited to 1 account every 10 minutes. To disable put: infinity
|
||||
%%{registration_timeout, 600}.
|
||||
|
||||
%%
|
||||
%% Define specific Access rules in a virtual host.
|
||||
@@ -455,7 +460,7 @@
|
||||
%% a message with this subject and body.
|
||||
%%
|
||||
{welcome_message, {"Welcome!",
|
||||
"Welcome to this Jabber server."}},
|
||||
"Hi\nWelcome to this Jabber server."}},
|
||||
|
||||
%%
|
||||
%% When a user registers, send a notification to
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+5
-3
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -19,7 +19,9 @@
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
|
||||
-define(VERSION, "2.0.0").
|
||||
%% This macro returns a string of the ejabberd version running, e.g. "2.3.4"
|
||||
%% If the ejabberd application description isn't loaded, returns atom: undefined
|
||||
-define(VERSION, element(2, application:get_key(ejabberd,vsn))).
|
||||
|
||||
-define(MYHOSTS, ejabberd_config:get_global_option(hosts)).
|
||||
-define(MYNAME, hd(ejabberd_config:get_global_option(hosts))).
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
%%% Created : 7 May 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -20,7 +20,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -46,13 +46,13 @@ start(normal, _Args) ->
|
||||
sha:start(),
|
||||
catch ssl:start(),
|
||||
stringprep_sup:start_link(),
|
||||
start(),
|
||||
translate:start(),
|
||||
acl:start(),
|
||||
ejabberd_ctl:init(),
|
||||
gen_mod:start(),
|
||||
ejabberd_config:start(),
|
||||
ejabberd_check:config(),
|
||||
start(),
|
||||
connect_nodes(),
|
||||
Sup = ejabberd_sup:start_link(),
|
||||
ejabberd_rdbms:start(),
|
||||
@@ -153,7 +153,7 @@ stop_modules() ->
|
||||
Modules ->
|
||||
lists:foreach(
|
||||
fun({Module, _Args}) ->
|
||||
gen_mod:stop_module(Host, Module)
|
||||
gen_mod:stop_module_keep_config(Host, Module)
|
||||
end, Modules)
|
||||
end
|
||||
end, ?MYHOSTS).
|
||||
|
||||
+46
-9
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -127,6 +127,12 @@ check_password_with_authmodule(User, Server, Password, StreamID, Digest) ->
|
||||
[AuthMod | _] -> {true, AuthMod}
|
||||
end.
|
||||
|
||||
%% @spec (User::string(), Server::string(), Password::string()) ->
|
||||
%% ok | {error, ErrorType}
|
||||
%% where ErrorType = empty_password | not_allowed | invalid_jid
|
||||
set_password(_User, _Server, "") ->
|
||||
%% We do not allow empty password
|
||||
{error, empty_password};
|
||||
set_password(User, Server, Password) ->
|
||||
lists:foldl(
|
||||
fun(M, {error, _}) ->
|
||||
@@ -135,6 +141,10 @@ set_password(User, Server, Password) ->
|
||||
Res
|
||||
end, {error, not_allowed}, auth_modules(Server)).
|
||||
|
||||
%% @spec (User, Server, Password) -> {atomic, ok} | {atomic, exists} | {error, not_allowed}
|
||||
try_register(_User, _Server, "") ->
|
||||
%% We do not allow empty password
|
||||
{error, not_allowed};
|
||||
try_register(User, Server, Password) ->
|
||||
case is_user_exists(User,Server) of
|
||||
true ->
|
||||
@@ -142,12 +152,19 @@ try_register(User, Server, Password) ->
|
||||
false ->
|
||||
case lists:member(jlib:nameprep(Server), ?MYHOSTS) of
|
||||
true ->
|
||||
lists:foldl(
|
||||
Res = lists:foldl(
|
||||
fun(_M, {atomic, ok} = Res) ->
|
||||
Res;
|
||||
(M, _) ->
|
||||
M:try_register(User, Server, Password)
|
||||
end, {error, not_allowed}, auth_modules(Server));
|
||||
end, {error, not_allowed}, auth_modules(Server)),
|
||||
case Res of
|
||||
{atomic, ok} ->
|
||||
ejabberd_hooks:run(register_user, Server,
|
||||
[User, Server]),
|
||||
{atomic, ok};
|
||||
_ -> Res
|
||||
end;
|
||||
false ->
|
||||
{error, not_allowed}
|
||||
end
|
||||
@@ -244,17 +261,37 @@ is_user_exists_in_other_modules(Module, User, Server) ->
|
||||
M:is_user_exists(User, Server)
|
||||
end, auth_modules(Server)--[Module]).
|
||||
|
||||
%% @spec (User, Server) -> ok | error | {error, not_allowed}
|
||||
%% @doc Remove user.
|
||||
%% Note: it may return ok even if there was some problem removing the user.
|
||||
remove_user(User, Server) ->
|
||||
lists:foreach(
|
||||
R = lists:foreach(
|
||||
fun(M) ->
|
||||
M:remove_user(User, Server)
|
||||
end, auth_modules(Server)).
|
||||
end, auth_modules(Server)),
|
||||
case R of
|
||||
ok -> ejabberd_hooks:run(remove_user, jlib:nameprep(Server), [User, Server]);
|
||||
_ -> none
|
||||
end,
|
||||
R.
|
||||
|
||||
%% @spec (User, Server, Password) -> ok | not_exists | not_allowed | bad_request | error
|
||||
%% @doc Try to remove user if the provided password is correct.
|
||||
%% The removal is attempted in each auth method provided:
|
||||
%% when one returns 'ok' the loop stops;
|
||||
%% if no method returns 'ok' then it returns the error message indicated by the last method attempted.
|
||||
remove_user(User, Server, Password) ->
|
||||
lists:foreach(
|
||||
fun(M) ->
|
||||
R = lists:foldl(
|
||||
fun(_M, ok = Res) ->
|
||||
Res;
|
||||
(M, _) ->
|
||||
M:remove_user(User, Server, Password)
|
||||
end, auth_modules(Server)).
|
||||
end, error, auth_modules(Server)),
|
||||
case R of
|
||||
ok -> ejabberd_hooks:run(remove_user, jlib:nameprep(Server), [User, Server]);
|
||||
_ -> none
|
||||
end,
|
||||
R.
|
||||
|
||||
ctl_process_get_registered(_Val, Host, ["registered-users"]) ->
|
||||
Users = ejabberd_auth:get_vh_registered_users(Host),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 17 Feb 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -61,7 +61,10 @@ check_password(User, Server, Password, _StreamID, _Digest) ->
|
||||
check_password(User, Server, Password).
|
||||
|
||||
set_password(User, Server, Password) ->
|
||||
extauth:set_password(User, Server, Password).
|
||||
case extauth:set_password(User, Server, Password) of
|
||||
true -> ok;
|
||||
_ -> {error, unknown_problem}
|
||||
end.
|
||||
|
||||
try_register(_User, _Server, _Password) ->
|
||||
{error, not_allowed}.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -98,6 +98,8 @@ check_password(User, Server, Password, StreamID, Digest) ->
|
||||
false
|
||||
end.
|
||||
|
||||
%% @spec (User::string(), Server::string(), Password::string()) ->
|
||||
%% ok | {error, invalid_jid}
|
||||
set_password(User, Server, Password) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
@@ -110,10 +112,12 @@ set_password(User, Server, Password) ->
|
||||
mnesia:write(#passwd{us = US,
|
||||
password = Password})
|
||||
end,
|
||||
mnesia:transaction(F)
|
||||
{atomic, ok} = mnesia:transaction(F),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
||||
%% @spec (User, Server, Password) -> {atomic, ok} | {atomic, exists} | {error, invalid_jid} | {aborted, Reason}
|
||||
try_register(User, Server, Password) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
@@ -239,6 +243,9 @@ is_user_exists(User, Server) ->
|
||||
false
|
||||
end.
|
||||
|
||||
%% @spec (User, Server) -> ok
|
||||
%% @doc Remove user.
|
||||
%% Note: it returns ok even if there was some problem removing the user.
|
||||
remove_user(User, Server) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
@@ -247,8 +254,10 @@ remove_user(User, Server) ->
|
||||
mnesia:delete({passwd, US})
|
||||
end,
|
||||
mnesia:transaction(F),
|
||||
ejabberd_hooks:run(remove_user, LServer, [User, Server]).
|
||||
ok.
|
||||
|
||||
%% @spec (User, Server, Password) -> ok | not_exists | not_allowed | bad_request
|
||||
%% @doc Remove user if the provided password is correct.
|
||||
remove_user(User, Server, Password) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
@@ -266,7 +275,6 @@ remove_user(User, Server, Password) ->
|
||||
end,
|
||||
case mnesia:transaction(F) of
|
||||
{atomic, ok} ->
|
||||
ejabberd_hooks:run(remove_user, LServer, [User, Server]),
|
||||
ok;
|
||||
{atomic, Res} ->
|
||||
Res;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -160,6 +160,7 @@ check_password(User, Server, Password, _StreamID, _Digest) ->
|
||||
set_password(_User, _Server, _Password) ->
|
||||
{error, not_allowed}.
|
||||
|
||||
%% @spec (User, Server, Password) -> {error, not_allowed}
|
||||
try_register(_User, _Server, _Password) ->
|
||||
{error, not_allowed}.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -101,6 +101,8 @@ check_password(User, Server, Password, StreamID, Digest) ->
|
||||
end
|
||||
end.
|
||||
|
||||
%% @spec (User::string(), Server::string(), Password::string()) ->
|
||||
%% ok | {error, invalid_jid}
|
||||
set_password(User, Server, Password) ->
|
||||
case jlib:nodeprep(User) of
|
||||
error ->
|
||||
@@ -109,10 +111,14 @@ set_password(User, Server, Password) ->
|
||||
Username = ejabberd_odbc:escape(LUser),
|
||||
Pass = ejabberd_odbc:escape(Password),
|
||||
LServer = jlib:nameprep(Server),
|
||||
catch odbc_queries:set_password_t(LServer, Username, Pass)
|
||||
case catch odbc_queries:set_password_t(LServer, Username, Pass) of
|
||||
{atomic, ok} -> ok;
|
||||
Other -> {error, Other}
|
||||
end
|
||||
end.
|
||||
|
||||
|
||||
%% @spec (User, Server, Password) -> {atomic, ok} | {atomic, exists} | {error, invalid_jid}
|
||||
try_register(User, Server, Password) ->
|
||||
case jlib:nodeprep(User) of
|
||||
error ->
|
||||
@@ -217,6 +223,9 @@ is_user_exists(User, Server) ->
|
||||
end
|
||||
end.
|
||||
|
||||
%% @spec (User, Server) -> ok | error
|
||||
%% @doc Remove user.
|
||||
%% Note: it may return ok even if there was some problem removing the user.
|
||||
remove_user(User, Server) ->
|
||||
case jlib:nodeprep(User) of
|
||||
error ->
|
||||
@@ -225,10 +234,11 @@ remove_user(User, Server) ->
|
||||
Username = ejabberd_odbc:escape(LUser),
|
||||
LServer = jlib:nameprep(Server),
|
||||
catch odbc_queries:del_user(LServer, Username),
|
||||
ejabberd_hooks:run(remove_user, jlib:nameprep(Server),
|
||||
[User, Server])
|
||||
ok
|
||||
end.
|
||||
|
||||
%% @spec (User, Server, Password) -> ok | error | not_exists | not_allowed
|
||||
%% @doc Remove user if the provided password is correct.
|
||||
remove_user(User, Server, Password) ->
|
||||
case jlib:nodeprep(User) of
|
||||
error ->
|
||||
@@ -242,8 +252,6 @@ remove_user(User, Server, Password) ->
|
||||
LServer, Username, Pass),
|
||||
case Result of
|
||||
{selected, ["password"], [{Password}]} ->
|
||||
ejabberd_hooks:run(remove_user, jlib:nameprep(Server),
|
||||
[User, Server]),
|
||||
ok;
|
||||
{selected, ["password"], []} ->
|
||||
not_exists;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 5 Jul 2007 by Evgeniy Khramtsov <xram@jabber.ru>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -91,7 +91,7 @@ remove_user(_User, _Server) ->
|
||||
{error, not_allowed}.
|
||||
|
||||
remove_user(_User, _Server, _Password) ->
|
||||
{error, not_allowed}.
|
||||
not_allowed.
|
||||
|
||||
plain_password_required() ->
|
||||
true.
|
||||
|
||||
+130
-87
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -37,7 +37,7 @@
|
||||
send_element/2,
|
||||
socket_type/0,
|
||||
get_presence/1,
|
||||
get_subscribed_and_online/1]).
|
||||
get_subscribed/1]).
|
||||
|
||||
%% gen_fsm callbacks
|
||||
-export([init/1,
|
||||
@@ -61,6 +61,8 @@
|
||||
-define(SETS, gb_sets).
|
||||
-define(DICT, dict).
|
||||
|
||||
%% pres_a contains all the presence available send (either through roster mechanism or directed).
|
||||
%% Directed presence unavailable remove user from pres_a.
|
||||
-record(state, {socket,
|
||||
sockmod,
|
||||
socket_monitor,
|
||||
@@ -81,7 +83,6 @@
|
||||
pres_f = ?SETS:new(),
|
||||
pres_a = ?SETS:new(),
|
||||
pres_i = ?SETS:new(),
|
||||
pres_available = ?DICT:new(),
|
||||
pres_last, pres_pri,
|
||||
pres_timestamp,
|
||||
pres_invis = false,
|
||||
@@ -130,6 +131,9 @@
|
||||
xml:element_to_string(?SERR_HOST_UNKNOWN)).
|
||||
-define(POLICY_VIOLATION_ERR(Lang, Text),
|
||||
xml:element_to_string(?SERRT_POLICY_VIOLATION(Lang, Text))).
|
||||
-define(INVALID_FROM,
|
||||
xml:element_to_string(?SERR_INVALID_FROM)).
|
||||
|
||||
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% API
|
||||
@@ -172,37 +176,44 @@ init([{SockMod, Socket}, Opts]) ->
|
||||
StartTLSRequired = lists:member(starttls_required, Opts),
|
||||
TLSEnabled = lists:member(tls, Opts),
|
||||
TLS = StartTLS orelse StartTLSRequired orelse TLSEnabled,
|
||||
TLSOpts = lists:filter(fun({certfile, _}) -> true;
|
||||
(_) -> false
|
||||
end, Opts),
|
||||
TLSOpts1 =
|
||||
lists:filter(fun({certfile, _}) -> true;
|
||||
(_) -> false
|
||||
end, Opts),
|
||||
TLSOpts = [verify_none | TLSOpts1],
|
||||
IP = peerip(SockMod, Socket),
|
||||
Socket1 =
|
||||
if
|
||||
TLSEnabled ->
|
||||
SockMod:starttls(Socket, TLSOpts);
|
||||
true ->
|
||||
Socket
|
||||
end,
|
||||
SocketMonitor = SockMod:monitor(Socket1),
|
||||
{ok, wait_for_stream, #state{socket = Socket1,
|
||||
sockmod = SockMod,
|
||||
socket_monitor = SocketMonitor,
|
||||
zlib = Zlib,
|
||||
tls = TLS,
|
||||
tls_required = StartTLSRequired,
|
||||
tls_enabled = TLSEnabled,
|
||||
tls_options = TLSOpts,
|
||||
streamid = new_id(),
|
||||
access = Access,
|
||||
shaper = Shaper,
|
||||
ip = IP}, ?C2S_OPEN_TIMEOUT}.
|
||||
%% Check if IP is blacklisted:
|
||||
case is_ip_blacklisted(IP) of
|
||||
true ->
|
||||
?INFO_MSG("Connection attempt from blacklisted IP: ~s",
|
||||
[jlib:ip_to_list(IP)]),
|
||||
{stop, normal};
|
||||
false ->
|
||||
Socket1 =
|
||||
if
|
||||
TLSEnabled ->
|
||||
SockMod:starttls(Socket, TLSOpts);
|
||||
true ->
|
||||
Socket
|
||||
end,
|
||||
SocketMonitor = SockMod:monitor(Socket1),
|
||||
{ok, wait_for_stream, #state{socket = Socket1,
|
||||
sockmod = SockMod,
|
||||
socket_monitor = SocketMonitor,
|
||||
zlib = Zlib,
|
||||
tls = TLS,
|
||||
tls_required = StartTLSRequired,
|
||||
tls_enabled = TLSEnabled,
|
||||
tls_options = TLSOpts,
|
||||
streamid = new_id(),
|
||||
access = Access,
|
||||
shaper = Shaper,
|
||||
ip = IP}, ?C2S_OPEN_TIMEOUT}
|
||||
end.
|
||||
|
||||
%% Return list of all available resources of contacts,
|
||||
%% in form [{JID, Caps}].
|
||||
get_subscribed_and_online(FsmRef) ->
|
||||
gen_fsm:sync_send_all_state_event(
|
||||
FsmRef, get_subscribed_and_online, 1000).
|
||||
|
||||
get_subscribed(FsmRef) ->
|
||||
gen_fsm:sync_send_all_state_event(FsmRef, get_subscribed, 1000).
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
%% Func: StateName/2
|
||||
@@ -849,13 +860,41 @@ wait_for_session(closed, StateData) ->
|
||||
{stop, normal, StateData}.
|
||||
|
||||
|
||||
|
||||
|
||||
session_established({xmlstreamelement, El}, StateData) ->
|
||||
FromJID = StateData#state.jid,
|
||||
% Check 'from' attribute in stanza RFC 3920 Section 9.1.2
|
||||
case check_from(El, FromJID) of
|
||||
'invalid-from' ->
|
||||
send_text(StateData, ?INVALID_FROM ++ ?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
_NewEl ->
|
||||
session_established2(El, StateData)
|
||||
end;
|
||||
|
||||
%% We hibernate the process to reduce memory consumption after a
|
||||
%% configurable activity timeout
|
||||
session_established(timeout, StateData) ->
|
||||
%% TODO: Options must be stored in state:
|
||||
Options = [],
|
||||
proc_lib:hibernate(gen_fsm, enter_loop,
|
||||
[?MODULE, Options, session_established, StateData]),
|
||||
fsm_next_state(session_established, StateData);
|
||||
|
||||
session_established({xmlstreamend, _Name}, StateData) ->
|
||||
send_text(StateData, ?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
|
||||
session_established({xmlstreamerror, _}, StateData) ->
|
||||
send_text(StateData, ?INVALID_XML_ERR ++ ?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
|
||||
session_established(closed, StateData) ->
|
||||
{stop, normal, StateData}.
|
||||
|
||||
session_established2(El, StateData) ->
|
||||
{xmlelement, Name, Attrs, _Els} = El,
|
||||
User = StateData#state.user,
|
||||
Server = StateData#state.server,
|
||||
% TODO: check 'from' attribute in stanza
|
||||
FromJID = StateData#state.jid,
|
||||
To = xml:get_attr_s("to", Attrs),
|
||||
ToJID = case To of
|
||||
@@ -931,27 +970,7 @@ session_established({xmlstreamelement, El}, StateData) ->
|
||||
end
|
||||
end,
|
||||
ejabberd_hooks:run(c2s_loop_debug, [{xmlstreamelement, El}]),
|
||||
fsm_next_state(session_established, NewState);
|
||||
|
||||
%% We hibernate the process to reduce memory consumption after a
|
||||
%% configurable activity timeout
|
||||
session_established(timeout, StateData) ->
|
||||
%% TODO: Options must be stored in state:
|
||||
Options = [],
|
||||
proc_lib:hibernate(gen_fsm, enter_loop,
|
||||
[?MODULE, Options, session_established, StateData]),
|
||||
fsm_next_state(session_established, StateData);
|
||||
|
||||
session_established({xmlstreamend, _Name}, StateData) ->
|
||||
send_text(StateData, ?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
|
||||
session_established({xmlstreamerror, _}, StateData) ->
|
||||
send_text(StateData, ?INVALID_XML_ERR ++ ?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
|
||||
session_established(closed, StateData) ->
|
||||
{stop, normal, StateData}.
|
||||
fsm_next_state(session_established, NewState).
|
||||
|
||||
|
||||
|
||||
@@ -997,16 +1016,9 @@ handle_sync_event({get_presence}, _From, StateName, StateData) ->
|
||||
Reply = {User, Resource, Show, Status},
|
||||
fsm_reply(Reply, StateName, StateData);
|
||||
|
||||
handle_sync_event(get_subscribed_and_online, _From, StateName, StateData) ->
|
||||
Subscribed = StateData#state.pres_f,
|
||||
Online = StateData#state.pres_available,
|
||||
Pred = fun(User, _Caps) ->
|
||||
?SETS:is_element(jlib:jid_remove_resource(User),
|
||||
Subscribed) orelse
|
||||
?SETS:is_element(User, Subscribed)
|
||||
end,
|
||||
SubscribedAndOnline = ?DICT:filter(Pred, Online),
|
||||
{reply, ?DICT:to_list(SubscribedAndOnline), StateName, StateData};
|
||||
handle_sync_event(get_subscribed, _From, StateName, StateData) ->
|
||||
Subscribed = ?SETS:to_list(StateData#state.pres_f),
|
||||
{reply, Subscribed, StateName, StateData};
|
||||
|
||||
handle_sync_event(_Event, _From, StateName, StateData) ->
|
||||
Reply = ok,
|
||||
@@ -1099,41 +1111,39 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
|
||||
LFrom = jlib:jid_tolower(From),
|
||||
LBFrom = jlib:jid_remove_resource(LFrom),
|
||||
%% Note contact availability
|
||||
Caps = mod_caps:read_caps(Els),
|
||||
mod_caps:note_caps(StateData#state.server, From, Caps),
|
||||
NewAvailable = case xml:get_attr_s("type", Attrs) of
|
||||
"unavailable" ->
|
||||
?DICT:erase(LFrom, StateData#state.pres_available);
|
||||
_ ->
|
||||
?DICT:store(LFrom, Caps, StateData#state.pres_available)
|
||||
end,
|
||||
NewStateData = StateData#state{pres_available = NewAvailable},
|
||||
case xml:get_attr_s("type", Attrs) of
|
||||
"unavailable" ->
|
||||
mod_caps:clear_caps(From);
|
||||
_ ->
|
||||
Caps = mod_caps:read_caps(Els),
|
||||
mod_caps:note_caps(StateData#state.server, From, Caps)
|
||||
end,
|
||||
case ?SETS:is_element(
|
||||
LFrom, NewStateData#state.pres_a) orelse
|
||||
LFrom, StateData#state.pres_a) orelse
|
||||
?SETS:is_element(
|
||||
LBFrom, NewStateData#state.pres_a) of
|
||||
LBFrom, StateData#state.pres_a) of
|
||||
true ->
|
||||
{true, Attrs, NewStateData};
|
||||
{true, Attrs, StateData};
|
||||
false ->
|
||||
case ?SETS:is_element(
|
||||
LFrom, NewStateData#state.pres_f) of
|
||||
LFrom, StateData#state.pres_f) of
|
||||
true ->
|
||||
A = ?SETS:add_element(
|
||||
LFrom,
|
||||
NewStateData#state.pres_a),
|
||||
StateData#state.pres_a),
|
||||
{true, Attrs,
|
||||
NewStateData#state{pres_a = A}};
|
||||
StateData#state{pres_a = A}};
|
||||
false ->
|
||||
case ?SETS:is_element(
|
||||
LBFrom, NewStateData#state.pres_f) of
|
||||
LBFrom, StateData#state.pres_f) of
|
||||
true ->
|
||||
A = ?SETS:add_element(
|
||||
LBFrom,
|
||||
NewStateData#state.pres_a),
|
||||
StateData#state.pres_a),
|
||||
{true, Attrs,
|
||||
NewStateData#state{pres_a = A}};
|
||||
StateData#state{pres_a = A}};
|
||||
false ->
|
||||
{true, Attrs, NewStateData}
|
||||
{true, Attrs, StateData}
|
||||
end
|
||||
end
|
||||
end;
|
||||
@@ -1448,7 +1458,8 @@ presence_update(From, Packet, StateData) ->
|
||||
StatusTag ->
|
||||
xml:get_tag_cdata(StatusTag)
|
||||
end,
|
||||
Info = [{ip, StateData#state.ip},{conn, StateData#state.conn}],
|
||||
Info = [{ip, StateData#state.ip}, {conn, StateData#state.conn},
|
||||
{auth_module, StateData#state.auth_module}],
|
||||
ejabberd_sm:unset_presence(StateData#state.sid,
|
||||
StateData#state.user,
|
||||
StateData#state.server,
|
||||
@@ -1780,7 +1791,8 @@ roster_change(IJID, ISubscription, StateData) ->
|
||||
|
||||
|
||||
update_priority(Priority, Packet, StateData) ->
|
||||
Info = [{ip, StateData#state.ip},{conn, StateData#state.conn}],
|
||||
Info = [{ip, StateData#state.ip}, {conn, StateData#state.conn},
|
||||
{auth_module, StateData#state.auth_module}],
|
||||
ejabberd_sm:set_presence(StateData#state.sid,
|
||||
StateData#state.user,
|
||||
StateData#state.server,
|
||||
@@ -1952,3 +1964,34 @@ fsm_reply(Reply, session_established, StateData) ->
|
||||
{reply, Reply, session_established, StateData, ?C2S_HIBERNATE_TIMEOUT};
|
||||
fsm_reply(Reply, StateName, StateData) ->
|
||||
{reply, Reply, StateName, StateData, ?C2S_OPEN_TIMEOUT}.
|
||||
|
||||
%% Used by c2s blacklist plugins
|
||||
is_ip_blacklisted({IP,_Port}) ->
|
||||
ejabberd_hooks:run_fold(check_bl_c2s, false, [IP]).
|
||||
|
||||
%% Check from attributes
|
||||
%% returns invalid-from|NewElement
|
||||
check_from(El, FromJID) ->
|
||||
case xml:get_tag_attr("from", El) of
|
||||
false ->
|
||||
El;
|
||||
{value, SJID} ->
|
||||
JID = jlib:string_to_jid(SJID),
|
||||
case JID of
|
||||
error ->
|
||||
'invalid-from';
|
||||
#jid{} ->
|
||||
if
|
||||
(JID#jid.luser == FromJID#jid.luser) and
|
||||
(JID#jid.lserver == FromJID#jid.lserver) and
|
||||
(JID#jid.lresource == FromJID#jid.lresource) ->
|
||||
El;
|
||||
(JID#jid.luser == FromJID#jid.luser) and
|
||||
(JID#jid.lserver == FromJID#jid.lserver) and
|
||||
(JID#jid.lresource == "") ->
|
||||
El;
|
||||
true ->
|
||||
'invalid-from'
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Created : 2 Nov 2007 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -17,7 +17,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+18
-8
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Feb 2008 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -39,19 +39,21 @@
|
||||
libs() ->
|
||||
ok.
|
||||
|
||||
%% Consistency check on ejabberd configuration
|
||||
%% @doc Consistency check on ejabberd configuration
|
||||
config() ->
|
||||
check_database_modules().
|
||||
|
||||
check_database_modules() ->
|
||||
[check_database_module(M)||M<-get_db_used()].
|
||||
|
||||
check_database_module(odbc) ->
|
||||
check_modules(odbc, [odbc, odbc_app, odbc_sup, ejabberd_odbc, ejabberd_odbc_sup, odbc_queries]);
|
||||
check_database_module(mysql) ->
|
||||
check_modules(mysql, [mysql, mysql_auth, mysql_conn, mysql_recv]);
|
||||
check_database_module(pgsql) ->
|
||||
check_modules(pgsql, [pgsql, pgsql_proto, pgsql_tcp, pgsql_util]).
|
||||
|
||||
%% Issue a critical error and throw an exit if needing module is
|
||||
%% @doc Issue a critical error and throw an exit if needing module is
|
||||
%% missing.
|
||||
check_modules(DB, Modules) ->
|
||||
case get_missing_modules(Modules) of
|
||||
@@ -63,7 +65,7 @@ check_modules(DB, Modules) ->
|
||||
end.
|
||||
|
||||
|
||||
%% Return the list of undefined modules
|
||||
%% @doc Return the list of undefined modules
|
||||
get_missing_modules(Modules) ->
|
||||
lists:filter(fun(Module) ->
|
||||
case catch Module:module_info() of
|
||||
@@ -73,7 +75,7 @@ get_missing_modules(Modules) ->
|
||||
end
|
||||
end, Modules).
|
||||
|
||||
%% Return the list of databases used
|
||||
%% @doc Return the list of databases used
|
||||
get_db_used() ->
|
||||
%% Retrieve domains with a database configured:
|
||||
Domains =
|
||||
@@ -86,14 +88,22 @@ get_db_used() ->
|
||||
case check_odbc_option(
|
||||
ejabberd_config:get_local_option(
|
||||
{auth_method, Domain})) of
|
||||
true -> [element(1, DB)|Acc];
|
||||
true -> [get_db_type(DB)|Acc];
|
||||
_ -> Acc
|
||||
end
|
||||
end,
|
||||
[], Domains),
|
||||
lists:usort(DBs).
|
||||
|
||||
%% Return true if odbc option is used
|
||||
%% @doc Depending in the DB definition, return which type of DB this is
|
||||
%% Note that MSSQL is detected as ODBC.
|
||||
%% @spec (DB) -> mysql | pgsql | odbc
|
||||
get_db_type(DB) when is_tuple(DB) ->
|
||||
element(1, DB);
|
||||
get_db_type(DB) when is_list(DB) ->
|
||||
odbc.
|
||||
|
||||
%% @doc Return true if odbc option is used
|
||||
check_odbc_option(odbc) ->
|
||||
true;
|
||||
check_odbc_option(AuthMethods) when is_list(AuthMethods) ->
|
||||
|
||||
+10
-4
@@ -5,7 +5,7 @@
|
||||
%%% Created : 14 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -64,9 +64,15 @@ load_file(File) ->
|
||||
State = lists:foldl(fun search_hosts/2, #state{}, Terms),
|
||||
Res = lists:foldl(fun process_term/2, State, Terms),
|
||||
set_opts(Res);
|
||||
{error, {_LineNumber, erl_parse, _ParseMessage} = Reason} ->
|
||||
ExitText = lists:flatten(File ++ " approximately in the line "
|
||||
++ file:format_error(Reason)),
|
||||
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
|
||||
exit(ExitText);
|
||||
{error, Reason} ->
|
||||
?ERROR_MSG("Can't load config file ~p: ~p", [File, Reason]),
|
||||
exit(File ++ ": " ++ file:format_error(Reason))
|
||||
ExitText = lists:flatten(File ++ ": " ++ file:format_error(Reason)),
|
||||
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
|
||||
exit(ExitText)
|
||||
end.
|
||||
|
||||
search_hosts(Term, State) ->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+21
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 11 Jan 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -30,6 +30,7 @@
|
||||
-export([start/0,
|
||||
init/0,
|
||||
process/1,
|
||||
dump_to_textfile/1,
|
||||
register_commands/3,
|
||||
register_commands/4,
|
||||
unregister_commands/3,
|
||||
@@ -98,6 +99,14 @@ process(["restart"]) ->
|
||||
|
||||
process(["reopen-log"]) ->
|
||||
ejabberd_logger_h:reopen_log(),
|
||||
case application:get_env(sasl,sasl_error_logger) of
|
||||
{ok, {file, SASLfile}} ->
|
||||
error_logger:delete_report_handler(sasl_report_file_h),
|
||||
ejabberd_logger_h:rotate_log(SASLfile),
|
||||
error_logger:add_report_handler(sasl_report_file_h,
|
||||
{SASLfile, get_sasl_error_logger_type()});
|
||||
_ -> false
|
||||
end,
|
||||
?STATUS_SUCCESS;
|
||||
|
||||
process(["register", User, Server, Password]) ->
|
||||
@@ -400,3 +409,13 @@ dump_tab(F, T) ->
|
||||
fun() -> mnesia:match_object(T, W, read) end),
|
||||
lists:foreach(
|
||||
fun(Term) -> io:format(F,"~p.~n", [setelement(1, Term, T)]) end, All).
|
||||
|
||||
%% Function copied from Erlang/OTP lib/sasl/src/sasl.erl which doesn't export it
|
||||
get_sasl_error_logger_type () ->
|
||||
case application:get_env (sasl, errlog_type) of
|
||||
{ok, error} -> error;
|
||||
{ok, progress} -> progress;
|
||||
{ok, all} -> all;
|
||||
{ok, Bad} -> exit ({bad_config, {sasl, {errlog_type, Bad}}});
|
||||
_ -> all
|
||||
end.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -53,6 +53,8 @@
|
||||
|
||||
-record(state, {sockmod, socket, receiver}).
|
||||
|
||||
-define(HIBERNATE_TIMEOUT, 90000).
|
||||
|
||||
%%====================================================================
|
||||
%% API
|
||||
%%====================================================================
|
||||
@@ -173,7 +175,8 @@ handle_call({starttls, TLSOpts}, _From, State) ->
|
||||
{ok, TLSSocket} = tls:tcp_to_tls(State#state.socket, TLSOpts),
|
||||
ejabberd_receiver:starttls(State#state.receiver, TLSSocket),
|
||||
Reply = ok,
|
||||
{reply, Reply, State#state{socket = TLSSocket, sockmod = tls}};
|
||||
{reply, Reply, State#state{socket = TLSSocket, sockmod = tls},
|
||||
?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call({starttls, TLSOpts, Data}, _From, State) ->
|
||||
{ok, TLSSocket} = tls:tcp_to_tls(State#state.socket, TLSOpts),
|
||||
@@ -181,7 +184,8 @@ handle_call({starttls, TLSOpts, Data}, _From, State) ->
|
||||
catch (State#state.sockmod):send(
|
||||
State#state.socket, Data),
|
||||
Reply = ok,
|
||||
{reply, Reply, State#state{socket = TLSSocket, sockmod = tls}};
|
||||
{reply, Reply, State#state{socket = TLSSocket, sockmod = tls},
|
||||
?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(compress, _From, State) ->
|
||||
{ok, ZlibSocket} = ejabberd_zlib:enable_zlib(
|
||||
@@ -189,7 +193,8 @@ handle_call(compress, _From, State) ->
|
||||
State#state.socket),
|
||||
ejabberd_receiver:compress(State#state.receiver, ZlibSocket),
|
||||
Reply = ok,
|
||||
{reply, Reply, State#state{socket = ZlibSocket, sockmod = ejabberd_zlib}};
|
||||
{reply, Reply, State#state{socket = ZlibSocket, sockmod = ejabberd_zlib},
|
||||
?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call({compress, Data}, _From, State) ->
|
||||
{ok, ZlibSocket} = ejabberd_zlib:enable_zlib(
|
||||
@@ -199,35 +204,36 @@ handle_call({compress, Data}, _From, State) ->
|
||||
catch (State#state.sockmod):send(
|
||||
State#state.socket, Data),
|
||||
Reply = ok,
|
||||
{reply, Reply, State#state{socket = ZlibSocket, sockmod = ejabberd_zlib}};
|
||||
{reply, Reply, State#state{socket = ZlibSocket, sockmod = ejabberd_zlib},
|
||||
?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(reset_stream, _From, State) ->
|
||||
ejabberd_receiver:reset_stream(State#state.receiver),
|
||||
Reply = ok,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call({send, Data}, _From, State) ->
|
||||
catch (State#state.sockmod):send(
|
||||
State#state.socket, Data),
|
||||
Reply = ok,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call({change_shaper, Shaper}, _From, State) ->
|
||||
ejabberd_receiver:change_shaper(State#state.receiver, Shaper),
|
||||
Reply = ok,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(get_sockmod, _From, State) ->
|
||||
Reply = State#state.sockmod,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(get_peer_certificate, _From, State) ->
|
||||
Reply = tls:get_peer_certificate(State#state.socket),
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(get_verify_result, _From, State) ->
|
||||
Reply = tls:get_verify_result(State#state.socket),
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(close, _From, State) ->
|
||||
ejabberd_receiver:close(State#state.receiver),
|
||||
@@ -243,7 +249,7 @@ handle_call(sockname, _From, State) ->
|
||||
_ ->
|
||||
SockMod:sockname(Socket)
|
||||
end,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(peername, _From, State) ->
|
||||
#state{sockmod = SockMod, socket = Socket} = State,
|
||||
@@ -254,11 +260,11 @@ handle_call(peername, _From, State) ->
|
||||
_ ->
|
||||
SockMod:peername(Socket)
|
||||
end,
|
||||
{reply, Reply, State};
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT};
|
||||
|
||||
handle_call(_Request, _From, State) ->
|
||||
Reply = ok,
|
||||
{reply, Reply, State}.
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: handle_cast(Msg, State) -> {noreply, State} |
|
||||
@@ -267,7 +273,7 @@ handle_call(_Request, _From, State) ->
|
||||
%% Description: Handling cast messages
|
||||
%%--------------------------------------------------------------------
|
||||
handle_cast(_Msg, State) ->
|
||||
{noreply, State}.
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: handle_info(Info, State) -> {noreply, State} |
|
||||
@@ -275,8 +281,11 @@ handle_cast(_Msg, State) ->
|
||||
%% {stop, Reason, State}
|
||||
%% Description: Handling all non call/cast messages
|
||||
%%--------------------------------------------------------------------
|
||||
handle_info(timeout, State) ->
|
||||
proc_lib:hibernate(gen_server, enter_loop, [?MODULE, [], State]),
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT};
|
||||
handle_info(_Info, State) ->
|
||||
{noreply, State}.
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: terminate(Reason, State) -> void()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 8 Aug 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -38,6 +38,9 @@
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
|
||||
%% We do not block on send anymore.
|
||||
-define(TCP_SEND_TIMEOUT, 15000).
|
||||
|
||||
start_link() ->
|
||||
supervisor:start_link({local, ejabberd_listeners}, ?MODULE, []).
|
||||
|
||||
@@ -89,10 +92,11 @@ init(Port, Module, Opts) ->
|
||||
end, Opts),
|
||||
|
||||
Res = gen_tcp:listen(Port, [binary,
|
||||
{packet, 0},
|
||||
{packet, 0},
|
||||
{active, false},
|
||||
{reuseaddr, true},
|
||||
{nodelay, true},
|
||||
{send_timeout, ?TCP_SEND_TIMEOUT},
|
||||
{keepalive, true} |
|
||||
SockOpts]),
|
||||
case Res of
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 30 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -37,6 +37,7 @@
|
||||
register_iq_handler/5,
|
||||
register_iq_response_handler/4,
|
||||
unregister_iq_handler/2,
|
||||
unregister_iq_response_handler/2,
|
||||
refresh_iq_handlers/0,
|
||||
bounce_resource_packet/3
|
||||
]).
|
||||
@@ -138,6 +139,9 @@ register_iq_handler(Host, XMLNS, Module, Fun) ->
|
||||
register_iq_handler(Host, XMLNS, Module, Fun, Opts) ->
|
||||
ejabberd_local ! {register_iq_handler, Host, XMLNS, Module, Fun, Opts}.
|
||||
|
||||
unregister_iq_response_handler(Host, ID) ->
|
||||
ejabberd_local ! {unregister_iq_response_handler, Host, ID}.
|
||||
|
||||
unregister_iq_handler(Host, XMLNS) ->
|
||||
ejabberd_local ! {unregister_iq_handler, Host, XMLNS}.
|
||||
|
||||
@@ -214,6 +218,9 @@ handle_info({route, From, To, Packet}, State) ->
|
||||
handle_info({register_iq_response_handler, _Host, ID, Module, Function}, State) ->
|
||||
mnesia:dirty_write(#iq_response{id = ID, module = Module, function = Function}),
|
||||
{noreply, State};
|
||||
handle_info({unregister_iq_response_handler, _Host, ID}, State) ->
|
||||
mnesia:dirty_delete({iq_response, ID}),
|
||||
{noreply, State};
|
||||
handle_info({register_iq_handler, Host, XMLNS, Module, Function}, State) ->
|
||||
ets:insert(?IQTABLE, {{XMLNS, Host}, Module, Function}),
|
||||
catch mod_disco:register_feature(Host, XMLNS),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
%% gen_event callbacks
|
||||
-export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2,
|
||||
code_change/3, reopen_log/0]).
|
||||
code_change/3, reopen_log/0, rotate_log/1]).
|
||||
|
||||
-record(state, {fd, file}).
|
||||
|
||||
@@ -206,10 +206,11 @@ write_time({{Y,Mo,D},{H,Mi,S}}, Type) ->
|
||||
io_lib:format("~n=~s==== ~w-~.2.0w-~.2.0w ~.2.0w:~.2.0w:~.2.0w ===~n",
|
||||
[Type, Y, Mo, D, H, Mi, S]).
|
||||
|
||||
%% Rename the log file if it the filename exists
|
||||
%% @doc Rename the log file if exists, to "*-old.log".
|
||||
%% This is needed in systems when the file must be closed before rotation (Windows).
|
||||
%% On most Unix-like system, the file can be renamed from the command line and
|
||||
%%the log can directly be reopened.
|
||||
%% the log can directly be reopened.
|
||||
%% @spec (Filename::string()) -> ok
|
||||
rotate_log(Filename) ->
|
||||
case file:read_file_info(Filename) of
|
||||
{ok, _FileInfo} ->
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
%%% Created : 29 Nov 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -20,7 +20,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 1 Nov 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+12
-5
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -52,14 +52,21 @@ start_hosts() ->
|
||||
|
||||
%% Start the ODBC module on the given host
|
||||
start_odbc(Host) ->
|
||||
Supervisor_name = gen_mod:get_module_proc(Host, ejabberd_odbc_sup),
|
||||
ChildSpec =
|
||||
{gen_mod:get_module_proc(Host, ejabberd_odbc_sup),
|
||||
{Supervisor_name,
|
||||
{ejabberd_odbc_sup, start_link, [Host]},
|
||||
temporary,
|
||||
transient,
|
||||
infinity,
|
||||
supervisor,
|
||||
[ejabberd_odbc_sup]},
|
||||
supervisor:start_child(ejabberd_sup, ChildSpec).
|
||||
case supervisor:start_child(ejabberd_sup, ChildSpec) of
|
||||
{ok, _PID} ->
|
||||
ok;
|
||||
_Error ->
|
||||
?ERROR_MSG("Start of supervisor ~p failed:~n~p~nRetrying...~n", [Supervisor_name, _Error]),
|
||||
start_odbc(Host)
|
||||
end.
|
||||
|
||||
%% Returns true if we have configured odbc_server for the given host
|
||||
needs_odbc(Host) ->
|
||||
|
||||
+27
-16
@@ -5,7 +5,7 @@
|
||||
%%% Created : 10 Nov 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -54,6 +54,8 @@
|
||||
xml_stream_state,
|
||||
timeout}).
|
||||
|
||||
-define(HIBERNATE_TIMEOUT, 90000).
|
||||
|
||||
%%====================================================================
|
||||
%% API
|
||||
%%====================================================================
|
||||
@@ -146,7 +148,7 @@ handle_call({starttls, TLSSocket}, _From,
|
||||
xml_stream_state = NewXMLStreamState},
|
||||
case tls:recv_data(TLSSocket, "") of
|
||||
{ok, TLSData} ->
|
||||
{reply, ok, process_data(TLSData, NewState)};
|
||||
{reply, ok, process_data(TLSData, NewState), ?HIBERNATE_TIMEOUT};
|
||||
{error, _Reason} ->
|
||||
{stop, normal, ok, NewState}
|
||||
end;
|
||||
@@ -161,7 +163,7 @@ handle_call({compress, ZlibSocket}, _From,
|
||||
xml_stream_state = NewXMLStreamState},
|
||||
case ejabberd_zlib:recv_data(ZlibSocket, "") of
|
||||
{ok, ZlibData} ->
|
||||
{reply, ok, process_data(ZlibData, NewState)};
|
||||
{reply, ok, process_data(ZlibData, NewState), ?HIBERNATE_TIMEOUT};
|
||||
{error, _Reason} ->
|
||||
{stop, normal, ok, NewState}
|
||||
end;
|
||||
@@ -172,17 +174,18 @@ handle_call(reset_stream, _From,
|
||||
xml_stream:close(XMLStreamState),
|
||||
NewXMLStreamState = xml_stream:new(C2SPid, MaxStanzaSize),
|
||||
Reply = ok,
|
||||
{reply, Reply, State#state{xml_stream_state = NewXMLStreamState}};
|
||||
{reply, Reply, State#state{xml_stream_state = NewXMLStreamState},
|
||||
?HIBERNATE_TIMEOUT};
|
||||
handle_call({become_controller, C2SPid}, _From, State) ->
|
||||
XMLStreamState = xml_stream:new(C2SPid, State#state.max_stanza_size),
|
||||
NewState = State#state{c2s_pid = C2SPid,
|
||||
xml_stream_state = XMLStreamState},
|
||||
activate_socket(NewState),
|
||||
Reply = ok,
|
||||
{reply, Reply, NewState};
|
||||
{reply, Reply, NewState, ?HIBERNATE_TIMEOUT};
|
||||
handle_call(_Request, _From, State) ->
|
||||
Reply = ok,
|
||||
{reply, Reply, State}.
|
||||
{reply, Reply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: handle_cast(Msg, State) -> {noreply, State} |
|
||||
@@ -192,11 +195,11 @@ handle_call(_Request, _From, State) ->
|
||||
%%--------------------------------------------------------------------
|
||||
handle_cast({change_shaper, Shaper}, State) ->
|
||||
NewShaperState = shaper:new(Shaper),
|
||||
{noreply, State#state{shaper_state = NewShaperState}};
|
||||
{noreply, State#state{shaper_state = NewShaperState}, ?HIBERNATE_TIMEOUT};
|
||||
handle_cast(close, State) ->
|
||||
{stop, normal, State};
|
||||
handle_cast(_Msg, State) ->
|
||||
{noreply, State}.
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: handle_info(Info, State) -> {noreply, State} |
|
||||
@@ -212,19 +215,21 @@ handle_info({Tag, _TCPSocket, Data},
|
||||
tls ->
|
||||
case tls:recv_data(Socket, Data) of
|
||||
{ok, TLSData} ->
|
||||
{noreply, process_data(TLSData, State)};
|
||||
{noreply, process_data(TLSData, State),
|
||||
?HIBERNATE_TIMEOUT};
|
||||
{error, _Reason} ->
|
||||
{stop, normal, State}
|
||||
end;
|
||||
ejabberd_zlib ->
|
||||
case ejabberd_zlib:recv_data(Socket, Data) of
|
||||
{ok, ZlibData} ->
|
||||
{noreply, process_data(ZlibData, State)};
|
||||
{noreply, process_data(ZlibData, State),
|
||||
?HIBERNATE_TIMEOUT};
|
||||
{error, _Reason} ->
|
||||
{stop, normal, State}
|
||||
end;
|
||||
_ ->
|
||||
{noreply, process_data(Data, State)}
|
||||
{noreply, process_data(Data, State), ?HIBERNATE_TIMEOUT}
|
||||
end;
|
||||
handle_info({Tag, _TCPSocket}, State)
|
||||
when (Tag == tcp_closed) or (Tag == ssl_closed) ->
|
||||
@@ -233,15 +238,18 @@ handle_info({Tag, _TCPSocket, Reason}, State)
|
||||
when (Tag == tcp_error) or (Tag == ssl_error) ->
|
||||
case Reason of
|
||||
timeout ->
|
||||
{noreply, State};
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT};
|
||||
_ ->
|
||||
{stop, normal, State}
|
||||
end;
|
||||
handle_info({timeout, _Ref, activate}, State) ->
|
||||
activate_socket(State),
|
||||
{noreply, State};
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT};
|
||||
handle_info(timeout, State) ->
|
||||
proc_lib:hibernate(gen_server, enter_loop, [?MODULE, [], State]),
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT};
|
||||
handle_info(_Info, State) ->
|
||||
{noreply, State}.
|
||||
{noreply, State, ?HIBERNATE_TIMEOUT}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Function: terminate(Reason, State) -> void()
|
||||
@@ -293,11 +301,14 @@ activate_socket(#state{socket = Socket,
|
||||
|
||||
process_data(Data,
|
||||
#state{xml_stream_state = XMLStreamState,
|
||||
shaper_state = ShaperState} = State) ->
|
||||
shaper_state = ShaperState,
|
||||
c2s_pid = C2SPid} = State) ->
|
||||
?DEBUG("Received XML on stream = ~p", [binary_to_list(Data)]),
|
||||
XMLStreamState1 = xml_stream:parse(XMLStreamState, Data),
|
||||
{NewShaperState, Pause} = shaper:update(ShaperState, size(Data)),
|
||||
if
|
||||
C2SPid == undefined ->
|
||||
ok;
|
||||
Pause > 0 ->
|
||||
erlang:start_timer(Pause, self(), activate);
|
||||
true ->
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -150,9 +150,9 @@ unregister_route(Domain) ->
|
||||
mnesia:transaction(F);
|
||||
_ ->
|
||||
F = fun() ->
|
||||
case mnesia:match(#route{domain = LDomain,
|
||||
pid = Pid,
|
||||
_ = '_'}) of
|
||||
case mnesia:match_object(#route{domain=LDomain,
|
||||
pid = Pid,
|
||||
_ = '_'}) of
|
||||
[R] ->
|
||||
I = R#route.local_hint,
|
||||
mnesia:write(
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 7 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -52,7 +52,8 @@
|
||||
handle_info/3,
|
||||
terminate/3,
|
||||
code_change/4,
|
||||
test_get_addr_port/1]).
|
||||
test_get_addr_port/1,
|
||||
get_addr_port/1]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("jlib.hrl").
|
||||
@@ -92,7 +93,10 @@
|
||||
%% Only change this value if you now what your are doing:
|
||||
-define(FSMLIMITS,[]).
|
||||
%% -define(FSMLIMITS, [{max_queue, 2000}]).
|
||||
-define(FSMTIMEOUT, 5000).
|
||||
-define(FSMTIMEOUT, 30000).
|
||||
|
||||
%% We do not block on send anymore.
|
||||
-define(TCP_SEND_TIMEOUT, 15000).
|
||||
|
||||
%% Maximum delay to wait before retrying to connect after a failed attempt.
|
||||
%% Specified in miliseconds. Default value is 5 minutes.
|
||||
@@ -250,6 +254,7 @@ open_socket1(Addr, Port) ->
|
||||
catch ejabberd_socket:connect(
|
||||
Addr, Port,
|
||||
[binary, {packet, 0},
|
||||
{send_timeout, ?TCP_SEND_TIMEOUT},
|
||||
{active, false}, inet6]);
|
||||
{'EXIT', Reason1} ->
|
||||
?DEBUG("s2s_out: connect crashed ~p~n", [Reason1]),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% File : ejabberd_service.erl
|
||||
%%% Author : Alexey Shchepin <alexey@process-one.net>
|
||||
%%% Purpose : External component management
|
||||
%%% Purpose : External component management (XEP-0114)
|
||||
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -73,7 +73,8 @@
|
||||
-define(STREAM_TRAILER, "</stream:stream>").
|
||||
|
||||
-define(INVALID_HEADER_ERR,
|
||||
"<stream:stream>"
|
||||
"<stream:stream "
|
||||
"xmlns:stream='http://etherx.jabber.org/streams'>"
|
||||
"<stream:error>Invalid Stream Header</stream:error>"
|
||||
"</stream:stream>"
|
||||
).
|
||||
@@ -168,11 +169,15 @@ init([{SockMod, Socket}, Opts]) ->
|
||||
%%----------------------------------------------------------------------
|
||||
|
||||
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
|
||||
% TODO
|
||||
case xml:get_attr_s("xmlns", Attrs) of
|
||||
"jabber:component:accept" ->
|
||||
%% Note: XEP-0114 requires to check that destination is a Jabber
|
||||
%% component served by this Jabber server.
|
||||
%% However several transports don't respect that,
|
||||
%% so ejabberd doesn't check 'to' attribute (EJAB-717)
|
||||
To = xml:get_attr_s("to", Attrs),
|
||||
Header = io_lib:format(?STREAM_HEADER,
|
||||
[StateData#state.streamid, ?MYNAME]),
|
||||
[StateData#state.streamid, xml:crypt(To)]),
|
||||
send_text(StateData, Header),
|
||||
{next_state, wait_for_handshake, StateData};
|
||||
_ ->
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 24 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+20
-12
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -65,19 +65,27 @@ start(Module, SockMod, Socket, Opts) ->
|
||||
SocketData = #socket_state{sockmod = SockMod,
|
||||
socket = Socket,
|
||||
receiver = Receiver},
|
||||
{ok, Pid} = Module:start({?MODULE, SocketData}, Opts),
|
||||
case SockMod:controlling_process(Socket, Receiver) of
|
||||
ok ->
|
||||
ok;
|
||||
case Module:start({?MODULE, SocketData}, Opts) of
|
||||
{ok, Pid} ->
|
||||
case SockMod:controlling_process(Socket, Receiver) of
|
||||
ok ->
|
||||
ok;
|
||||
{error, _Reason} ->
|
||||
SockMod:close(Socket)
|
||||
end,
|
||||
ejabberd_receiver:become_controller(Receiver, Pid);
|
||||
{error, _Reason} ->
|
||||
SockMod:close(Socket)
|
||||
end,
|
||||
ejabberd_receiver:become_controller(Receiver, Pid);
|
||||
end;
|
||||
raw ->
|
||||
{ok, Pid} = Module:start({SockMod, Socket}, Opts),
|
||||
case SockMod:controlling_process(Socket, Pid) of
|
||||
ok ->
|
||||
ok;
|
||||
case Module:start({SockMod, Socket}, Opts) of
|
||||
{ok, Pid} ->
|
||||
case SockMod:controlling_process(Socket, Pid) of
|
||||
ok ->
|
||||
ok;
|
||||
{error, _Reason} ->
|
||||
SockMod:close(Socket)
|
||||
end;
|
||||
{error, _Reason} ->
|
||||
SockMod:close(Socket)
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 21 Mar 2007 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 18 Jul 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 27 Jan 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\ejabberd_zlib.beam
|
||||
|
||||
SOURCE = ejabberd_zlib_drv.c
|
||||
OBJECT = ejabberd_zlib_drv.o
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 19 Jan 2006 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
* ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -11,6 +11,7 @@ ERL_MAX_ETS_TABLES=1400
|
||||
NODE=ejabberd
|
||||
HOST=localhost
|
||||
ERLANG_NODE=$NODE@$HOST
|
||||
ERL=@erl@
|
||||
ROOTDIR=@rootdir@
|
||||
EJABBERD_CONFIG_PATH=$ROOTDIR/etc/ejabberd/ejabberd.cfg
|
||||
LOGS_DIR=$ROOTDIR/var/log/ejabberd/
|
||||
@@ -74,7 +75,7 @@ export HOME
|
||||
# start server
|
||||
start ()
|
||||
{
|
||||
erl \
|
||||
$ERL \
|
||||
$NAME $ERLANG_NODE \
|
||||
-noinput -detached \
|
||||
-pa $EJABBERD_EBIN \
|
||||
@@ -103,7 +104,7 @@ debug ()
|
||||
echo "Press any key to continue"
|
||||
read foo
|
||||
echo ""
|
||||
erl \
|
||||
$ERL \
|
||||
$NAME ${NODE}debug \
|
||||
-remsh $ERLANG_NODE \
|
||||
$ERLANG_OPTS $ARGS "$@"
|
||||
@@ -127,9 +128,8 @@ live ()
|
||||
echo "Press any key to continue"
|
||||
read foo
|
||||
echo ""
|
||||
erl \
|
||||
$ERL \
|
||||
$NAME $ERLANG_NODE \
|
||||
$ERLANG_OPTS \
|
||||
-pa $EJABBERD_EBIN \
|
||||
-mnesia dir "\"$EJABBERD_DB\"" \
|
||||
-s ejabberd \
|
||||
@@ -139,7 +139,7 @@ live ()
|
||||
# common control function
|
||||
ctl ()
|
||||
{
|
||||
erl \
|
||||
$ERL \
|
||||
$NAME ejabberdctl \
|
||||
-noinput \
|
||||
-pa $EJABBERD_EBIN \
|
||||
@@ -159,6 +159,7 @@ ctl ()
|
||||
echo " --ctl-config file Config file of ejabberdctl: $CONFIG"
|
||||
echo " --logs dir Directory for logs: $LOGS_DIR"
|
||||
echo " --spool dir Database spool dir: $EJABBERD_DB"
|
||||
echo " --node nodename ejabberd node name: $ERLANG_NODE"
|
||||
echo "";;
|
||||
esac
|
||||
return $result
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 22 Aug 2005 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -22,6 +22,8 @@ BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
|
||||
all: $(BEAMS) ELDAPv3.beam
|
||||
|
||||
ELDAPv3.beam: ELDAPv3.erl
|
||||
|
||||
ELDAPv3.erl: ELDAPv3.asn
|
||||
@ERLC@ -bber_bin -W $(EFLAGS) $<
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\eldap.beam ..\eldap_filter.beam ..\eldap_pool.beam ..\eldap_utils.beam
|
||||
|
||||
ALL : $(BEAMS)
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%%% Author: Evgeniy Khramtsov <xramtsov@gmail.com>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -17,7 +17,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Nov 2006 by Evgeniy Khramtsov <xram@jabber.ru>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 12 Oct 2006 by Mickael Remond <mremond@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 30 Jul 2004 by Leif Johansson <leifj@it.su.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 22 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+25
-10
@@ -5,7 +5,7 @@
|
||||
%%% Created : 24 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -30,6 +30,7 @@
|
||||
-export([start/0,
|
||||
start_module/3,
|
||||
stop_module/2,
|
||||
stop_module_keep_config/2,
|
||||
get_opt/2,
|
||||
get_opt/3,
|
||||
get_opt_host/3,
|
||||
@@ -61,33 +62,47 @@ start() ->
|
||||
|
||||
|
||||
start_module(Host, Module, Opts) ->
|
||||
set_module_opts_mnesia(Host, Module, Opts),
|
||||
ets:insert(ejabberd_modules,
|
||||
#ejabberd_module{module_host = {Module, Host},
|
||||
opts = Opts}),
|
||||
case catch Module:start(Host, Opts) of
|
||||
{'EXIT', Reason} ->
|
||||
del_module_mnesia(Host, Module),
|
||||
ets:delete(ejabberd_modules, {Module, Host}),
|
||||
?ERROR_MSG("~p", [Reason]);
|
||||
_ ->
|
||||
set_module_opts_mnesia(Host, Module, Opts),
|
||||
ets:insert(ejabberd_modules,
|
||||
#ejabberd_module{module_host = {Module, Host},
|
||||
opts = Opts}),
|
||||
ok
|
||||
end.
|
||||
|
||||
%% @doc Stop the module in a host, and forget its configuration.
|
||||
stop_module(Host, Module) ->
|
||||
case stop_module_keep_config(Host, Module) of
|
||||
error ->
|
||||
error;
|
||||
ok ->
|
||||
del_module_mnesia(Host, Module)
|
||||
end.
|
||||
|
||||
%% @doc Stop the module in a host, but keep its configuration.
|
||||
%% As the module configuration is kept in the Mnesia local_config table,
|
||||
%% when ejabberd is restarted the module will be started again.
|
||||
%% This function is useful when ejabberd is being stopped
|
||||
%% and it stops all modules.
|
||||
stop_module_keep_config(Host, Module) ->
|
||||
case catch Module:stop(Host) of
|
||||
{'EXIT', Reason} ->
|
||||
?ERROR_MSG("~p", [Reason]);
|
||||
?ERROR_MSG("~p", [Reason]),
|
||||
error;
|
||||
{wait, ProcList} when is_list(ProcList) ->
|
||||
lists:foreach(fun wait_for_process/1, ProcList),
|
||||
del_module_mnesia(Host, Module),
|
||||
ets:delete(ejabberd_modules, {Module, Host}),
|
||||
ok;
|
||||
{wait, Process} ->
|
||||
wait_for_process(Process),
|
||||
del_module_mnesia(Host, Module),
|
||||
ets:delete(ejabberd_modules, {Module, Host}),
|
||||
ok;
|
||||
_ ->
|
||||
del_module_mnesia(Host, Module),
|
||||
ets:delete(ejabberd_modules, {Module, Host}),
|
||||
ok
|
||||
end.
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 10 Apr 2004 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 2 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+19
-3
@@ -5,7 +5,7 @@
|
||||
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -34,6 +34,8 @@
|
||||
make_correct_from_to_attrs/3,
|
||||
replace_from_to_attrs/3,
|
||||
replace_from_to/3,
|
||||
replace_from_attrs/2,
|
||||
replace_from/2,
|
||||
remove_attr/2,
|
||||
make_jid/3,
|
||||
make_jid/1,
|
||||
@@ -59,7 +61,8 @@
|
||||
now_to_local_string/1,
|
||||
datetime_string_to_timestamp/1,
|
||||
decode_base64/1,
|
||||
encode_base64/1]).
|
||||
encode_base64/1,
|
||||
ip_to_list/1]).
|
||||
|
||||
-include("jlib.hrl").
|
||||
|
||||
@@ -152,6 +155,13 @@ replace_from_to(From, To, {xmlelement, Name, Attrs, Els}) ->
|
||||
Attrs),
|
||||
{xmlelement, Name, NewAttrs, Els}.
|
||||
|
||||
replace_from_attrs(From, Attrs) ->
|
||||
Attrs1 = lists:keydelete("from", 1, Attrs),
|
||||
[{"from", From} | Attrs1].
|
||||
|
||||
replace_from(From, {xmlelement, Name, Attrs, Els}) ->
|
||||
NewAttrs = replace_from_attrs(jlib:jid_to_string(From), Attrs),
|
||||
{xmlelement, Name, NewAttrs, Els}.
|
||||
|
||||
remove_attr(Attr, {xmlelement, Name, Attrs, Els}) ->
|
||||
NewAttrs = lists:keydelete(Attr, 1, Attrs),
|
||||
@@ -676,3 +686,9 @@ e(X) when X>51, X<62 -> X-4;
|
||||
e(62) -> $+;
|
||||
e(63) -> $/;
|
||||
e(X) -> exit({bad_encode_base64_token, X}).
|
||||
|
||||
%% Convert Erlang inet IP to list
|
||||
ip_to_list({IP, _Port}) ->
|
||||
ip_to_list(IP);
|
||||
ip_to_list({A,B,C,D}) ->
|
||||
lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D])).
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -11,7 +11,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 15 Nov 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 11 Aug 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+76
-11
@@ -5,7 +5,7 @@
|
||||
%%% Created : 7 Oct 2006 by Magnus Henoch <henoch@dtek.chalmers.se>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -31,8 +31,11 @@
|
||||
-behaviour(gen_mod).
|
||||
|
||||
-export([read_caps/1,
|
||||
get_caps/1,
|
||||
note_caps/3,
|
||||
clear_caps/1,
|
||||
get_features/2,
|
||||
get_user_resource/2,
|
||||
handle_disco_response/3]).
|
||||
|
||||
%% gen_mod callbacks
|
||||
@@ -53,9 +56,12 @@
|
||||
|
||||
-define(PROCNAME, ejabberd_mod_caps).
|
||||
-define(DICT, dict).
|
||||
-define(CAPS_QUERY_TIMEOUT, 60000). % 1mn without answer, consider client never answer
|
||||
|
||||
-record(caps, {node, version, exts}).
|
||||
-record(caps_features, {node_pair, features}).
|
||||
-record(user_caps, {jid, caps}).
|
||||
-record(user_caps_default, {uid, resource}).
|
||||
-record(state, {host,
|
||||
disco_requests = ?DICT:new(),
|
||||
feature_queries = []}).
|
||||
@@ -88,12 +94,45 @@ read_caps([_ | Tail], Result) ->
|
||||
read_caps([], Result) ->
|
||||
Result.
|
||||
|
||||
%% get_caps reads user caps from database
|
||||
get_caps(JID) ->
|
||||
case catch mnesia:dirty_read({user_caps, list_to_binary(jlib:jid_to_string(JID))}) of
|
||||
[#user_caps{caps=Caps}] ->
|
||||
Caps;
|
||||
_ ->
|
||||
nothing
|
||||
end.
|
||||
|
||||
%% clear_caps removes user caps from database
|
||||
clear_caps(JID) ->
|
||||
{U, S, R} = jlib:jid_tolower(JID),
|
||||
BJID = list_to_binary(jlib:jid_to_string(JID)),
|
||||
BUID = list_to_binary(jlib:jid_to_string({U, S, []})),
|
||||
catch mnesia:dirty_delete({user_caps, BJID}),
|
||||
case catch mnesia:dirty_read({user_caps_default, BUID}) of
|
||||
[#user_caps_default{resource=R}] ->
|
||||
catch mnesia:dirty_delete({user_caps_default, BUID});
|
||||
_ ->
|
||||
ok
|
||||
end.
|
||||
|
||||
%% give default user resource
|
||||
get_user_resource(LUser, LServer) ->
|
||||
BUID = list_to_binary(jlib:jid_to_string({LUser, LServer, []})),
|
||||
case catch mnesia:dirty_read({user_caps_default, BUID}) of
|
||||
[#user_caps_default{resource=R}] ->
|
||||
R;
|
||||
_ ->
|
||||
[]
|
||||
end.
|
||||
|
||||
%% note_caps should be called to make the module request disco
|
||||
%% information. Host is the host that asks, From is the full JID that
|
||||
%% sent the caps packet, and Caps is what read_caps returned.
|
||||
note_caps(Host, From, Caps) ->
|
||||
case Caps of
|
||||
nothing -> ok;
|
||||
nothing ->
|
||||
ok;
|
||||
_ ->
|
||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||
gen_server:cast(Proc, {note_caps, From, Caps})
|
||||
@@ -104,7 +143,8 @@ note_caps(Host, From, Caps) ->
|
||||
%% timeout error.
|
||||
get_features(Host, Caps) ->
|
||||
case Caps of
|
||||
nothing -> [];
|
||||
nothing ->
|
||||
[];
|
||||
#caps{} ->
|
||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||
gen_server:call(Proc, {get_features, Caps})
|
||||
@@ -137,7 +177,12 @@ init([Host, _Opts]) ->
|
||||
mnesia:create_table(caps_features,
|
||||
[{ram_copies, [node()]},
|
||||
{attributes, record_info(fields, caps_features)}]),
|
||||
mnesia:add_table_copy(caps_features, node(), ram_copies),
|
||||
mnesia:create_table(user_caps,
|
||||
[{disc_copies, [node()]},
|
||||
{attributes, record_info(fields, user_caps)}]),
|
||||
mnesia:create_table(user_caps_default,
|
||||
[{disc_copies, [node()]},
|
||||
{attributes, record_info(fields, user_caps_default)}]),
|
||||
{ok, #state{host = Host}}.
|
||||
|
||||
maybe_get_features(#caps{node = Node, version = Version, exts = Exts}) ->
|
||||
@@ -185,10 +230,21 @@ handle_call(stop, _From, State) ->
|
||||
{stop, normal, ok, State}.
|
||||
|
||||
handle_cast({note_caps, From,
|
||||
#caps{node = Node, version = Version, exts = Exts}},
|
||||
#caps{node = Node, version = Version, exts = Exts} = Caps},
|
||||
#state{host = Host, disco_requests = Requests} = State) ->
|
||||
%% XXX: this leads to race conditions where ejabberd will send
|
||||
%% lots of caps disco requests.
|
||||
{U, S, R} = jlib:jid_tolower(From),
|
||||
BJID = list_to_binary(jlib:jid_to_string(From)),
|
||||
mnesia:dirty_write(#user_caps{jid = BJID, caps = Caps}),
|
||||
case ejabberd_sm:get_user_resources(U, S) of
|
||||
[] ->
|
||||
ok;
|
||||
_ ->
|
||||
% only store default resource of external contacts
|
||||
BUID = list_to_binary(jlib:jid_to_string(jlib:jid_remove_resource(From))),
|
||||
mnesia:dirty_write(#user_caps_default{uid = BUID, resource = R})
|
||||
end,
|
||||
SubNodes = [Version | Exts],
|
||||
%% Now, find which of these are not already in the database.
|
||||
Fun = fun() ->
|
||||
@@ -203,11 +259,9 @@ handle_cast({note_caps, From,
|
||||
end,
|
||||
case mnesia:transaction(Fun) of
|
||||
{atomic, Missing} ->
|
||||
%% For each unknown caps "subnode", we send a disco
|
||||
%% request.
|
||||
NewRequests =
|
||||
lists:foldl(
|
||||
fun(SubNode, Dict) ->
|
||||
%% For each unknown caps "subnode", we send a disco request.
|
||||
NewRequests = lists:foldl(
|
||||
fun(SubNode, Dict) ->
|
||||
ID = randoms:get_string(),
|
||||
Stanza =
|
||||
{xmlelement, "iq",
|
||||
@@ -220,6 +274,7 @@ handle_cast({note_caps, From,
|
||||
ejabberd_local:register_iq_response_handler
|
||||
(Host, ID, ?MODULE, handle_disco_response),
|
||||
ejabberd_router:route(jlib:make_jid("", Host, ""), From, Stanza),
|
||||
timer:send_after(?CAPS_QUERY_TIMEOUT, self(), {disco_timeout, ID}),
|
||||
?DICT:store(ID, {Node, SubNode}, Dict)
|
||||
end, Requests, Missing),
|
||||
{noreply, State#state{disco_requests = NewRequests}};
|
||||
@@ -274,6 +329,16 @@ handle_cast({disco_response, From, _To,
|
||||
end,
|
||||
NewRequests = ?DICT:erase(ID, Requests),
|
||||
{noreply, State#state{disco_requests = NewRequests}};
|
||||
handle_cast({disco_timeout, ID}, #state{host = Host, disco_requests = Requests} = State) ->
|
||||
%% do not wait a response anymore for this IQ, client certainly will never answer
|
||||
NewRequests = case ?DICT:is_key(ID, Requests) of
|
||||
true ->
|
||||
ejabberd_local:unregister_iq_response_handler(Host, ID),
|
||||
?DICT:erase(ID, Requests);
|
||||
false ->
|
||||
Requests
|
||||
end,
|
||||
{noreply, State#state{disco_requests = NewRequests}};
|
||||
handle_cast(visit_feature_queries, #state{feature_queries = FeatureQueries} = State) ->
|
||||
Timestamp = timestamp(),
|
||||
NewFeatureQueries =
|
||||
|
||||
+62
-38
@@ -5,7 +5,7 @@
|
||||
%%% Created : 19 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -307,8 +307,10 @@ adhoc_local_items(Acc, From, #jid{lserver = LServer, server = Server} = To,
|
||||
{result, Its} -> Its;
|
||||
empty -> []
|
||||
end,
|
||||
PermLev = get_permission_level(From),
|
||||
%% Recursively get all configure commands
|
||||
Nodes = recursively_get_local_items(LServer, "", Server, Lang),
|
||||
Nodes = recursively_get_local_items(PermLev, LServer, "", Server,
|
||||
Lang),
|
||||
Nodes1 = lists:filter(
|
||||
fun(N) ->
|
||||
Nd = xml:get_tag_attr_s("node", N),
|
||||
@@ -325,15 +327,15 @@ adhoc_local_items(Acc, From, #jid{lserver = LServer, server = Server} = To,
|
||||
Acc
|
||||
end.
|
||||
|
||||
recursively_get_local_items(_LServer, "online users", _Server, _Lang) ->
|
||||
recursively_get_local_items(_PermLev, _LServer, "online users", _Server, _Lang) ->
|
||||
[];
|
||||
|
||||
recursively_get_local_items(_LServer, "all users", _Server, _Lang) ->
|
||||
recursively_get_local_items(_PermLev, _LServer, "all users", _Server, _Lang) ->
|
||||
[];
|
||||
|
||||
recursively_get_local_items(LServer, Node, Server, Lang) ->
|
||||
recursively_get_local_items(PermLev, LServer, Node, Server, Lang) ->
|
||||
LNode = tokenize(Node),
|
||||
Items = case get_local_items(LServer, LNode, Server, Lang) of
|
||||
Items = case get_local_items({PermLev, LServer}, LNode, Server, Lang) of
|
||||
{result, Res} ->
|
||||
Res;
|
||||
{error, _Error} ->
|
||||
@@ -348,11 +350,17 @@ recursively_get_local_items(LServer, Node, Server, Lang) ->
|
||||
[];
|
||||
true ->
|
||||
[N, recursively_get_local_items(
|
||||
LServer, Nd, Server, Lang)]
|
||||
PermLev, LServer, Nd, Server, Lang)]
|
||||
end
|
||||
end, Items)),
|
||||
Nodes.
|
||||
|
||||
get_permission_level(JID) ->
|
||||
case acl:match_rule(global, configure, JID) of
|
||||
allow -> global;
|
||||
deny -> vhost
|
||||
end.
|
||||
|
||||
%%%-----------------------------------------------------------------------
|
||||
|
||||
-define(ITEMS_RESULT(Allow, LNode, Fallback),
|
||||
@@ -360,7 +368,8 @@ recursively_get_local_items(LServer, Node, Server, Lang) ->
|
||||
deny ->
|
||||
Fallback;
|
||||
allow ->
|
||||
case get_local_items(LServer, LNode,
|
||||
PermLev = get_permission_level(From),
|
||||
case get_local_items({PermLev, LServer}, LNode,
|
||||
jlib:jid_to_string(To), Lang) of
|
||||
{result, Res} ->
|
||||
{result, Res};
|
||||
@@ -383,7 +392,8 @@ get_local_items(Acc, From, #jid{lserver = LServer} = To, "", Lang) ->
|
||||
deny ->
|
||||
{result, Items};
|
||||
allow ->
|
||||
case get_local_items(LServer, [],
|
||||
PermLev = get_permission_level(From),
|
||||
case get_local_items({PermLev, LServer}, [],
|
||||
jlib:jid_to_string(To), Lang) of
|
||||
{result, Res} ->
|
||||
{result, Items ++ Res};
|
||||
@@ -448,6 +458,9 @@ get_local_items(Acc, From, #jid{lserver = LServer} = To, Node, Lang) ->
|
||||
|
||||
%%%-----------------------------------------------------------------------
|
||||
|
||||
%% @spec ({PermissionLevel, Host}, [string()], Server::string(), Lang)
|
||||
%% -> {result, [xmlelement()]}
|
||||
%% PermissionLevel = global | vhost
|
||||
get_local_items(_Host, [], Server, Lang) ->
|
||||
{result,
|
||||
[?NODE("Configuration", "config"),
|
||||
@@ -484,13 +497,13 @@ get_local_items(_Host, ["user"], Server, Lang) ->
|
||||
get_local_items(_Host, ["http:" | _], _Server, _Lang) ->
|
||||
{result, []};
|
||||
|
||||
get_local_items(Host, ["online users"], _Server, _Lang) ->
|
||||
get_local_items({_, Host}, ["online users"], _Server, _Lang) ->
|
||||
{result, get_online_vh_users(Host)};
|
||||
|
||||
get_local_items(Host, ["all users"], _Server, _Lang) ->
|
||||
get_local_items({_, Host}, ["all users"], _Server, _Lang) ->
|
||||
{result, get_all_vh_users(Host)};
|
||||
|
||||
get_local_items(Host, ["all users", [$@ | Diap]], _Server, _Lang) ->
|
||||
get_local_items({_, Host}, ["all users", [$@ | Diap]], _Server, _Lang) ->
|
||||
case catch ejabberd_auth:get_vh_registered_users(Host) of
|
||||
{'EXIT', _Reason} ->
|
||||
?ERR_INTERNAL_SERVER_ERROR;
|
||||
@@ -514,10 +527,10 @@ get_local_items(Host, ["all users", [$@ | Diap]], _Server, _Lang) ->
|
||||
end
|
||||
end;
|
||||
|
||||
get_local_items(Host, ["outgoing s2s"], _Server, Lang) ->
|
||||
get_local_items({_, Host}, ["outgoing s2s"], _Server, Lang) ->
|
||||
{result, get_outgoing_s2s(Host, Lang)};
|
||||
|
||||
get_local_items(Host, ["outgoing s2s", To], _Server, Lang) ->
|
||||
get_local_items({_, Host}, ["outgoing s2s", To], _Server, Lang) ->
|
||||
{result, get_outgoing_s2s(Host, Lang, To)};
|
||||
|
||||
get_local_items(_Host, ["running nodes"], Server, Lang) ->
|
||||
@@ -526,7 +539,7 @@ get_local_items(_Host, ["running nodes"], Server, Lang) ->
|
||||
get_local_items(_Host, ["stopped nodes"], _Server, Lang) ->
|
||||
{result, get_stopped_nodes(Lang)};
|
||||
|
||||
get_local_items(_Host, ["running nodes", ENode], Server, Lang) ->
|
||||
get_local_items({global, _Host}, ["running nodes", ENode], Server, Lang) ->
|
||||
{result,
|
||||
[?NODE("Database", "running nodes/" ++ ENode ++ "/DB"),
|
||||
?NODE("Modules", "running nodes/" ++ ENode ++ "/modules"),
|
||||
@@ -537,6 +550,11 @@ get_local_items(_Host, ["running nodes", ENode], Server, Lang) ->
|
||||
?NODE("Shut Down Service", "running nodes/" ++ ENode ++ "/shutdown")
|
||||
]};
|
||||
|
||||
get_local_items({vhost, _Host}, ["running nodes", ENode], Server, Lang) ->
|
||||
{result,
|
||||
[?NODE("Modules", "running nodes/" ++ ENode ++ "/modules")
|
||||
]};
|
||||
|
||||
get_local_items(_Host, ["running nodes", _ENode, "DB"], _Server, _Lang) ->
|
||||
{result, []};
|
||||
|
||||
@@ -708,8 +726,8 @@ get_stopped_nodes(_Lang) ->
|
||||
|
||||
%%-------------------------------------------------------------------------
|
||||
|
||||
-define(COMMANDS_RESULT(Allow, From, To, Request),
|
||||
case Allow of
|
||||
-define(COMMANDS_RESULT(LServerOrGlobal, From, To, Request),
|
||||
case acl:match_rule(LServerOrGlobal, configure, From) of
|
||||
deny ->
|
||||
{error, ?ERR_FORBIDDEN};
|
||||
allow ->
|
||||
@@ -719,24 +737,23 @@ get_stopped_nodes(_Lang) ->
|
||||
adhoc_local_commands(Acc, From, #jid{lserver = LServer} = To,
|
||||
#adhoc_request{node = Node} = Request) ->
|
||||
LNode = tokenize(Node),
|
||||
Allow = acl:match_rule(LServer, configure, From),
|
||||
case LNode of
|
||||
["running nodes", _ENode, "DB"] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(global, From, To, Request);
|
||||
["running nodes", _ENode, "modules", _] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(LServer, From, To, Request);
|
||||
["running nodes", _ENode, "backup", _] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(global, From, To, Request);
|
||||
["running nodes", _ENode, "import", _] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(global, From, To, Request);
|
||||
["running nodes", _ENode, "restart"] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(global, From, To, Request);
|
||||
["running nodes", _ENode, "shutdown"] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(global, From, To, Request);
|
||||
["config", _] ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(LServer, From, To, Request);
|
||||
?NS_ADMINL(_) ->
|
||||
?COMMANDS_RESULT(Allow, From, To, Request);
|
||||
?COMMANDS_RESULT(LServer, From, To, Request);
|
||||
_ ->
|
||||
Acc
|
||||
end.
|
||||
@@ -1248,7 +1265,7 @@ get_form(Host, ?NS_ADMINL("get-registered-users-num"), Lang) ->
|
||||
[?HFIELD(),
|
||||
{xmlelement,
|
||||
"field",
|
||||
[{"type", "jid-single"},
|
||||
[{"type", "text-single"},
|
||||
{"label", ?T(Lang, "Number of registered users")},
|
||||
{"var", "registeredusersnum"}],
|
||||
[{xmlelement, "value", [], [{xmlcdata, Num}]}]
|
||||
@@ -1262,7 +1279,7 @@ get_form(Host, ?NS_ADMINL("get-online-users-num"), Lang) ->
|
||||
[?HFIELD(),
|
||||
{xmlelement,
|
||||
"field",
|
||||
[{"type", "jid-single"},
|
||||
[{"type", "text-single"},
|
||||
{"label", ?T(Lang, "Number of online users")},
|
||||
{"var", "onlineusersnum"}],
|
||||
[{xmlelement, "value", [], [{xmlcdata, Num}]}]
|
||||
@@ -1416,7 +1433,7 @@ set_form(_From, _Host, ["running nodes", ENode, "backup", "textfile"], _Lang, XD
|
||||
false ->
|
||||
{error, ?ERR_BAD_REQUEST};
|
||||
{value, {_, [String]}} ->
|
||||
case rpc:call(Node, mnesia, dump_to_textfile, [String]) of
|
||||
case rpc:call(Node, ejabberd_ctl, dump_to_textfile, [String]) of
|
||||
{badrpc, _Reason} ->
|
||||
{error, ?ERR_INTERNAL_SERVER_ERROR};
|
||||
{error, _Reason} ->
|
||||
@@ -1540,7 +1557,7 @@ set_form(_From, Host, ["config", "access"], _Lang, XData) ->
|
||||
{error, ?ERR_BAD_REQUEST}
|
||||
end;
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("add-user"), _Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("add-user"), _Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
Password = get_value("password", XData),
|
||||
Password = get_value("password-verify", XData),
|
||||
@@ -1548,10 +1565,11 @@ set_form(_From, _Host, ?NS_ADMINL("add-user"), _Lang, XData) ->
|
||||
User = AccountJID#jid.luser,
|
||||
Server = AccountJID#jid.lserver,
|
||||
true = lists:member(Server, ?MYHOSTS),
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
ejabberd_auth:try_register(User, Server, Password),
|
||||
{result, []};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("delete-user"), _Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("delete-user"), _Lang, XData) ->
|
||||
AccountStringList = get_values("accountjids", XData),
|
||||
[_|_] = AccountStringList,
|
||||
ASL2 = lists:map(
|
||||
@@ -1559,7 +1577,8 @@ set_form(_From, _Host, ?NS_ADMINL("delete-user"), _Lang, XData) ->
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
User = JID#jid.luser,
|
||||
Server = JID#jid.lserver,
|
||||
Server = JID#jid.lserver,
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
true = ejabberd_auth:is_user_exists(User, Server),
|
||||
{User, Server}
|
||||
end,
|
||||
@@ -1567,12 +1586,13 @@ set_form(_From, _Host, ?NS_ADMINL("delete-user"), _Lang, XData) ->
|
||||
[ejabberd_auth:remove_user(User, Server) || {User, Server} <- ASL2],
|
||||
{result, []};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("end-user-session"), _Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("end-user-session"), _Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
LUser = JID#jid.luser,
|
||||
LServer = JID#jid.lserver,
|
||||
true = (LServer == Host) orelse (get_permission_level(From) == global),
|
||||
%% Code copied from ejabberd_sm.erl
|
||||
case JID#jid.lresource of
|
||||
[] ->
|
||||
@@ -1586,12 +1606,13 @@ set_form(_From, _Host, ?NS_ADMINL("end-user-session"), _Lang, XData) ->
|
||||
end,
|
||||
{result, []};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("get-user-password"), Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("get-user-password"), Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
User = JID#jid.luser,
|
||||
Server = JID#jid.lserver,
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
Password = ejabberd_auth:get_password(User, Server),
|
||||
true = is_list(Password),
|
||||
{result, [{xmlelement, "x", [{"xmlns", ?NS_XDATA}],
|
||||
@@ -1600,23 +1621,25 @@ set_form(_From, _Host, ?NS_ADMINL("get-user-password"), Lang, XData) ->
|
||||
?XFIELD("text-single", "Password", "password", Password)
|
||||
]}]};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("change-user-password"), _Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("change-user-password"), _Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
Password = get_value("password", XData),
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
User = JID#jid.luser,
|
||||
Server = JID#jid.lserver,
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
true = ejabberd_auth:is_user_exists(User, Server),
|
||||
ejabberd_auth:set_password(User, Server, Password),
|
||||
{result, []};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
User = JID#jid.luser,
|
||||
Server = JID#jid.lserver,
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
|
||||
%% Code copied from web/ejabberd_web_admin.erl
|
||||
%% TODO: Update time format to XEP-0202: Entity Time
|
||||
@@ -1648,12 +1671,13 @@ set_form(_From, _Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) ->
|
||||
?XFIELD("text-single", "Last login", "lastlogin", FLast)
|
||||
]}]};
|
||||
|
||||
set_form(_From, _Host, ?NS_ADMINL("user-stats"), Lang, XData) ->
|
||||
set_form(From, Host, ?NS_ADMINL("user-stats"), Lang, XData) ->
|
||||
AccountString = get_value("accountjid", XData),
|
||||
JID = jlib:string_to_jid(AccountString),
|
||||
[_|_] = JID#jid.luser,
|
||||
User = JID#jid.luser,
|
||||
Server = JID#jid.lserver,
|
||||
true = (Server == Host) orelse (get_permission_level(From) == global),
|
||||
|
||||
Resources = ejabberd_sm:get_user_resources(User, Server),
|
||||
IPs1 = [ejabberd_sm:get_user_ip(User, Server, Resource) || Resource <- Resources],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 26 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 1 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 15 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% File : mod_ip_blacklist.erl
|
||||
%%% Author : Mickael Remond <mremond@process-one.net>
|
||||
%%% Purpose : Download blacklists from ProcessOne
|
||||
%%% Created : 5 May 2008 by Mickael Remond <mremond@process-one.net>
|
||||
%%% Usage : Add the following line in modules section of ejabberd.cfg:
|
||||
%%% {mod_ip_blacklist, []}
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
%%% published by the Free Software Foundation; either version 2 of the
|
||||
%%% License, or (at your option) any later version.
|
||||
%%%
|
||||
%%% This program is distributed in the hope that it will be useful,
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
%%% 02111-1307 USA
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
|
||||
-module(mod_ip_blacklist).
|
||||
-author('mremond@process-one.net').
|
||||
|
||||
-behaviour(gen_mod).
|
||||
|
||||
%% API:
|
||||
-export([start/2,
|
||||
init/1,
|
||||
stop/1]).
|
||||
-export([update_bl_c2s/0]).
|
||||
%% Hooks:
|
||||
-export([is_ip_in_c2s_blacklist/2]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
|
||||
-define(PROCNAME, ?MODULE).
|
||||
-define(BLC2S, "http://xaai.process-one.net/bl_c2s.txt").
|
||||
-define(UPDATE_INTERVAL, 6). %% in hours
|
||||
|
||||
-record(state, {timer}).
|
||||
-record(bl_c2s, {ip}).
|
||||
|
||||
%% Start once for all vhost
|
||||
start(Host, Opts) ->
|
||||
case whereis(?PROCNAME) of
|
||||
undefined ->
|
||||
?DEBUG("Starting mod_ip_blacklist ~p ~p~n", [Host, Opts]),
|
||||
register(?PROCNAME,
|
||||
spawn(?MODULE, init, [#state{}]));
|
||||
_ ->
|
||||
ok
|
||||
end.
|
||||
|
||||
%% TODO:
|
||||
stop(_Host) ->
|
||||
ok.
|
||||
|
||||
init(State)->
|
||||
inets:start(),
|
||||
ets:new(bl_c2s, [named_table, public, {keypos, #bl_c2s.ip}]),
|
||||
update_bl_c2s(),
|
||||
%% Register hooks for blacklist
|
||||
ejabberd_hooks:add(check_bl_c2s, ?MODULE, is_ip_in_c2s_blacklist, 50),
|
||||
%% Set timer: Download the blacklist file every 6 hours
|
||||
timer:apply_interval(timer:hours(?UPDATE_INTERVAL), ?MODULE, update_bl_c2s, []),
|
||||
loop(State).
|
||||
|
||||
%% Remove timer when stop is received.
|
||||
loop(_State) ->
|
||||
receive
|
||||
stop ->
|
||||
ok
|
||||
end.
|
||||
|
||||
%% Download blacklist file from ProcessOne XAAI
|
||||
%% and update the table internal table
|
||||
%% TODO: Support comment lines starting by %
|
||||
update_bl_c2s() ->
|
||||
?INFO_MSG("Updating C2S Blacklist", []),
|
||||
case http:request(?BLC2S) of
|
||||
{ok, {{_Version, 200, _Reason}, _Headers, Body}} ->
|
||||
IPs = string:tokens(Body,"\n"),
|
||||
ets:delete_all_objects(bl_c2s),
|
||||
lists:foreach(
|
||||
fun(IP) ->
|
||||
ets:insert(bl_c2s, #bl_c2s{ip=list_to_binary(IP)})
|
||||
end, IPs);
|
||||
{error, Reason} ->
|
||||
?ERROR_MSG("Cannot download C2S blacklist file. Reason: ~p",
|
||||
[Reason])
|
||||
end.
|
||||
|
||||
%% Hook is run with:
|
||||
%% ejabberd_hooks:run_fold(check_bl_c2s, false, [IP]),
|
||||
%% Return: false: IP not blacklisted
|
||||
%% true: IP is blacklisted
|
||||
%% IPV4 IP tuple:
|
||||
is_ip_in_c2s_blacklist(_Val, IP) when is_tuple(IP) ->
|
||||
BinaryIP = list_to_binary(jlib:ip_to_list(IP)),
|
||||
case ets:lookup(bl_c2s, BinaryIP) of
|
||||
[] -> %% Not in blacklist
|
||||
false;
|
||||
[_] -> %% Blacklisted!
|
||||
{stop, true}
|
||||
end;
|
||||
is_ip_in_c2s_blacklist(_Val, _IP) ->
|
||||
false.
|
||||
|
||||
%% TODO:
|
||||
%% - For now, we do not kick user already logged on a given IP after
|
||||
%% we update the blacklist.
|
||||
@@ -4,8 +4,7 @@ include ..\Makefile.inc
|
||||
EFLAGS = -I .. -pz ..
|
||||
|
||||
OUTDIR = ..
|
||||
SOURCES = $(wildcard *.erl)
|
||||
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
||||
BEAMS = ..\iconv.beam ..\mod_irc.beam ..\mod_irc_connection.beam
|
||||
|
||||
SOURCE = iconv_erl.c
|
||||
OBJECT = iconv_erl.o
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 16 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
* ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 15 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -309,12 +309,10 @@ iq_disco(Lang) ->
|
||||
[{"category", "conference"},
|
||||
{"type", "irc"},
|
||||
{"name", translate:translate(Lang, "IRC Transport")}], []},
|
||||
{xmlelement, "feature",
|
||||
[{"var", ?NS_MUC}], []},
|
||||
{xmlelement, "feature",
|
||||
[{"var", ?NS_REGISTER}], []},
|
||||
{xmlelement, "feature",
|
||||
[{"var", ?NS_VCARD}], []}].
|
||||
{xmlelement, "feature", [{"var", ?NS_DISCO_INFO}], []},
|
||||
{xmlelement, "feature", [{"var", ?NS_MUC}], []},
|
||||
{xmlelement, "feature", [{"var", ?NS_REGISTER}], []},
|
||||
{xmlelement, "feature", [{"var", ?NS_VCARD}], []}].
|
||||
|
||||
iq_get_vcard(Lang) ->
|
||||
[{xmlelement, "FN", [],
|
||||
@@ -323,7 +321,7 @@ iq_get_vcard(Lang) ->
|
||||
[{xmlcdata, ?EJABBERD_URI}]},
|
||||
{xmlelement, "DESC", [],
|
||||
[{xmlcdata, translate:translate(Lang, "ejabberd IRC module") ++
|
||||
"\nCopyright (c) 2003-2008 Alexey Shchepin"}]}].
|
||||
"\nCopyright (c) 2003-2009 Alexey Shchepin"}]}].
|
||||
|
||||
process_register(Host, From, To, DefEnc, #iq{} = IQ) ->
|
||||
case catch process_irc_register(Host, From, To, DefEnc, IQ) of
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 15 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
%%% Created : 24 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%%% Created : 24 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
%%% ejabberd, Copyright (C) 2002-2008 Process-one
|
||||
%%% ejabberd, Copyright (C) 2002-2009 ProcessOne
|
||||
%%%
|
||||
%%% This program is free software; you can redistribute it and/or
|
||||
%%% modify it under the terms of the GNU General Public License as
|
||||
@@ -16,7 +16,7 @@
|
||||
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
%%% General Public License for more details.
|
||||
%%%
|
||||
%%%
|
||||
%%% You should have received a copy of the GNU General Public License
|
||||
%%% along with this program; if not, write to the Free Software
|
||||
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
@@ -114,8 +114,6 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
|
||||
get_last(IQ, SubEl, LUser, LServer) ->
|
||||
Username = ejabberd_odbc:escape(LUser),
|
||||
case catch odbc_queries:get_last(LServer, Username) of
|
||||
{'EXIT', _Reason} ->
|
||||
IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]};
|
||||
{selected, ["seconds","state"], []} ->
|
||||
IQ#iq{type = error, sub_el = [SubEl, ?ERR_SERVICE_UNAVAILABLE]};
|
||||
{selected, ["seconds","state"], [{STimeStamp, Status}]} ->
|
||||
@@ -132,7 +130,9 @@ get_last(IQ, SubEl, LUser, LServer) ->
|
||||
_ ->
|
||||
IQ#iq{type = error,
|
||||
sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}
|
||||
end
|
||||
end;
|
||||
_ ->
|
||||
IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}
|
||||
end.
|
||||
|
||||
on_presence_update(User, Server, _Resource, Status) ->
|
||||
@@ -152,8 +152,6 @@ store_last_info(User, Server, TimeStamp, Status) ->
|
||||
get_last_info(LUser, LServer) ->
|
||||
Username = ejabberd_odbc:escape(LUser),
|
||||
case catch odbc_queries:get_last(LServer, Username) of
|
||||
{'EXIT', _Reason} ->
|
||||
not_found;
|
||||
{selected, ["seconds","state"], []} ->
|
||||
not_found;
|
||||
{selected, ["seconds","state"], [{STimeStamp, Status}]} ->
|
||||
@@ -162,7 +160,9 @@ get_last_info(LUser, LServer) ->
|
||||
{ok, TimeStamp, Status};
|
||||
_ ->
|
||||
not_found
|
||||
end
|
||||
end;
|
||||
_ ->
|
||||
not_found
|
||||
end.
|
||||
|
||||
remove_user(User, Server) ->
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user