Greetings, i have a site for my call center users, and they can remotely check if an account in the zimbra server is locked or not, if they are locked, i want to add a process to generate the new password and change it, then unlocked the account, I am new with these and do not understand so much, I still keep reading but I am reaching an end path, I have not successfully accomplish my objective.
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.
I have been trying to translate to php the example in following url but not success, and there is not any another examples on the web about how to accomplish these steps
http://useof.org/java-open-source/com.zimbra.soap.admin.message.LockoutMailboxRequest/2
Any tip or example using PHP would be usefull thanks?
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:
<?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());
I have been trying to translate to php the example in following url but not success, and there is not any another examples on the web about how to accomplish these steps
http://useof.org/java-open-source/com.zimbra.soap.admin.message.LockoutMailboxRequest/2
Any tip or example using PHP would be usefull thanks?
Statistics: Posted by rojoblandino — Wed Feb 02, 2022 3:43 am