hi all,
I tryed to add an option to mod_ctlextra to get the password of a user. SO i tryed this
in mod_ctlextra I added these few lines of code.
{"get-password user server", "get password to user@server"},
and
ctl_process(_Val, ["get-password", User, Server]) ->
{ok, Res} = ejabberd_auth:get_password(User, Server),
io:format("~s~n", [Res]),
?STATUS_SUCCESS;
when I try to use ejabberdctl get-password xxx myserver , I got the error "unknow command", I restarted the server but no change :/
I only want to get 2 things:
* user password
here in the db :
{passwd,{"johnny","myserver .com"},"12345"}.
*user group from shared roster group
here in the db:
{sr_user,{"johnny","myserver .com"},
{"newbies_group","myserver .com"}}.
actually I'm doing a dump of the DB the use some php to digg in and found the infos, but the db is getting big and it takes lot of time to find the infos.
anyway a small piece of code to explain how to connect to ejabber mnesia db from an erl module woudl be really helpfull. Then I can use a php exec command to get back the value.
Any help would be greatlly apreciated.
Best regards,
kollo
Try this patch
Try this patch:
working :)
thanks badlop, you are the king :)
I did something a bit similar but without the check. thanks again, I get your code.
regards,
kollo