<?php
function registerOpenfireUser($userid,$plainpwd,$uname,$email)
{
$url = "http://192.168.0.117:9090/plugins/userService/userservice?type=add&secret=QeQRe100&username=$userid&password=$plainpwd&name=$uname&email=$email";
$f = fopen($url,'r');
//return $url;
$response = fread($f, 1024);
if(ereg('ok',$response)) {
return true;
}else{
return false;
}
fclose($f);
}
$userid = time();
$plainpwd = 123456;
$uname = time();
$email=time()."@liuda360.com";
$result = registerOpenfireUser($userid, $plainpwd, $uname, $email);
echo '<pre>';
var_dump($result);
exit;
?>
密码这里我暂时用了明文,实际项目运用当中请注意使用加密。
function registerOpenfireUser($userid,$plainpwd,$uname,$email)
{
$url = "http://192.168.0.117:9090/plugins/userService/userservice?type=add&secret=QeQRe100&username=$userid&password=$plainpwd&name=$uname&email=$email";
$f = fopen($url,'r');
//return $url;
$response = fread($f, 1024);
if(ereg('ok',$response)) {
return true;
}else{
return false;
}
fclose($f);
}
$userid = time();
$plainpwd = 123456;
$uname = time();
$email=time()."@liuda360.com";
$result = registerOpenfireUser($userid, $plainpwd, $uname, $email);
echo '<pre>';
var_dump($result);
exit;
?>
密码这里我暂时用了明文,实际项目运用当中请注意使用加密。