Commit Graph

119 Commits

Author SHA1 Message Date
Badlop 63b6e0d381 Switch access rule delete_old_users with protect_old_users (#1772) 2017-06-09 19:18:47 +02:00
Badlop b25b5c2f98 Improve export2sql explanation; remove obsolete and duplicated command 2017-06-09 12:02:49 +02:00
Badlop ee8bbccb2a Fix and document push_roster_all command 2017-06-08 19:54:34 +02:00
Evgeniy Khramtsov 35d19b32f4 Implement cache for mod_privacy/mod_blocking 2017-05-20 22:36:32 +03:00
Evgeniy Khramtsov cdb191bb48 Rename is_user_exists -> user_exists 2017-05-11 15:49:06 +03:00
Evgeniy Khramtsov 633b68db11 Use cache for authentication backends
The commit introduces the following API incompatibilities:

In ejabberd_auth.erl:
* dirty_get_registered_users/0 is renamed to get_users/0
* get_vh_registered_users/1 is renamed to get_users/1
* get_vh_registered_users/2 is renamed to get_users/2
* get_vh_registered_users_number/1 is renamed to count_users/1
* get_vh_registered_users_number/2 is renamed to count_users/2

In ejabberd_auth callbacks
* plain_password_required/0 is replaced by plain_password_required/1
  where the argument is a virtual host
* store_type/0 is replaced by store_type/1 where the argument is
  a virtual host
* set_password/3 is now an optional callback
* remove_user/3 callback is no longer needed
* remove_user/2 now should return `ok | {error, atom()}`
* is_user_exists/2 now must only be implemented for backends
  with `external` store type
* check_password/6 is no longer needed
* check_password/4 now must only be implemented for backends
  with `external` store type
* try_register/3 is now an optional callback and should return
  `ok | {error, atom()}`
* dirty_get_registered_users/0 is no longer needed
* get_vh_registered_users/1 is no longer needed
* get_vh_registered_users/2 is renamed to get_users/2
* get_vh_registered_users_number/1 is no longer needed
* get_vh_registered_users_number/2 is renamed to count_users/2
* get_password_s/2 is no longer needed
* get_password/2 now must only be implemented for backends with
  `plain` or `scram` store type

Additionally, the commit introduces two new callbacks:
* use_cache/1 where the argument is a virtual host
* cache_nodes/1 where the argument is a virtual host

New options are also introduced: `auth_use_cache`, `auth_cache_missed`,
`auth_cache_life_time` and `auth_cache_size`.
2017-05-11 14:37:21 +03:00
Badlop d18d99e8ec Bug requesting non-existent data with private_get command (#1690) 2017-04-26 23:14:30 +02:00
Badlop ca9d04ba6b Fix private_get command sending a proper xmlel (#1683) 2017-04-20 16:50:08 +02:00
Christophe Romain b1acd1183f Rename aux.erl as misc.erl
Thanks Microsoft Windows to not support some filenames
2017-04-11 12:13:58 +02:00
Evgeniy Khramtsov 7bcbea2108 Deprecate jlib.erl in favor of aux.erl
Since the main goal of jlib.erl is lost, all auxiliary functions
are now moved to aux.erl, and the whole jlib.erl is now deprecated.
2017-03-30 14:17:13 +03:00
Evgeniy Khramtsov c1439ddd5b Get rid of jid:to_string/1 and jid:from_string/1 2017-02-26 10:07:12 +03:00
Evgeniy Khramtsov 603ec9cb19 Don't pass empty resource to jid:make() 2017-02-25 10:01:01 +03:00
Paweł Chmielowski e8c0e21f71 We don't like now() 2017-02-24 12:08:57 +01:00
Badlop 57181c0a76 get_last now always returns tuple with UTC XEP-0082 and status (#1565) 2017-02-23 23:27:57 +01:00
Badlop 6314a96b05 Protect users from delete_old_users command using a fixed access rule (#1462) 2017-02-23 19:38:17 +01:00
Evgeniy Khramtsov 3c4057ff55 Reload modules when reloading configuration file 2017-02-22 19:46:47 +03:00
Evgeniy Khramtsov 218eeae797 Fix some dialyzer warnings 2017-02-16 14:18:36 +03:00
Evgeniy Khramtsov 8b2d308498 Change routing API
Now 'From' and 'To' arguments must be omitted in functions
and structures related to routing.
The commit deprecates the following functions:
     ejabberd_router:route/3 in favor of ejabberd_router:route/1
     ejabberd_router:route_error/4 in favor of ejabberd_router:route_error/2
     ejabberd_local:route_iq/4 in favor of ejabberd_local:route_iq/2
     ejabberd_local:route_iq/5 in favor of ejabberd_local:route_iq/3
The format of {route, From, To, Packet} is changed in favor of {route, Packet}
2017-02-16 11:10:24 +03:00
Peter Lemenkov e7733ce7d9 Use crypto:hash/2 function
Use crypto:hash/2 function instead of ones from p1_sha.

This function exists since commit
erlang/otp@208f9ad382 and also implemented
as NIF, so I believe it's safe to use it.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2017-02-13 18:42:50 +03:00
Evgeniy Khramtsov d5d906184f Merge branch 'new_stream'
Conflicts:
	src/cyrsasl.erl
	src/ejabberd_c2s.erl
	src/ejabberd_cluster.erl
	src/ejabberd_frontend_socket.erl
	src/ejabberd_node_groups.erl
	src/ejabberd_router.erl
	src/mod_bosh.erl
	src/mod_ip_blacklist.erl
	src/mod_muc_mnesia.erl
	src/mod_offline.erl
	src/mod_proxy65_sm.erl
2017-01-20 19:35:46 +03:00
Badlop 9605e2b2a4 Fix problem with get_vcard command (#1447) 2017-01-06 16:13:57 +01:00
Badlop f5290a8e44 Specify that process_rosteritems command works only with Mnesia storage 2017-01-03 01:38:56 +01:00
Badlop 5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Evgeniy Khramtsov 5cc8e807df Initial version of new XMPP stream behaviour (for review) 2016-12-11 15:03:37 +03:00
Christophe Romain 8a7ea85a7e Cleanup ext_mod and fix compilation path 2016-12-07 09:27:21 +01:00
Christophe Romain 1883a98d1c Fix compilation of external module with new xmpp lib 2016-12-06 12:01:04 +01:00
Christophe Romain 0c2491d9ea Remove obsolete remove_node api (use leave_cluster) 2016-12-05 14:17:57 +01:00
Christophe Romain 95a4b1b266 Cleanup admin_extra, add few functions 2016-11-30 10:31:36 +01:00
Christophe Romain 12683b4aaf Fix typo in copyright date 2016-11-23 14:36:11 +01:00
Paweł Chmielowski 5ffc01db53 Fix types in check_password_hash 2016-11-15 10:02:21 +01:00
Evgeniy Khramtsov b8f22ff538 Deprecate most of the functions from jlib.erl 2016-11-13 10:44:53 +03:00
Evgeniy Khramtsov 78a44e0176 Merge branch 'master' into xml-ng
Conflicts:
	src/adhoc.erl
	src/cyrsasl_oauth.erl
	src/ejabberd_c2s.erl
	src/ejabberd_config.erl
	src/ejabberd_service.erl
	src/gen_mod.erl
	src/mod_admin_extra.erl
	src/mod_announce.erl
	src/mod_carboncopy.erl
	src/mod_client_state.erl
	src/mod_configure.erl
	src/mod_echo.erl
	src/mod_mam.erl
	src/mod_muc.erl
	src/mod_muc_room.erl
	src/mod_offline.erl
	src/mod_pubsub.erl
	src/mod_stats.erl
	src/node_flat_sql.erl
	src/randoms.erl
2016-11-12 13:27:15 +03:00
Badlop bd060bc1bb Support several groups separated by ; in add_rosteritem command 2016-11-04 18:45:27 +01:00
Evgeniy Khramtsov f6236d456d Add more tests for privacy lists and blocking command 2016-10-22 13:01:45 +03:00
Holger Weiss dffcfe74d4 Don't let "send_message" duplicate the message
In the past, the "send_message" command sent a copy of the message to
each resource if the message was addressed to the bare JID of a local
online user.  When message carbons are enabled, this creates duplicates;
and with MAM enabled, each copy is archived.  Therefore, "send_message"
no longer creates copies of the message.
2016-10-10 00:17:17 +02:00
Evgeniy Khramtsov 58969fb854 Improve namespace handling 2016-09-24 14:17:21 +03:00
Badlop 5b4f347da8 Support sql backend in mod_shared_roster commands (#1244) 2016-08-15 15:53:35 +02:00
Christophe Romain 72b0fb49e8 Fix type convertion bug injected by 4ccc40b (#1229) 2016-08-04 09:49:23 +02:00
Mickael Remond 2a49f8cae7
Change name of result key for offline count to value
This is more user friendly and should be more consistent with other commands.
2016-07-30 20:12:04 +02:00
Evgeniy Khramtsov f91f2bc3d2 Rewrite several modules to use XML generator 2016-07-29 13:21:00 +03:00
Holger Weiss 814b80c644 Preserve PID for offline sessions
Don't set the PID to 'undefined' when a session goes offline, as this
looses the information which node created the session table entry.

Fixes #1196.
2016-07-23 01:08:05 +02:00
Evgeniy Khramtsov 4220a2b98c Make modules loading in a dependent order (#1191) 2016-07-06 14:58:48 +03:00
Badlop 4ccc40bce5 push_roster must convert read strings to binaries (#1075) 2016-06-08 21:16:30 +02:00
Holger Weiss bbb90b9928 Ignore offline sessions
Let mod_admin_extra and mod_configure ignore offline sessions when
querying the session table.
2016-06-01 01:01:54 +02:00
Christophe Romain e7843bf92b Fix set_presence API 2016-05-31 11:47:08 +02:00
Matthias Rieber b67dc00db2 Fix check_password 2016-04-10 15:37:36 +02:00
Badlop 27b4217a9d Tweak srg_get_info result formatting (#1048) 2016-04-06 17:55:19 +02:00
Mickael Remond abf768274a Fix error message paramater formatting 2016-04-06 15:05:19 +02:00
Mickael Remond e24da5789e Apply fixes and remove tests for missing methods 2016-04-01 13:05:41 +02:00
Mickael Remond f243c30847 Rollback mod_admin_extra 2016-04-01 12:24:00 +02:00