管理名册修改真正的外部网络应用程序并为用户禁用?
Posted
技术标签:
【中文标题】管理名册修改真正的外部网络应用程序并为用户禁用?【英文标题】:Manage roster modifictions true external webapp and disable for users? 【发布时间】:2012-09-11 15:03:45 【问题描述】:我有一个网络应用程序,它是一个游戏,只有在达到一定分数后,人们才能成为朋友,并且应该自动添加到彼此的好友列表中。
试图弄清楚如何像这样在 Ejabberd 中处理名册
防止任何用户自行添加其他人 只让 webapp 处理对名册的修改(好友列表)使用像 strophe 这样的客户端 JS 库并不安全,我需要将用户添加到彼此名册的服务器端方法。关于如何使用 Ejabberd 执行此操作的任何想法?
编辑: 好的,似乎 ejabberd 的 mod_rest 提供了对(全部?)ejabbard 方法的完全访问权限
【问题讨论】:
【参考方案1】:好吧,在我走上正确的轨道后,我设法在一个小时内弄清楚了..
安装 ejabberd 安装 mod_rest 安装 mod_admin_extra命令:
ejabberdctl help process_rosteritems
:
Command Name: process_rosteritems
Arguments: action::string
subs::string
asks::string
users::string
contacts::string
Returns: res::rescode
Tags: roster
Description: List or delete rosteritems that match filtering options
Explanation of each argument:
- action: what to do with each rosteritem that matches all the filtering options
- subs: subscription type
- asks: pending subscription
- users: the JIDs of the local user
- contacts: the JIDs of the contact in the roster
Allowed values in the arguments:
ACTION = list | delete
SUBS = SUB[:SUB]* | any
SUB = none | from | to | both
ASKS = ASK[:ASK]* | any
ASK = none | out | in
USERS = JID[:JID]* | any
CONTACTS = JID[:JID]* | any
JID = characters valid in a JID, and can use the globs: *, ?, ! and [...]
This example will list roster items with subscription 'none', 'from' or 'to' that have any ask property, of local users which JID is in the virtual host 'example.org'
and that the contact JID is either a bare server name (without user part) or that has a user part and the server part contains the word 'icq':
list none:from:to any *@example.org *:*@*icq*
【讨论】:
以上是关于管理名册修改真正的外部网络应用程序并为用户禁用?的主要内容,如果未能解决你的问题,请参考以下文章