For accomplish that objective i have used the ZIMBRA API https://github.com/zimbra-api/zimbra-api/ and I have been able to change the password of the account, but I have not been able to unlock the account and i do not know what am i doing wrong.
This is a test code, I will later send by parameters the account to be modified and the new password of the function I already have. But only the unlock is not working.
Code: Select all
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$api = \Zimbra\Admin\AdminFactory::instance('https://localhost:7071/service/admin/soap');
$api->auth('admin', 'adminpasswordhere');
$account = new \Zimbra\Struct\AccountSelector(\Zimbra\Enum\AccountBy::NAME(), 'username');
//Process to change password
$id = ((array)$api->getAccountInfo($account)->a[0])["_"];
echo $id."\n";
$passwordInfo = $api->setPassword($id,"mynewpasswordhere");
//I will try to unlock o lock the account
$accountns = new \Zimbra\Struct\AccountNameSelector(\Zimbra\Enum\AccountBy::NAME(), 'username','username');
// I have tried with END() and nothing is done
$req=new \Zimbra\Admin\Request\LockoutMailbox($accountns,\Zimbra\Enum\LockoutOperation::START());
http://useof.org/java-open-source/com.z ... xRequest/2
Any tip or example using PHP would be usefull thanks?