php实现openfire用户同步添加,删除,修改

http://www.igniterealtime.org/projects/openfire/plugins.jsp下载一个插件User Service。

这个插件的作用就是允许程序设计师通过http管理openfire的用户。

部署以后默认user service是没有开启的,你需要到后台开启并且设置验证码,为了确保安全你也许还要设置一个安全的ip~~

服务器部署完成

下面看看如何使用程序调用。

以注册用户为例,以下是我写的一个注册函数

PHP代码
  1. function regIMFunction($userid,$plainpwd,$uname,$email)   
  2. {   
  3.     $f = fopen("http://im.blogguy.cn:9090/plugins/userService/userservice?type=add&secret=J7y&username=$userid&password=$plainpwd&name=$uname&email=$email",'r');    
  4.     $response = fread($f, 1024);   
  5.     if (ereg('OK'$response)) {   
  6.         return true;   
  7.     } else {   
  8.         return false;    
  9.     }   
  10.     fclose($f);   
  11. }     

这样可以实现同步注册。

其他:所有参数如下

The following parameters can be passed into the request:

 

NameDescription
type Required The admin service required. Possible values are add, delete, update
secret Required The secret key that allows access to the User Service.
username Required The username of the user to add, update or delete. ie the part before the @ symbol.
password Required for add operation The password of the new user or the user being updated.
name Optional The display name of the new user or the user being updated.
email Optional The email address of the new user or the user being updated.
groups Optional List of groups where the user is a member. Values are comma delimited.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值