2012-09-11 11 views
0

我有一個webapp,這是一個遊戲,只有在某些得分的人可以成爲朋友,並應自動添加到彼此的朋友列表。管理名單修改真正的外部web應用程序和禁用用戶?

試圖找出如何處理名冊中Ejabberd這樣

  • 防止任何用戶通過他加入其他人/她
  • 只讓web應用程序處理的修改名冊(好友列表)

使用像strophe這樣的客戶端JS庫不安全我需要通過serverside方法將用戶添加到彼此的名單中。任何想法如何與Ejabberd做到這一點?

編輯: 好吧,這似乎mod_rest爲ejabberd給予(所有?)的ejabbard方法

回答

0

好了,所以以後我是在正確的軌道,我設法弄清楚在一小時內對問題的REST訪問..

  • 安裝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* 
相關問題