Hi,
I can abale to register a new user in the openfire database through my client but unable to change the password , though I have enable the openfire admin setting that “User can change their password”…
Please help me
My code is
public function change_password($name, $oldPassword, $newPassword) {
$this->server = ‘192.168.2.74’;
$id = ‘exec_’ . $this->getID();
// $id = ‘change’ . $this->getID();
//
// $out = “”;
// $out .= “”;
// $out .= “{$name}”;
// $out .= “{$name}@wrctechnologies.com”;
// $out .= “{$newPassword}”;
// $out .= “”;
// $out .="";
// // @fwrite($this->socket, $out, strlen($out));
//
//
// return $this->send($out);
//
// $xml = "
// <command xmlns=‘http://jabber.org/protocol/commands’
// node=‘http://jabber.org/protocol/admin#change-user-password’>
//
//
// $name@{$this->server}
//
//
// $newPassword
//
//
//
// ";
$out = “”;
$out .= “”;
$out .= “”;
$out .= “”;
$out .= “$name”;
$out .= “”;
$out .= “”;
$out .= “$newPassword”;
$out .= “”;
// $out .= “”;
// $out .= “new_user”;
// $out .= “”;
// $out .= “”;
// $out .= “new_user@wrctechnologies.com”;
// $out .= “”;
$out .= “”;
$out .= “”;
$out .= “”;
$this->send($out);
// $this->addIdHandler($id, ‘change_password_handler’);
}
protected function change_password_handler($xml) {
switch ($xml->attrs[‘type’]) {
case ‘error’:
$this->event(‘password_changed’, ‘error’);
break;
case ‘result’:
$this->event(‘password_changed’, ‘result’);
break;
default:
$this->event(‘pasword_changed’, ‘default’);
}
}